diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 583d0d86f573..3ebb9bfff662 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.rb b/examples/v2/product-analytics/CreateProductAnalyticsLaunch.rb new file mode 100644 index 000000000000..602df27d5591 --- /dev/null +++ b/examples/v2/product-analytics/CreateProductAnalyticsLaunch.rb @@ -0,0 +1,43 @@ +# Create a launch returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.create_product_analytics_launch".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new + +body = DatadogAPIClient::V2::ProductAnalyticsLaunchCreateRequest.new({ + data: DatadogAPIClient::V2::ProductAnalyticsLaunchCreateData.new({ + attributes: DatadogAPIClient::V2::ProductAnalyticsLaunchRequestAttributes.new({ + context: "Let users apply promo codes at checkout.", + description: "Promo codes at checkout.", + kpis: [ + DatadogAPIClient::V2::ProductAnalyticsLaunchKPI.new({ + id: "7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10", + title: "Checkout conversion rate", + }), + ], + name: "checkout_promo_codes", + phase: DatadogAPIClient::V2::ProductAnalyticsLaunchPhase::PLAN, + steps: DatadogAPIClient::V2::ProductAnalyticsLaunchStepsRequest.new({ + tracking_plan: DatadogAPIClient::V2::ProductAnalyticsLaunchTrackingPlanRequest.new({ + events: [ + DatadogAPIClient::V2::ProductAnalyticsLaunchEvent.new({ + kpis: [ + "7c1e6a52-3a8f-4d4e-9a55-2f1d1c8b6a10", + ], + name: "promo_code_applied", + trigger: "The user applies a valid promo code.", + views: [ + "/checkout", + ], + }), + ], + }), + }), + }), + type: DatadogAPIClient::V2::ProductAnalyticsLaunchType::LIFTOFF, + }), +}) +p api_instance.create_product_analytics_launch(body) diff --git a/examples/v2/product-analytics/CreateProductAnalyticsMonitor.rb b/examples/v2/product-analytics/CreateProductAnalyticsMonitor.rb new file mode 100644 index 000000000000..7e8f709d04bf --- /dev/null +++ b/examples/v2/product-analytics/CreateProductAnalyticsMonitor.rb @@ -0,0 +1,32 @@ +# Create a Product Analytics monitor returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_product_analytics_monitor".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new + +body = DatadogAPIClient::V2::ProductAnalyticsMonitorCreateRequest.new({ + data: DatadogAPIClient::V2::ProductAnalyticsMonitorCreateData.new({ + attributes: DatadogAPIClient::V2::ProductAnalyticsMonitorCreateAttributes.new({ + message: 'Conversion from /a to /b dropped over the last hour\n\n@slack-my-alerts-channel', + name: "Funnel conversion drop", + options: DatadogAPIClient::V2::ProductAnalyticsMonitorOptions.new({ + thresholds: DatadogAPIClient::V2::ProductAnalyticsMonitorThresholds.new({ + critical: 1, + warning: 2, + }), + variables: [ + DatadogAPIClient::V2::ProductAnalyticsMonitorVariable.new({}), + ], + }), + priority: 3, + query: 'formula("query").rollup("sum").last("1h") < 1', + tags: { + chart_id: "chart-1", query_type: "funnel", + }, + }), + type: DatadogAPIClient::V2::ProductAnalyticsMonitorRequestType::PA_MONITOR_REQUEST, + }), +}) +p api_instance.create_product_analytics_monitor(body) diff --git a/examples/v2/product-analytics/DeleteProductAnalyticsLaunch.rb b/examples/v2/product-analytics/DeleteProductAnalyticsLaunch.rb new file mode 100644 index 000000000000..237d584fe723 --- /dev/null +++ b/examples/v2/product-analytics/DeleteProductAnalyticsLaunch.rb @@ -0,0 +1,9 @@ +# Delete a launch returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.delete_product_analytics_launch".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new +api_instance.delete_product_analytics_launch("5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c") diff --git a/examples/v2/product-analytics/DeleteProductAnalyticsMonitor.rb b/examples/v2/product-analytics/DeleteProductAnalyticsMonitor.rb new file mode 100644 index 000000000000..e16f5601b2fe --- /dev/null +++ b/examples/v2/product-analytics/DeleteProductAnalyticsMonitor.rb @@ -0,0 +1,8 @@ +# Delete a Product Analytics monitor returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_product_analytics_monitor".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new +api_instance.delete_product_analytics_monitor("12345") diff --git a/examples/v2/product-analytics/GetProductAnalyticsLaunch.rb b/examples/v2/product-analytics/GetProductAnalyticsLaunch.rb new file mode 100644 index 000000000000..7afa82a029e8 --- /dev/null +++ b/examples/v2/product-analytics/GetProductAnalyticsLaunch.rb @@ -0,0 +1,9 @@ +# Get a launch returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.get_product_analytics_launch".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new +p api_instance.get_product_analytics_launch("5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c") diff --git a/examples/v2/product-analytics/GetProductAnalyticsMonitor.rb b/examples/v2/product-analytics/GetProductAnalyticsMonitor.rb new file mode 100644 index 000000000000..4928cbac3b32 --- /dev/null +++ b/examples/v2/product-analytics/GetProductAnalyticsMonitor.rb @@ -0,0 +1,8 @@ +# Get a Product Analytics monitor returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_product_analytics_monitor".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new +p api_instance.get_product_analytics_monitor("12345") diff --git a/examples/v2/product-analytics/ListProductAnalyticsLaunches.rb b/examples/v2/product-analytics/ListProductAnalyticsLaunches.rb new file mode 100644 index 000000000000..ed0753ef9885 --- /dev/null +++ b/examples/v2/product-analytics/ListProductAnalyticsLaunches.rb @@ -0,0 +1,9 @@ +# List launches returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.list_product_analytics_launches".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new +p api_instance.list_product_analytics_launches() diff --git a/examples/v2/product-analytics/ListProductAnalyticsMonitors.rb b/examples/v2/product-analytics/ListProductAnalyticsMonitors.rb new file mode 100644 index 000000000000..ca4cabb795c5 --- /dev/null +++ b/examples/v2/product-analytics/ListProductAnalyticsMonitors.rb @@ -0,0 +1,8 @@ +# List Product Analytics monitors returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_product_analytics_monitors".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new +p api_instance.list_product_analytics_monitors() diff --git a/examples/v2/product-analytics/PatchProductAnalyticsLaunch.rb b/examples/v2/product-analytics/PatchProductAnalyticsLaunch.rb new file mode 100644 index 000000000000..53f7cd0a92ff --- /dev/null +++ b/examples/v2/product-analytics/PatchProductAnalyticsLaunch.rb @@ -0,0 +1,19 @@ +# Update a launch returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.patch_product_analytics_launch".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new + +body = DatadogAPIClient::V2::ProductAnalyticsLaunchPatchRequest.new({ + data: DatadogAPIClient::V2::ProductAnalyticsLaunchPatchData.new({ + attributes: DatadogAPIClient::V2::ProductAnalyticsLaunchPatchAttributes.new({ + phase: DatadogAPIClient::V2::ProductAnalyticsLaunchPhase::SETUP, + }), + id: "5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c", + type: DatadogAPIClient::V2::ProductAnalyticsLaunchType::LIFTOFF, + }), +}) +p api_instance.patch_product_analytics_launch("5e3c7a1b-2d4f-4e6a-8b9c-0d1e2f3a4b5c", body) diff --git a/examples/v2/product-analytics/RemoveChartFromProductAnalyticsMonitor.rb b/examples/v2/product-analytics/RemoveChartFromProductAnalyticsMonitor.rb new file mode 100644 index 000000000000..e3fcb6c96088 --- /dev/null +++ b/examples/v2/product-analytics/RemoveChartFromProductAnalyticsMonitor.rb @@ -0,0 +1,18 @@ +# Unlink a Product Analytics monitor from its chart returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.remove_chart_from_product_analytics_monitor".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new + +body = DatadogAPIClient::V2::ProductAnalyticsMonitorUnlinkRequest.new({ + data: DatadogAPIClient::V2::ProductAnalyticsMonitorUnlinkData.new({ + attributes: DatadogAPIClient::V2::ProductAnalyticsMonitorUnlinkAttributes.new({ + chart_id: "chart-1", + dashboard_id: "dash-1", + }), + type: DatadogAPIClient::V2::ProductAnalyticsMonitorUnlinkRequestType::PA_MONITOR_UNLINK_REQUEST, + }), +}) +api_instance.remove_chart_from_product_analytics_monitor("12345", body) diff --git a/examples/v2/product-analytics/UpdateProductAnalyticsMonitor.rb b/examples/v2/product-analytics/UpdateProductAnalyticsMonitor.rb new file mode 100644 index 000000000000..47f4550e6ddc --- /dev/null +++ b/examples/v2/product-analytics/UpdateProductAnalyticsMonitor.rb @@ -0,0 +1,23 @@ +# Update a Product Analytics monitor returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_product_analytics_monitor".to_sym] = true +end +api_instance = DatadogAPIClient::V2::ProductAnalyticsAPI.new + +body = DatadogAPIClient::V2::ProductAnalyticsMonitorUpdateRequest.new({ + data: DatadogAPIClient::V2::ProductAnalyticsMonitorUpdateData.new({ + attributes: DatadogAPIClient::V2::ProductAnalyticsMonitorUpdateAttributes.new({ + name: "Funnel conversion drop", + options: DatadogAPIClient::V2::ProductAnalyticsMonitorOptions.new({ + thresholds: DatadogAPIClient::V2::ProductAnalyticsMonitorThresholds.new({ + critical: 1, + warning: 1.5, + }), + }), + }), + type: DatadogAPIClient::V2::ProductAnalyticsMonitorRequestType::PA_MONITOR_REQUEST, + }), +}) +p api_instance.update_product_analytics_monitor("12345", body) diff --git a/examples/v2/rum-audience-management/CreateProductAnalyticsSegment.rb b/examples/v2/rum-audience-management/CreateProductAnalyticsSegment.rb new file mode 100644 index 000000000000..07cde795e86b --- /dev/null +++ b/examples/v2/rum-audience-management/CreateProductAnalyticsSegment.rb @@ -0,0 +1,33 @@ +# Create a segment returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.create_product_analytics_segment".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumAudienceManagementAPI.new + +body = DatadogAPIClient::V2::SegmentCreateRequest.new({ + data: DatadogAPIClient::V2::SegmentCreateData.new({ + attributes: DatadogAPIClient::V2::SegmentCreateAttributes.new({ + data_query: DatadogAPIClient::V2::SegmentDataQuery.new({ + event_platform: [ + DatadogAPIClient::V2::SegmentEventPlatformBlock.new({ + 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: DatadogAPIClient::V2::SegmentResourceType::SEGMENT, + }), +}) +p api_instance.create_product_analytics_segment(body) diff --git a/examples/v2/rum-audience-management/DeleteProductAnalyticsSegment.rb b/examples/v2/rum-audience-management/DeleteProductAnalyticsSegment.rb new file mode 100644 index 000000000000..1257af72b3cd --- /dev/null +++ b/examples/v2/rum-audience-management/DeleteProductAnalyticsSegment.rb @@ -0,0 +1,9 @@ +# Delete a segment returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.delete_product_analytics_segment".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumAudienceManagementAPI.new +p api_instance.delete_product_analytics_segment("8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d") diff --git a/examples/v2/rum-audience-management/GetProductAnalyticsSegment.rb b/examples/v2/rum-audience-management/GetProductAnalyticsSegment.rb new file mode 100644 index 000000000000..7a2453437f98 --- /dev/null +++ b/examples/v2/rum-audience-management/GetProductAnalyticsSegment.rb @@ -0,0 +1,9 @@ +# Get a segment returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.get_product_analytics_segment".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumAudienceManagementAPI.new +p api_instance.get_product_analytics_segment("8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d") diff --git a/examples/v2/rum-audience-management/ListProductAnalyticsSegments.rb b/examples/v2/rum-audience-management/ListProductAnalyticsSegments.rb new file mode 100644 index 000000000000..713b21030da2 --- /dev/null +++ b/examples/v2/rum-audience-management/ListProductAnalyticsSegments.rb @@ -0,0 +1,9 @@ +# List segments returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.list_product_analytics_segments".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumAudienceManagementAPI.new +p api_instance.list_product_analytics_segments() diff --git a/examples/v2/rum-audience-management/PreviewProductAnalyticsSegment.rb b/examples/v2/rum-audience-management/PreviewProductAnalyticsSegment.rb new file mode 100644 index 000000000000..d8ca845e1d1f --- /dev/null +++ b/examples/v2/rum-audience-management/PreviewProductAnalyticsSegment.rb @@ -0,0 +1,33 @@ +# Preview a segment returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.preview_product_analytics_segment".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumAudienceManagementAPI.new + +body = DatadogAPIClient::V2::SegmentPreviewRequest.new({ + data: DatadogAPIClient::V2::SegmentPreviewData.new({ + attributes: DatadogAPIClient::V2::SegmentPreviewAttributes.new({ + data_query: DatadogAPIClient::V2::SegmentDataQuery.new({ + event_platform: [ + DatadogAPIClient::V2::SegmentEventPlatformBlock.new({ + 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: DatadogAPIClient::V2::SegmentPreviewRequestType::SEGMENT_PREVIEW_REQUEST, + }), +}) +p api_instance.preview_product_analytics_segment(body) diff --git a/examples/v2/rum-audience-management/UpdateProductAnalyticsSegment.rb b/examples/v2/rum-audience-management/UpdateProductAnalyticsSegment.rb new file mode 100644 index 000000000000..3b8c2d3d0111 --- /dev/null +++ b/examples/v2/rum-audience-management/UpdateProductAnalyticsSegment.rb @@ -0,0 +1,20 @@ +# Update a segment returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.access_token = ENV["DD_BEARER_TOKEN"] + config.unstable_operations["v2.update_product_analytics_segment".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RumAudienceManagementAPI.new + +body = DatadogAPIClient::V2::SegmentUpdateRequest.new({ + data: DatadogAPIClient::V2::SegmentUpdateData.new({ + attributes: DatadogAPIClient::V2::SegmentUpdateAttributes.new({ + description: "Users who viewed the logs page in the last 7 days.", + name: "High-value users", + }), + id: "8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", + type: DatadogAPIClient::V2::SegmentResourceType::SEGMENT, + }), +}) +api_instance.update_product_analytics_segment("8a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 07274057c608..0fd6fd8612a9 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -6020,6 +6020,49 @@ "v2.QueryProductAnalyticsJourneyTimeseries" => { "body" => "ProductAnalyticsFormulaJourneyRequest", }, + "v2.ListProductAnalyticsLaunches" => { + "sort" => "String", + "scope" => "ProductAnalyticsLaunchListScope", + "phase" => "Array", + "application_id" => "String", + "name" => "String", + }, + "v2.CreateProductAnalyticsLaunch" => { + "body" => "ProductAnalyticsLaunchCreateRequest", + }, + "v2.DeleteProductAnalyticsLaunch" => { + "id" => "String", + }, + "v2.GetProductAnalyticsLaunch" => { + "id" => "String", + }, + "v2.PatchProductAnalyticsLaunch" => { + "id" => "String", + "body" => "ProductAnalyticsLaunchPatchRequest", + }, + "v2.ListProductAnalyticsMonitors" => { + "page_size" => "Integer", + "page_number" => "Integer", + "chart_id" => "String", + "dashboard_id" => "String", + }, + "v2.CreateProductAnalyticsMonitor" => { + "body" => "ProductAnalyticsMonitorCreateRequest", + }, + "v2.DeleteProductAnalyticsMonitor" => { + "monitor_id" => "String", + }, + "v2.GetProductAnalyticsMonitor" => { + "monitor_id" => "String", + }, + "v2.UpdateProductAnalyticsMonitor" => { + "monitor_id" => "String", + "body" => "ProductAnalyticsMonitorUpdateRequest", + }, + "v2.RemoveChartFromProductAnalyticsMonitor" => { + "monitor_id" => "String", + "body" => "ProductAnalyticsMonitorUnlinkRequest", + }, "v2.QueryProductAnalyticsRetentionGrid" => { "body" => "ProductAnalyticsRetentionGridRequest", }, @@ -6041,6 +6084,31 @@ "v2.QueryAccounts" => { "body" => "QueryAccountRequest", }, + "v2.ListProductAnalyticsSegments" => { + "filter_entity" => "SegmentEntity", + "filter_type" => "String", + "filter_ids" => "String", + "filter_disabled" => "Boolean", + "sort_column" => "SegmentSortColumn", + "sort_order" => "QuerySortOrder", + "limit" => "Integer", + }, + "v2.CreateProductAnalyticsSegment" => { + "body" => "SegmentCreateRequest", + }, + "v2.DeleteProductAnalyticsSegment" => { + "id" => "String", + }, + "v2.GetProductAnalyticsSegment" => { + "id" => "String", + }, + "v2.UpdateProductAnalyticsSegment" => { + "id" => "String", + "body" => "SegmentUpdateRequest", + }, + "v2.PreviewProductAnalyticsSegment" => { + "body" => "SegmentPreviewRequest", + }, "v2.QueryEventFilteredUsers" => { "body" => "QueryEventFilteredUsersRequest", }, diff --git a/features/v2/product_analytics.feature b/features/v2/product_analytics.feature index 1af45e54a76d..db44330b8a63 100644 --- a/features/v2/product_analytics.feature +++ b/features/v2/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/features/v2/rum_audience_management.feature b/features/v2/rum_audience_management.feature index e4514231dfe5..85d6be9d867a 100644 --- a/features/v2/rum_audience_management.feature +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index 0d9b33aa46f6..14d4ebb4928c 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index f3c25b0e12e0..c3abea6191df 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -792,6 +792,15 @@ def initialize "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, @@ -802,17 +811,25 @@ def initialize "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/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 01c6d5579703..b12cac0ee80e 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -7544,6 +7544,59 @@ def overrides "v2.product_analytics_journey_timeseries_response" => "ProductAnalyticsJourneyTimeseriesResponse", "v2.product_analytics_journey_timeseries_response_data" => "ProductAnalyticsJourneyTimeseriesResponseData", "v2.product_analytics_journey_timeseries_response_type" => "ProductAnalyticsJourneyTimeseriesResponseType", + "v2.product_analytics_launch_attributes" => "ProductAnalyticsLaunchAttributes", + "v2.product_analytics_launch_code_analysis" => "ProductAnalyticsLaunchCodeAnalysis", + "v2.product_analytics_launch_code_status" => "ProductAnalyticsLaunchCodeStatus", + "v2.product_analytics_launch_create_data" => "ProductAnalyticsLaunchCreateData", + "v2.product_analytics_launch_create_request" => "ProductAnalyticsLaunchCreateRequest", + "v2.product_analytics_launch_dashboard_step" => "ProductAnalyticsLaunchDashboardStep", + "v2.product_analytics_launch_data" => "ProductAnalyticsLaunchData", + "v2.product_analytics_launches_response" => "ProductAnalyticsLaunchesResponse", + "v2.product_analytics_launch_event" => "ProductAnalyticsLaunchEvent", + "v2.product_analytics_launch_event_finding" => "ProductAnalyticsLaunchEventFinding", + "v2.product_analytics_launch_event_property" => "ProductAnalyticsLaunchEventProperty", + "v2.product_analytics_launch_experiment_step" => "ProductAnalyticsLaunchExperimentStep", + "v2.product_analytics_launch_funnel_step" => "ProductAnalyticsLaunchFunnelStep", + "v2.product_analytics_launch_kpi" => "ProductAnalyticsLaunchKPI", + "v2.product_analytics_launch_list_scope" => "ProductAnalyticsLaunchListScope", + "v2.product_analytics_launch_patch_attributes" => "ProductAnalyticsLaunchPatchAttributes", + "v2.product_analytics_launch_patch_data" => "ProductAnalyticsLaunchPatchData", + "v2.product_analytics_launch_patch_request" => "ProductAnalyticsLaunchPatchRequest", + "v2.product_analytics_launch_patch_steps" => "ProductAnalyticsLaunchPatchSteps", + "v2.product_analytics_launch_phase" => "ProductAnalyticsLaunchPhase", + "v2.product_analytics_launch_property" => "ProductAnalyticsLaunchProperty", + "v2.product_analytics_launch_property_finding" => "ProductAnalyticsLaunchPropertyFinding", + "v2.product_analytics_launch_request_attributes" => "ProductAnalyticsLaunchRequestAttributes", + "v2.product_analytics_launch_response" => "ProductAnalyticsLaunchResponse", + "v2.product_analytics_launch_steps" => "ProductAnalyticsLaunchSteps", + "v2.product_analytics_launch_steps_request" => "ProductAnalyticsLaunchStepsRequest", + "v2.product_analytics_launch_tracking_plan" => "ProductAnalyticsLaunchTrackingPlan", + "v2.product_analytics_launch_tracking_plan_request" => "ProductAnalyticsLaunchTrackingPlanRequest", + "v2.product_analytics_launch_type" => "ProductAnalyticsLaunchType", + "v2.product_analytics_monitor_attributes" => "ProductAnalyticsMonitorAttributes", + "v2.product_analytics_monitor_create_attributes" => "ProductAnalyticsMonitorCreateAttributes", + "v2.product_analytics_monitor_create_data" => "ProductAnalyticsMonitorCreateData", + "v2.product_analytics_monitor_create_request" => "ProductAnalyticsMonitorCreateRequest", + "v2.product_analytics_monitor_creator" => "ProductAnalyticsMonitorCreator", + "v2.product_analytics_monitor_data" => "ProductAnalyticsMonitorData", + "v2.product_analytics_monitor_list_attributes" => "ProductAnalyticsMonitorListAttributes", + "v2.product_analytics_monitor_list_data" => "ProductAnalyticsMonitorListData", + "v2.product_analytics_monitor_list_item" => "ProductAnalyticsMonitorListItem", + "v2.product_analytics_monitor_list_response" => "ProductAnalyticsMonitorListResponse", + "v2.product_analytics_monitor_list_type" => "ProductAnalyticsMonitorListType", + "v2.product_analytics_monitor_options" => "ProductAnalyticsMonitorOptions", + "v2.product_analytics_monitor_request_type" => "ProductAnalyticsMonitorRequestType", + "v2.product_analytics_monitor_response" => "ProductAnalyticsMonitorResponse", + "v2.product_analytics_monitor_status" => "ProductAnalyticsMonitorStatus", + "v2.product_analytics_monitor_thresholds" => "ProductAnalyticsMonitorThresholds", + "v2.product_analytics_monitor_type" => "ProductAnalyticsMonitorType", + "v2.product_analytics_monitor_unlink_attributes" => "ProductAnalyticsMonitorUnlinkAttributes", + "v2.product_analytics_monitor_unlink_data" => "ProductAnalyticsMonitorUnlinkData", + "v2.product_analytics_monitor_unlink_request" => "ProductAnalyticsMonitorUnlinkRequest", + "v2.product_analytics_monitor_unlink_request_type" => "ProductAnalyticsMonitorUnlinkRequestType", + "v2.product_analytics_monitor_update_attributes" => "ProductAnalyticsMonitorUpdateAttributes", + "v2.product_analytics_monitor_update_data" => "ProductAnalyticsMonitorUpdateData", + "v2.product_analytics_monitor_update_request" => "ProductAnalyticsMonitorUpdateRequest", "v2.product_analytics_occurrence_filter" => "ProductAnalyticsOccurrenceFilter", "v2.product_analytics_occurrence_query" => "ProductAnalyticsOccurrenceQuery", "v2.product_analytics_occurrence_query_data_source" => "ProductAnalyticsOccurrenceQueryDataSource", @@ -8872,6 +8925,43 @@ def overrides "v2.security_monitoring_user" => "SecurityMonitoringUser", "v2.security_trigger" => "SecurityTrigger", "v2.security_trigger_wrapper" => "SecurityTriggerWrapper", + "v2.segment_attributes" => "SegmentAttributes", + "v2.segment_create_attributes" => "SegmentCreateAttributes", + "v2.segment_create_data" => "SegmentCreateData", + "v2.segment_create_request" => "SegmentCreateRequest", + "v2.segment_data" => "SegmentData", + "v2.segment_data_query" => "SegmentDataQuery", + "v2.segment_delete_attributes" => "SegmentDeleteAttributes", + "v2.segment_delete_data" => "SegmentDeleteData", + "v2.segment_deleted_type" => "SegmentDeletedType", + "v2.segment_delete_response" => "SegmentDeleteResponse", + "v2.segment_entity" => "SegmentEntity", + "v2.segment_event_platform_block" => "SegmentEventPlatformBlock", + "v2.segment_journey_block" => "SegmentJourneyBlock", + "v2.segment_preview_attributes" => "SegmentPreviewAttributes", + "v2.segment_preview_data" => "SegmentPreviewData", + "v2.segment_preview_request" => "SegmentPreviewRequest", + "v2.segment_preview_request_type" => "SegmentPreviewRequestType", + "v2.segment_preview_response" => "SegmentPreviewResponse", + "v2.segment_preview_response_attributes" => "SegmentPreviewResponseAttributes", + "v2.segment_preview_response_data" => "SegmentPreviewResponseData", + "v2.segment_preview_response_type" => "SegmentPreviewResponseType", + "v2.segment_profile_store_block" => "SegmentProfileStoreBlock", + "v2.segment_reference_table_block" => "SegmentReferenceTableBlock", + "v2.segment_reference_table_column" => "SegmentReferenceTableColumn", + "v2.segment_reference_table_join_condition" => "SegmentReferenceTableJoinCondition", + "v2.segment_resource_type" => "SegmentResourceType", + "v2.segment_response" => "SegmentResponse", + "v2.segment_sort_column" => "SegmentSortColumn", + "v2.segments_response" => "SegmentsResponse", + "v2.segment_static_block" => "SegmentStaticBlock", + "v2.segment_summary_attributes" => "SegmentSummaryAttributes", + "v2.segment_summary_data" => "SegmentSummaryData", + "v2.segment_template_block" => "SegmentTemplateBlock", + "v2.segment_update_attributes" => "SegmentUpdateAttributes", + "v2.segment_update_data" => "SegmentUpdateData", + "v2.segment_update_request" => "SegmentUpdateRequest", + "v2.segment_user" => "SegmentUser", "v2.selectors" => "Selectors", "v2.self_service_trigger_wrapper" => "SelfServiceTriggerWrapper", "v2.send_slack_message_action" => "SendSlackMessageAction", diff --git a/lib/datadog_api_client/v2/api/product_analytics_api.rb b/lib/datadog_api_client/v2/api/product_analytics_api.rb index b4d47be0f0c9..3e71297b5d88 100644 --- a/lib/datadog_api_client/v2/api/product_analytics_api.rb +++ b/lib/datadog_api_client/v2/api/product_analytics_api.rb @@ -23,6 +23,686 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Create a launch. + # + # @see #create_product_analytics_launch_with_http_info + def create_product_analytics_launch(body, opts = {}) + data, _status_code, _headers = create_product_analytics_launch_with_http_info(body, opts) + data + end + + # 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. + # + # @param body [ProductAnalyticsLaunchCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ProductAnalyticsLaunchResponse, Integer, Hash)>] ProductAnalyticsLaunchResponse data, response status code and response headers + def create_product_analytics_launch_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_product_analytics_launch".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_product_analytics_launch") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_product_analytics_launch")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.create_product_analytics_launch ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.create_product_analytics_launch" + end + # resource path + local_var_path = '/api/v2/product-analytics/launches' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ProductAnalyticsLaunchResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_product_analytics_launch, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProductAnalyticsAPI#create_product_analytics_launch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a Product Analytics monitor. + # + # @see #create_product_analytics_monitor_with_http_info + def create_product_analytics_monitor(body, opts = {}) + data, _status_code, _headers = create_product_analytics_monitor_with_http_info(body, opts) + data + end + + # 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. + # + # @param body [ProductAnalyticsMonitorCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ProductAnalyticsMonitorResponse, Integer, Hash)>] ProductAnalyticsMonitorResponse data, response status code and response headers + def create_product_analytics_monitor_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_product_analytics_monitor".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_product_analytics_monitor") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_product_analytics_monitor")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.create_product_analytics_monitor ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.create_product_analytics_monitor" + end + # resource path + local_var_path = '/api/v2/product-analytics/monitors' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ProductAnalyticsMonitorResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_product_analytics_monitor, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProductAnalyticsAPI#create_product_analytics_monitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a launch. + # + # @see #delete_product_analytics_launch_with_http_info + def delete_product_analytics_launch(id, opts = {}) + delete_product_analytics_launch_with_http_info(id, opts) + nil + end + + # Delete a launch. + # + # Delete a Product Analytics launch and its tracking plan. + # + # @param id [String] UUID of the launch. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_product_analytics_launch_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_product_analytics_launch".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_product_analytics_launch") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_product_analytics_launch")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.delete_product_analytics_launch ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProductAnalyticsAPI.delete_product_analytics_launch" + end + # resource path + local_var_path = '/api/v2/product-analytics/launches/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_product_analytics_launch, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProductAnalyticsAPI#delete_product_analytics_launch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a Product Analytics monitor. + # + # @see #delete_product_analytics_monitor_with_http_info + def delete_product_analytics_monitor(monitor_id, opts = {}) + delete_product_analytics_monitor_with_http_info(monitor_id, opts) + nil + end + + # Delete a Product Analytics monitor. + # + # Delete a Product Analytics monitor. + # + # @param monitor_id [String] ID of the monitor. It is a numeric ID. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_product_analytics_monitor_with_http_info(monitor_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_product_analytics_monitor".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_product_analytics_monitor") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_product_analytics_monitor")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.delete_product_analytics_monitor ...' + end + # verify the required parameter 'monitor_id' is set + if @api_client.config.client_side_validation && monitor_id.nil? + fail ArgumentError, "Missing the required parameter 'monitor_id' when calling ProductAnalyticsAPI.delete_product_analytics_monitor" + end + # resource path + local_var_path = '/api/v2/product-analytics/monitors/{monitor_id}'.sub('{monitor_id}', CGI.escape(monitor_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_product_analytics_monitor, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProductAnalyticsAPI#delete_product_analytics_monitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a launch. + # + # @see #get_product_analytics_launch_with_http_info + def get_product_analytics_launch(id, opts = {}) + data, _status_code, _headers = get_product_analytics_launch_with_http_info(id, opts) + data + end + + # Get a launch. + # + # Get a Product Analytics launch and its tracking plan by UUID. + # + # @param id [String] UUID of the launch. + # @param opts [Hash] the optional parameters + # @return [Array<(ProductAnalyticsLaunchResponse, Integer, Hash)>] ProductAnalyticsLaunchResponse data, response status code and response headers + def get_product_analytics_launch_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_product_analytics_launch".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_product_analytics_launch") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_product_analytics_launch")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.get_product_analytics_launch ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProductAnalyticsAPI.get_product_analytics_launch" + end + # resource path + local_var_path = '/api/v2/product-analytics/launches/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ProductAnalyticsLaunchResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_product_analytics_launch, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProductAnalyticsAPI#get_product_analytics_launch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a Product Analytics monitor. + # + # @see #get_product_analytics_monitor_with_http_info + def get_product_analytics_monitor(monitor_id, opts = {}) + data, _status_code, _headers = get_product_analytics_monitor_with_http_info(monitor_id, opts) + data + end + + # Get a Product Analytics monitor. + # + # Get a Product Analytics monitor by its ID. + # + # @param monitor_id [String] ID of the monitor. It is a numeric ID. + # @param opts [Hash] the optional parameters + # @return [Array<(ProductAnalyticsMonitorResponse, Integer, Hash)>] ProductAnalyticsMonitorResponse data, response status code and response headers + def get_product_analytics_monitor_with_http_info(monitor_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_product_analytics_monitor".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_product_analytics_monitor") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_product_analytics_monitor")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.get_product_analytics_monitor ...' + end + # verify the required parameter 'monitor_id' is set + if @api_client.config.client_side_validation && monitor_id.nil? + fail ArgumentError, "Missing the required parameter 'monitor_id' when calling ProductAnalyticsAPI.get_product_analytics_monitor" + end + # resource path + local_var_path = '/api/v2/product-analytics/monitors/{monitor_id}'.sub('{monitor_id}', CGI.escape(monitor_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ProductAnalyticsMonitorResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_product_analytics_monitor, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProductAnalyticsAPI#get_product_analytics_monitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List launches. + # + # @see #list_product_analytics_launches_with_http_info + def list_product_analytics_launches(opts = {}) + data, _status_code, _headers = list_product_analytics_launches_with_http_info(opts) + data + end + + # 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 opts [Hash] the optional parameters + # @option opts [String] :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. + # @option opts [ProductAnalyticsLaunchListScope] :scope Set to `liftoffs` to leave out launches in the `plan` phase. + # @option opts [Array] :phase Return only launches in these phases. Repeat the parameter to pass several phases. + # @option opts [String] :application_id Return only launches of this RUM application UUID. + # @option opts [String] :name Return only launches whose name contains this value, ignoring case. + # @return [Array<(ProductAnalyticsLaunchesResponse, Integer, Hash)>] ProductAnalyticsLaunchesResponse data, response status code and response headers + def list_product_analytics_launches_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_product_analytics_launches".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_product_analytics_launches") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_product_analytics_launches")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.list_product_analytics_launches ...' + end + allowable_values = ['liftoffs'] + if @api_client.config.client_side_validation && opts[:'scope'] && !allowable_values.include?(opts[:'scope']) + fail ArgumentError, "invalid value for \"scope\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/product-analytics/launches' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil? + query_params[:'phase'] = @api_client.build_collection_param(opts[:'phase'], :multi) if !opts[:'phase'].nil? + query_params[:'application_id'] = opts[:'application_id'] if !opts[:'application_id'].nil? + query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ProductAnalyticsLaunchesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_product_analytics_launches, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProductAnalyticsAPI#list_product_analytics_launches\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Product Analytics monitors. + # + # @see #list_product_analytics_monitors_with_http_info + def list_product_analytics_monitors(opts = {}) + data, _status_code, _headers = list_product_analytics_monitors_with_http_info(opts) + data + end + + # 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 opts [Hash] the optional parameters + # @option opts [Integer] :page_size Maximum number of monitors per page, from 1 to 1000. Ignored when `chart_id` is set. + # @option opts [Integer] :page_number Page number, starting at 1. Ignored when `chart_id` is set. + # @option opts [String] :chart_id Return only the monitors linked to this chart. Turns off pagination. + # @option opts [String] :dashboard_id Return only the monitors linked to this dashboard. Requires `chart_id`. + # @return [Array<(ProductAnalyticsMonitorListResponse, Integer, Hash)>] ProductAnalyticsMonitorListResponse data, response status code and response headers + def list_product_analytics_monitors_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_product_analytics_monitors".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_product_analytics_monitors") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_product_analytics_monitors")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.list_product_analytics_monitors ...' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProductAnalyticsAPI.list_product_analytics_monitors, must be smaller than or equal to 1000.' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProductAnalyticsAPI.list_product_analytics_monitors, must be greater than or equal to 1.' + end + if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling ProductAnalyticsAPI.list_product_analytics_monitors, must be greater than or equal to 1.' + end + # resource path + local_var_path = '/api/v2/product-analytics/monitors' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'chart_id'] = opts[:'chart_id'] if !opts[:'chart_id'].nil? + query_params[:'dashboard_id'] = opts[:'dashboard_id'] if !opts[:'dashboard_id'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ProductAnalyticsMonitorListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_product_analytics_monitors, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProductAnalyticsAPI#list_product_analytics_monitors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a launch. + # + # @see #patch_product_analytics_launch_with_http_info + def patch_product_analytics_launch(id, body, opts = {}) + data, _status_code, _headers = patch_product_analytics_launch_with_http_info(id, body, opts) + data + end + + # 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 [String] UUID of the launch. + # @param body [ProductAnalyticsLaunchPatchRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ProductAnalyticsLaunchResponse, Integer, Hash)>] ProductAnalyticsLaunchResponse data, response status code and response headers + def patch_product_analytics_launch_with_http_info(id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.patch_product_analytics_launch".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.patch_product_analytics_launch") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.patch_product_analytics_launch")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.patch_product_analytics_launch ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ProductAnalyticsAPI.patch_product_analytics_launch" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.patch_product_analytics_launch" + end + # resource path + local_var_path = '/api/v2/product-analytics/launches/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ProductAnalyticsLaunchResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :patch_product_analytics_launch, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProductAnalyticsAPI#patch_product_analytics_launch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Compute journey funnel analysis. # # @see #query_product_analytics_journey_funnel_with_http_info @@ -902,6 +1582,85 @@ def query_product_analytics_timeseries_with_http_info(body, opts = {}) return data, status_code, headers end + # Unlink a Product Analytics monitor from its chart. + # + # @see #remove_chart_from_product_analytics_monitor_with_http_info + def remove_chart_from_product_analytics_monitor(monitor_id, body, opts = {}) + remove_chart_from_product_analytics_monitor_with_http_info(monitor_id, body, opts) + nil + end + + # 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 [String] ID of the monitor. It is a numeric ID. + # @param body [ProductAnalyticsMonitorUnlinkRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def remove_chart_from_product_analytics_monitor_with_http_info(monitor_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.remove_chart_from_product_analytics_monitor".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.remove_chart_from_product_analytics_monitor") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.remove_chart_from_product_analytics_monitor")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.remove_chart_from_product_analytics_monitor ...' + end + # verify the required parameter 'monitor_id' is set + if @api_client.config.client_side_validation && monitor_id.nil? + fail ArgumentError, "Missing the required parameter 'monitor_id' when calling ProductAnalyticsAPI.remove_chart_from_product_analytics_monitor" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.remove_chart_from_product_analytics_monitor" + end + # resource path + local_var_path = '/api/v2/product-analytics/monitors/{monitor_id}/unlink'.sub('{monitor_id}', CGI.escape(monitor_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :remove_chart_from_product_analytics_monitor, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProductAnalyticsAPI#remove_chart_from_product_analytics_monitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Send server-side events. # # @see #submit_product_analytics_event_with_http_info @@ -996,5 +1755,85 @@ def submit_product_analytics_event_with_http_info(body, opts = {}) end return data, status_code, headers end + + # Update a Product Analytics monitor. + # + # @see #update_product_analytics_monitor_with_http_info + def update_product_analytics_monitor(monitor_id, body, opts = {}) + data, _status_code, _headers = update_product_analytics_monitor_with_http_info(monitor_id, body, opts) + data + end + + # 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 [String] ID of the monitor. It is a numeric ID. + # @param body [ProductAnalyticsMonitorUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ProductAnalyticsMonitorResponse, Integer, Hash)>] ProductAnalyticsMonitorResponse data, response status code and response headers + def update_product_analytics_monitor_with_http_info(monitor_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_product_analytics_monitor".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_product_analytics_monitor") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_product_analytics_monitor")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProductAnalyticsAPI.update_product_analytics_monitor ...' + end + # verify the required parameter 'monitor_id' is set + if @api_client.config.client_side_validation && monitor_id.nil? + fail ArgumentError, "Missing the required parameter 'monitor_id' when calling ProductAnalyticsAPI.update_product_analytics_monitor" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ProductAnalyticsAPI.update_product_analytics_monitor" + end + # resource path + local_var_path = '/api/v2/product-analytics/monitors/{monitor_id}'.sub('{monitor_id}', CGI.escape(monitor_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ProductAnalyticsMonitorResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_product_analytics_monitor, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProductAnalyticsAPI#update_product_analytics_monitor\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/api/rum_audience_management_api.rb b/lib/datadog_api_client/v2/api/rum_audience_management_api.rb index c5fa7a216f3c..559e59335b8b 100644 --- a/lib/datadog_api_client/v2/api/rum_audience_management_api.rb +++ b/lib/datadog_api_client/v2/api/rum_audience_management_api.rb @@ -101,6 +101,80 @@ def create_connection_with_http_info(entity, body, opts = {}) return data, status_code, headers end + # Create a segment. + # + # @see #create_product_analytics_segment_with_http_info + def create_product_analytics_segment(body, opts = {}) + data, _status_code, _headers = create_product_analytics_segment_with_http_info(body, opts) + data + end + + # 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. + # + # @param body [SegmentCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(SegmentResponse, Integer, Hash)>] SegmentResponse data, response status code and response headers + def create_product_analytics_segment_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_product_analytics_segment".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_product_analytics_segment") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_product_analytics_segment")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumAudienceManagementAPI.create_product_analytics_segment ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling RumAudienceManagementAPI.create_product_analytics_segment" + end + # resource path + local_var_path = '/api/v2/product-analytics/segment' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SegmentResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_product_analytics_segment, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumAudienceManagementAPI#create_product_analytics_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete connection. # # @see #delete_connection_with_http_info @@ -177,6 +251,78 @@ def delete_connection_with_http_info(id, entity, opts = {}) return data, status_code, headers end + # Delete a segment. + # + # @see #delete_product_analytics_segment_with_http_info + def delete_product_analytics_segment(id, opts = {}) + data, _status_code, _headers = delete_product_analytics_segment_with_http_info(id, opts) + data + end + + # 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 [String] ID of the segment. + # @param opts [Hash] the optional parameters + # @return [Array<(SegmentDeleteResponse, Integer, Hash)>] SegmentDeleteResponse data, response status code and response headers + def delete_product_analytics_segment_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_product_analytics_segment".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_product_analytics_segment") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_product_analytics_segment")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumAudienceManagementAPI.delete_product_analytics_segment ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling RumAudienceManagementAPI.delete_product_analytics_segment" + end + # resource path + local_var_path = '/api/v2/product-analytics/segment/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SegmentDeleteResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_product_analytics_segment, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumAudienceManagementAPI#delete_product_analytics_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete a user profile. # # @see #delete_user_profile_with_http_info @@ -394,6 +540,77 @@ def get_mapping_with_http_info(entity, opts = {}) return data, status_code, headers end + # Get a segment. + # + # @see #get_product_analytics_segment_with_http_info + def get_product_analytics_segment(id, opts = {}) + data, _status_code, _headers = get_product_analytics_segment_with_http_info(id, opts) + data + end + + # Get a segment. + # + # Get a segment by ID, including its definition. + # + # @param id [String] ID of the segment. + # @param opts [Hash] the optional parameters + # @return [Array<(SegmentResponse, Integer, Hash)>] SegmentResponse data, response status code and response headers + def get_product_analytics_segment_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_product_analytics_segment".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_product_analytics_segment") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_product_analytics_segment")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumAudienceManagementAPI.get_product_analytics_segment ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling RumAudienceManagementAPI.get_product_analytics_segment" + end + # resource path + local_var_path = '/api/v2/product-analytics/segment/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SegmentResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_product_analytics_segment, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumAudienceManagementAPI#get_product_analytics_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get user facet info. # # @see #get_user_facet_info_with_http_info @@ -538,6 +755,176 @@ def list_connections_with_http_info(entity, opts = {}) return data, status_code, headers end + # List segments. + # + # @see #list_product_analytics_segments_with_http_info + def list_product_analytics_segments(opts = {}) + data, _status_code, _headers = list_product_analytics_segments_with_http_info(opts) + data + end + + # 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 opts [Hash] the optional parameters + # @option opts [SegmentEntity] :filter_entity Return only segments of this entity kind. Other values are ignored. + # @option opts [String] :filter_type Comma-separated segment kinds to return: `event_platform`, `user_store`, `account_store`, `reference_table`, `static`, `template`, `combination`, `journey`, or `retention`. + # @option opts [String] :filter_ids Comma-separated segment IDs to return, up to 1000. + # @option opts [Boolean] :filter_disabled Set to `false` to include disabled segments. + # @option opts [SegmentSortColumn] :sort_column Column to sort by. Other values are ignored. + # @option opts [QuerySortOrder] :sort_order Sort order. Only used with `sort[column]`. + # @option opts [Integer] :limit Maximum number of segments to return. Returns all segments when not set. + # @return [Array<(SegmentsResponse, Integer, Hash)>] SegmentsResponse data, response status code and response headers + def list_product_analytics_segments_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_product_analytics_segments".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_product_analytics_segments") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_product_analytics_segments")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumAudienceManagementAPI.list_product_analytics_segments ...' + end + allowable_values = ['user', 'account'] + if @api_client.config.client_side_validation && opts[:'filter_entity'] && !allowable_values.include?(opts[:'filter_entity']) + fail ArgumentError, "invalid value for \"filter_entity\", must be one of #{allowable_values}" + end + allowable_values = ['name', 'description', 'created_by', 'created_at', 'modified_by', 'modified_at', 'disabled_by', 'disabled_at', 'uuid'] + if @api_client.config.client_side_validation && opts[:'sort_column'] && !allowable_values.include?(opts[:'sort_column']) + fail ArgumentError, "invalid value for \"sort_column\", must be one of #{allowable_values}" + end + allowable_values = ['asc', 'desc'] + if @api_client.config.client_side_validation && opts[:'sort_order'] && !allowable_values.include?(opts[:'sort_order']) + fail ArgumentError, "invalid value for \"sort_order\", must be one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 0 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling RumAudienceManagementAPI.list_product_analytics_segments, must be greater than or equal to 0.' + end + # resource path + local_var_path = '/api/v2/product-analytics/segment' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[entity]'] = opts[:'filter_entity'] if !opts[:'filter_entity'].nil? + query_params[:'filter[type]'] = opts[:'filter_type'] if !opts[:'filter_type'].nil? + query_params[:'filter[ids]'] = opts[:'filter_ids'] if !opts[:'filter_ids'].nil? + query_params[:'filter[disabled]'] = opts[:'filter_disabled'] if !opts[:'filter_disabled'].nil? + query_params[:'sort[column]'] = opts[:'sort_column'] if !opts[:'sort_column'].nil? + query_params[:'sort[order]'] = opts[:'sort_order'] if !opts[:'sort_order'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SegmentsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_product_analytics_segments, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumAudienceManagementAPI#list_product_analytics_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Preview a segment. + # + # @see #preview_product_analytics_segment_with_http_info + def preview_product_analytics_segment(body, opts = {}) + data, _status_code, _headers = preview_product_analytics_segment_with_http_info(body, opts) + data + end + + # 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. + # + # @param body [SegmentPreviewRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(SegmentPreviewResponse, Integer, Hash)>] SegmentPreviewResponse data, response status code and response headers + def preview_product_analytics_segment_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.preview_product_analytics_segment".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.preview_product_analytics_segment") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.preview_product_analytics_segment")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumAudienceManagementAPI.preview_product_analytics_segment ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling RumAudienceManagementAPI.preview_product_analytics_segment" + end + # resource path + local_var_path = '/api/v2/product-analytics/segments/preview' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SegmentPreviewResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :preview_product_analytics_segment, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumAudienceManagementAPI#preview_product_analytics_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Query accounts. # # @see #query_accounts_with_http_info @@ -834,5 +1221,84 @@ def update_connection_with_http_info(entity, body, opts = {}) end return data, status_code, headers end + + # Update a segment. + # + # @see #update_product_analytics_segment_with_http_info + def update_product_analytics_segment(id, body, opts = {}) + update_product_analytics_segment_with_http_info(id, body, opts) + nil + end + + # 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 [String] ID of the segment. + # @param body [SegmentUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_product_analytics_segment_with_http_info(id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_product_analytics_segment".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_product_analytics_segment") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_product_analytics_segment")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RumAudienceManagementAPI.update_product_analytics_segment ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling RumAudienceManagementAPI.update_product_analytics_segment" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling RumAudienceManagementAPI.update_product_analytics_segment" + end + # resource path + local_var_path = '/api/v2/product-analytics/segment/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_product_analytics_segment, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: RumAudienceManagementAPI#update_product_analytics_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_attributes.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_attributes.rb new file mode 100644 index 000000000000..f8fbb5567e91 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_attributes.rb @@ -0,0 +1,336 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a launch. + class ProductAnalyticsLaunchAttributes + include BaseGenericModel + + # UUID of the RUM application that the launch belongs to. + attr_accessor :application_id + + # Context of the feature being launched. + attr_accessor :context + + # Time the launch was created. + attr_reader :created_at + + # UUID of the user who created the launch. + attr_reader :created_by + + # Description of the feature being launched. + attr_accessor :description + + # UUID of the Datadog feature flag that gates the launch. + attr_accessor :feature_flag_id + + # Key of a feature flag managed outside Datadog. + attr_accessor :feature_flag_key + + # KPIs that the launch is meant to move. + attr_accessor :kpis + + # Name of the launch. + attr_reader :name + + # ID of the organization that owns the launch. + attr_reader :org_id + + # 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`. + attr_reader :phase + + # ID of the code repository that implements the feature. + attr_accessor :repository_id + + # Steps of the launch. + attr_reader :steps + + # Time the launch was last updated. + attr_accessor :updated_at + + # UUID of the user who last updated the launch. + attr_accessor :updated_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'application_id' => :'String', + :'context' => :'String', + :'created_at' => :'Time', + :'created_by' => :'String', + :'description' => :'String', + :'feature_flag_id' => :'String', + :'feature_flag_key' => :'String', + :'kpis' => :'Array', + :'name' => :'String', + :'org_id' => :'Integer', + :'phase' => :'ProductAnalyticsLaunchPhase', + :'repository_id' => :'String', + :'steps' => :'ProductAnalyticsLaunchSteps', + :'updated_at' => :'Time', + :'updated_by' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'application_id', + :'context', + :'description', + :'feature_flag_id', + :'feature_flag_key', + :'kpis', + :'updated_at', + :'updated_by', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'context') + self.context = attributes[:'context'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'feature_flag_id') + self.feature_flag_id = attributes[:'feature_flag_id'] + end + + if attributes.key?(:'feature_flag_key') + self.feature_flag_key = attributes[:'feature_flag_key'] + end + + if attributes.key?(:'kpis') + if (value = attributes[:'kpis']).is_a?(Array) + self.kpis = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'phase') + self.phase = attributes[:'phase'] + end + + if attributes.key?(:'repository_id') + self.repository_id = attributes[:'repository_id'] + end + + if attributes.key?(:'steps') + self.steps = attributes[:'steps'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'updated_by') + self.updated_by = attributes[:'updated_by'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @name.nil? + return false if @org_id.nil? + return false if @phase.nil? + return false if @steps.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + end + + # Custom attribute writer method with validation + # @param phase [Object] Object to be assigned + # @!visibility private + def phase=(phase) + if phase.nil? + fail ArgumentError, 'invalid value for "phase", phase cannot be nil.' + end + @phase = phase + end + + # Custom attribute writer method with validation + # @param steps [Object] Object to be assigned + # @!visibility private + def steps=(steps) + if steps.nil? + fail ArgumentError, 'invalid value for "steps", steps cannot be nil.' + end + @steps = steps + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + application_id == o.application_id && + context == o.context && + created_at == o.created_at && + created_by == o.created_by && + description == o.description && + feature_flag_id == o.feature_flag_id && + feature_flag_key == o.feature_flag_key && + kpis == o.kpis && + name == o.name && + org_id == o.org_id && + phase == o.phase && + repository_id == o.repository_id && + steps == o.steps && + updated_at == o.updated_at && + updated_by == o.updated_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [application_id, context, created_at, created_by, description, feature_flag_id, feature_flag_key, kpis, name, org_id, phase, repository_id, steps, updated_at, updated_by, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_code_analysis.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_code_analysis.rb new file mode 100644 index 000000000000..2266729a2db0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_code_analysis.rb @@ -0,0 +1,128 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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. + class ProductAnalyticsLaunchCodeAnalysis + include BaseGenericModel + + # Time of the analysis. Set by the server. + attr_accessor :analyzed_at + + # Results for the events of the tracking plan. List each event once. + attr_accessor :events + + # Code revision that was inspected, such as a commit SHA. + attr_accessor :revision + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'analyzed_at' => :'analyzed_at', + :'events' => :'events', + :'revision' => :'revision' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'analyzed_at' => :'Time', + :'events' => :'Array', + :'revision' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchCodeAnalysis` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'analyzed_at') + self.analyzed_at = attributes[:'analyzed_at'] + end + + if attributes.key?(:'events') + if (value = attributes[:'events']).is_a?(Array) + self.events = value + end + end + + if attributes.key?(:'revision') + self.revision = attributes[:'revision'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + analyzed_at == o.analyzed_at && + events == o.events && + revision == o.revision && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [analyzed_at, events, revision, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_code_status.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_code_status.rb new file mode 100644 index 000000000000..71c0037a1794 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_code_status.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Whether the inspected code sends the event, or attaches the property to the event. + class ProductAnalyticsLaunchCodeStatus + include BaseEnumModel + + FOUND = "found".freeze + NOT_FOUND = "not_found".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_create_data.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_create_data.rb new file mode 100644 index 000000000000..18b55a93dd1e --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the launch to create. + class ProductAnalyticsLaunchCreateData + include BaseGenericModel + + # Attributes of a launch to create or replace. + attr_reader :attributes + + # Launch resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ProductAnalyticsLaunchRequestAttributes', + :'type' => :'ProductAnalyticsLaunchType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_create_request.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_create_request.rb new file mode 100644 index 000000000000..73326848ec97 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to create a launch. + class ProductAnalyticsLaunchCreateRequest + include BaseGenericModel + + # Data of the launch to create. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ProductAnalyticsLaunchCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_dashboard_step.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_dashboard_step.rb new file mode 100644 index 000000000000..91e4f73f2d21 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_dashboard_step.rb @@ -0,0 +1,113 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Dashboard linked to the launch. + class ProductAnalyticsLaunchDashboardStep + include BaseGenericModel + + # ID of the linked dashboard. + attr_accessor :dashboard_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dashboard_id' => :'dashboard_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dashboard_id' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'dashboard_id', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchDashboardStep` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'dashboard_id') + self.dashboard_id = attributes[:'dashboard_id'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + dashboard_id == o.dashboard_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dashboard_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_data.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_data.rb new file mode 100644 index 000000000000..dd148dd476ea --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A launch. + class ProductAnalyticsLaunchData + include BaseGenericModel + + # Attributes of a launch. + attr_reader :attributes + + # UUID of the launch. + attr_reader :id + + # Launch resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ProductAnalyticsLaunchAttributes', + :'id' => :'String', + :'type' => :'ProductAnalyticsLaunchType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_event.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_event.rb new file mode 100644 index 000000000000..ae3478fff426 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_event.rb @@ -0,0 +1,179 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An event to instrument for the launch. + class ProductAnalyticsLaunchEvent + include BaseGenericModel + + # What the event records. + attr_accessor :description + + # IDs of the launch KPIs that the event measures. + attr_accessor :kpis + + # Name of the event, unique within the tracking plan. + attr_reader :name + + # Properties that the event carries. + attr_accessor :properties + + # What causes the event to be sent. + attr_accessor :trigger + + # Views where the event is sent. Each value must be unique and not blank. + attr_accessor :views + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'kpis' => :'kpis', + :'name' => :'name', + :'properties' => :'properties', + :'trigger' => :'trigger', + :'views' => :'views' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'kpis' => :'Array', + :'name' => :'String', + :'properties' => :'Array', + :'trigger' => :'String', + :'views' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchEvent` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'kpis') + if (value = attributes[:'kpis']).is_a?(Array) + self.kpis = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'properties') + if (value = attributes[:'properties']).is_a?(Array) + self.properties = value + end + end + + if attributes.key?(:'trigger') + self.trigger = attributes[:'trigger'] + end + + if attributes.key?(:'views') + if (value = attributes[:'views']).is_a?(Array) + self.views = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + kpis == o.kpis && + name == o.name && + properties == o.properties && + trigger == o.trigger && + views == o.views && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, kpis, name, properties, trigger, views, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_event_finding.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_event_finding.rb new file mode 100644 index 000000000000..02313b791184 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_event_finding.rb @@ -0,0 +1,156 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Code analysis result for an event of the tracking plan. + class ProductAnalyticsLaunchEventFinding + include BaseGenericModel + + # Name of the event in the tracking plan. + attr_reader :name + + # Results for the properties of the event. Only allowed when the event is `found`. + attr_accessor :properties + + # Whether the inspected code sends the event, or attaches the property to the event. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'properties' => :'properties', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'properties' => :'Array', + :'status' => :'ProductAnalyticsLaunchCodeStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchEventFinding` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'properties') + if (value = attributes[:'properties']).is_a?(Array) + self.properties = value + end + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + properties == o.properties && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, properties, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_event_property.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_event_property.rb new file mode 100644 index 000000000000..ad04d2d8f60e --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_event_property.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A reference from an event to a property of the tracking plan. + class ProductAnalyticsLaunchEventProperty + include BaseGenericModel + + # ID of a property in the tracking plan `properties`. + attr_reader :id + + # Whether the event must always include the property. + attr_accessor :required + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'required' => :'required' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'required' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchEventProperty` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'required') + self.required = attributes[:'required'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + required == o.required && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, required, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_experiment_step.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_experiment_step.rb new file mode 100644 index 000000000000..6e92b7f964ef --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_experiment_step.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Experiment linked to the launch. The draft fields are cleared when `experiment_id` is set. + class ProductAnalyticsLaunchExperimentStep + include BaseGenericModel + + # UUID of the linked experiment. + attr_accessor :experiment_id + + # Hypothesis of a draft experiment. + attr_accessor :hypothesis + + # Name of a draft experiment. + attr_accessor :name + + # Protocol ID of a draft experiment. + attr_accessor :protocol_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'experiment_id' => :'experiment_id', + :'hypothesis' => :'hypothesis', + :'name' => :'name', + :'protocol_id' => :'protocol_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'experiment_id' => :'String', + :'hypothesis' => :'String', + :'name' => :'String', + :'protocol_id' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'experiment_id', + :'hypothesis', + :'name', + :'protocol_id', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchExperimentStep` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'experiment_id') + self.experiment_id = attributes[:'experiment_id'] + end + + if attributes.key?(:'hypothesis') + self.hypothesis = attributes[:'hypothesis'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'protocol_id') + self.protocol_id = attributes[:'protocol_id'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + experiment_id == o.experiment_id && + hypothesis == o.hypothesis && + name == o.name && + protocol_id == o.protocol_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [experiment_id, hypothesis, name, protocol_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_funnel_step.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_funnel_step.rb new file mode 100644 index 000000000000..d6362b4e1081 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_funnel_step.rb @@ -0,0 +1,113 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Funnel linked to the launch. + class ProductAnalyticsLaunchFunnelStep + include BaseGenericModel + + # Definition of the funnel widget, as a JSON object. + attr_accessor :funnel_tile_def + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'funnel_tile_def' => :'funnel_tile_def' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'funnel_tile_def' => :'Hash' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'funnel_tile_def', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchFunnelStep` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'funnel_tile_def') + self.funnel_tile_def = attributes[:'funnel_tile_def'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + funnel_tile_def == o.funnel_tile_def && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [funnel_tile_def, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_kpi.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_kpi.rb new file mode 100644 index 000000000000..09ba91f3e50d --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_kpi.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A KPI that the launch is meant to move. + class ProductAnalyticsLaunchKPI + include BaseGenericModel + + # ID of the KPI, unique within the launch. Tracking plan events reference it. + attr_reader :id + + # Name of the KPI. + attr_reader :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'title' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchKPI` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @title.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + @title = title + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_list_scope.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_list_scope.rb new file mode 100644 index 000000000000..bf9e8bff5edf --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_list_scope.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Scope of a launch list. `liftoffs` leaves out launches in the `plan` phase. + class ProductAnalyticsLaunchListScope + include BaseEnumModel + + LIFTOFFS = "liftoffs".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_patch_attributes.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_patch_attributes.rb new file mode 100644 index 000000000000..3b9e9384913b --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_patch_attributes.rb @@ -0,0 +1,246 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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. + class ProductAnalyticsLaunchPatchAttributes + include BaseGenericModel + + # UUID of the RUM application that the launch belongs to. + attr_accessor :application_id + + # 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. + attr_accessor :code_analysis + + # Context of the feature being launched. + attr_accessor :context + + # Description of the feature being launched. + attr_accessor :description + + # UUID of the Datadog feature flag that gates the launch. + attr_accessor :feature_flag_id + + # Key of a feature flag managed outside Datadog. At most 256 characters, with no leading or trailing spaces. + attr_reader :feature_flag_key + + # KPIs that the launch is meant to move. Replaces the stored list, and `null` clears it. + attr_accessor :kpis + + # Name of the launch. + attr_accessor :name + + # 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`. + attr_accessor :phase + + # ID of the code repository that implements the feature. + attr_accessor :repository_id + + # 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. + attr_accessor :steps + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'application_id' => :'String', + :'code_analysis' => :'ProductAnalyticsLaunchCodeAnalysis', + :'context' => :'String', + :'description' => :'String', + :'feature_flag_id' => :'String', + :'feature_flag_key' => :'String', + :'kpis' => :'Array', + :'name' => :'String', + :'phase' => :'ProductAnalyticsLaunchPhase', + :'repository_id' => :'String', + :'steps' => :'ProductAnalyticsLaunchPatchSteps' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'application_id', + :'description', + :'feature_flag_id', + :'feature_flag_key', + :'kpis', + :'repository_id', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchPatchAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'code_analysis') + self.code_analysis = attributes[:'code_analysis'] + end + + if attributes.key?(:'context') + self.context = attributes[:'context'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'feature_flag_id') + self.feature_flag_id = attributes[:'feature_flag_id'] + end + + if attributes.key?(:'feature_flag_key') + self.feature_flag_key = attributes[:'feature_flag_key'] + end + + if attributes.key?(:'kpis') + if (value = attributes[:'kpis']).is_a?(Array) + self.kpis = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'phase') + self.phase = attributes[:'phase'] + end + + if attributes.key?(:'repository_id') + self.repository_id = attributes[:'repository_id'] + end + + if attributes.key?(:'steps') + self.steps = attributes[:'steps'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@feature_flag_key.nil? && @feature_flag_key.to_s.length > 256 + return false if !@feature_flag_key.nil? && @feature_flag_key.to_s.length < 1 + true + end + + # Custom attribute writer method with validation + # @param feature_flag_key [Object] Object to be assigned + # @!visibility private + def feature_flag_key=(feature_flag_key) + if !feature_flag_key.nil? && feature_flag_key.to_s.length > 256 + fail ArgumentError, 'invalid value for "feature_flag_key", the character length must be smaller than or equal to 256.' + end + if !feature_flag_key.nil? && feature_flag_key.to_s.length < 1 + fail ArgumentError, 'invalid value for "feature_flag_key", the character length must be great than or equal to 1.' + end + @feature_flag_key = feature_flag_key + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + application_id == o.application_id && + code_analysis == o.code_analysis && + context == o.context && + description == o.description && + feature_flag_id == o.feature_flag_id && + feature_flag_key == o.feature_flag_key && + kpis == o.kpis && + name == o.name && + phase == o.phase && + repository_id == o.repository_id && + steps == o.steps && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [application_id, code_analysis, context, description, feature_flag_id, feature_flag_key, kpis, name, phase, repository_id, steps, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_patch_data.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_patch_data.rb new file mode 100644 index 000000000000..b277d98039bb --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_patch_data.rb @@ -0,0 +1,166 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the launch update. + class ProductAnalyticsLaunchPatchData + include BaseGenericModel + + # 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. + attr_reader :attributes + + # UUID of the launch. It must match the ID in the path. + attr_reader :id + + # Launch resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ProductAnalyticsLaunchPatchAttributes', + :'id' => :'String', + :'type' => :'ProductAnalyticsLaunchType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchPatchData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_patch_request.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_patch_request.rb new file mode 100644 index 000000000000..f90aaaeb97b1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_patch_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to update some fields of a launch. + class ProductAnalyticsLaunchPatchRequest + include BaseGenericModel + + # Data of the launch update. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ProductAnalyticsLaunchPatchData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchPatchRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_patch_steps.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_patch_steps.rb new file mode 100644 index 000000000000..be85ccefdef6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_patch_steps.rb @@ -0,0 +1,136 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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. + class ProductAnalyticsLaunchPatchSteps + include BaseGenericModel + + # Dashboard linked to the launch. + attr_accessor :dashboard + + # Experiment linked to the launch. The draft fields are cleared when `experiment_id` is set. + attr_accessor :experiment + + # Funnel linked to the launch. + attr_accessor :funnel + + # Tracking plan of a launch, listing the events and properties to instrument. + attr_accessor :tracking_plan + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dashboard' => :'dashboard', + :'experiment' => :'experiment', + :'funnel' => :'funnel', + :'tracking_plan' => :'tracking_plan' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dashboard' => :'ProductAnalyticsLaunchDashboardStep', + :'experiment' => :'ProductAnalyticsLaunchExperimentStep', + :'funnel' => :'ProductAnalyticsLaunchFunnelStep', + :'tracking_plan' => :'ProductAnalyticsLaunchTrackingPlanRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchPatchSteps` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'dashboard') + self.dashboard = attributes[:'dashboard'] + end + + if attributes.key?(:'experiment') + self.experiment = attributes[:'experiment'] + end + + if attributes.key?(:'funnel') + self.funnel = attributes[:'funnel'] + end + + if attributes.key?(:'tracking_plan') + self.tracking_plan = attributes[:'tracking_plan'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + dashboard == o.dashboard && + experiment == o.experiment && + funnel == o.funnel && + tracking_plan == o.tracking_plan && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dashboard, experiment, funnel, tracking_plan, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_phase.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_phase.rb new file mode 100644 index 000000000000..dc3d4689284e --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_phase.rb @@ -0,0 +1,30 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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`. + class ProductAnalyticsLaunchPhase + include BaseEnumModel + + PLAN = "plan".freeze + SETUP = "setup".freeze + READY = "ready".freeze + LAUNCHED = "launched".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_property.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_property.rb new file mode 100644 index 000000000000..990c9ad2b94b --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_property.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An event property of the tracking plan. + class ProductAnalyticsLaunchProperty + include BaseGenericModel + + # What the property captures. + attr_reader :description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchProperty` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @description.nil? + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_property_finding.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_property_finding.rb new file mode 100644 index 000000000000..9680e5f569ba --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_property_finding.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Code analysis result for a property of an event. + class ProductAnalyticsLaunchPropertyFinding + include BaseGenericModel + + # ID of the property in the tracking plan. + attr_reader :id + + # Whether the inspected code sends the event, or attaches the property to the event. + attr_reader :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'status' => :'ProductAnalyticsLaunchCodeStatus' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchPropertyFinding` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_request_attributes.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_request_attributes.rb new file mode 100644 index 000000000000..7baebdf6b52f --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_request_attributes.rb @@ -0,0 +1,265 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a launch to create or replace. + class ProductAnalyticsLaunchRequestAttributes + include BaseGenericModel + + # UUID of the RUM application that the launch belongs to. + attr_accessor :application_id + + # Context of the feature being launched, used to build the tracking plan. + attr_reader :context + + # Description of the feature being launched. + attr_accessor :description + + # UUID of the Datadog feature flag that gates the launch. Do not set it together with `feature_flag_key`. + attr_accessor :feature_flag_id + + # 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. + attr_reader :feature_flag_key + + # KPIs that the launch is meant to move. + attr_accessor :kpis + + # Name of the launch. + attr_reader :name + + # 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`. + attr_accessor :phase + + # ID of the code repository that implements the feature. + attr_accessor :repository_id + + # Steps of the launch. The tracking plan is required. + attr_reader :steps + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'application_id' => :'String', + :'context' => :'String', + :'description' => :'String', + :'feature_flag_id' => :'String', + :'feature_flag_key' => :'String', + :'kpis' => :'Array', + :'name' => :'String', + :'phase' => :'ProductAnalyticsLaunchPhase', + :'repository_id' => :'String', + :'steps' => :'ProductAnalyticsLaunchStepsRequest' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'application_id', + :'description', + :'feature_flag_id', + :'feature_flag_key', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'context') + self.context = attributes[:'context'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'feature_flag_id') + self.feature_flag_id = attributes[:'feature_flag_id'] + end + + if attributes.key?(:'feature_flag_key') + self.feature_flag_key = attributes[:'feature_flag_key'] + end + + if attributes.key?(:'kpis') + if (value = attributes[:'kpis']).is_a?(Array) + self.kpis = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'phase') + self.phase = attributes[:'phase'] + end + + if attributes.key?(:'repository_id') + self.repository_id = attributes[:'repository_id'] + end + + if attributes.key?(:'steps') + self.steps = attributes[:'steps'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @context.nil? + return false if !@feature_flag_key.nil? && @feature_flag_key.to_s.length > 256 + return false if !@feature_flag_key.nil? && @feature_flag_key.to_s.length < 1 + return false if @name.nil? + return false if @steps.nil? + true + end + + # Custom attribute writer method with validation + # @param context [Object] Object to be assigned + # @!visibility private + def context=(context) + if context.nil? + fail ArgumentError, 'invalid value for "context", context cannot be nil.' + end + @context = context + end + + # Custom attribute writer method with validation + # @param feature_flag_key [Object] Object to be assigned + # @!visibility private + def feature_flag_key=(feature_flag_key) + if !feature_flag_key.nil? && feature_flag_key.to_s.length > 256 + fail ArgumentError, 'invalid value for "feature_flag_key", the character length must be smaller than or equal to 256.' + end + if !feature_flag_key.nil? && feature_flag_key.to_s.length < 1 + fail ArgumentError, 'invalid value for "feature_flag_key", the character length must be great than or equal to 1.' + end + @feature_flag_key = feature_flag_key + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param steps [Object] Object to be assigned + # @!visibility private + def steps=(steps) + if steps.nil? + fail ArgumentError, 'invalid value for "steps", steps cannot be nil.' + end + @steps = steps + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + application_id == o.application_id && + context == o.context && + description == o.description && + feature_flag_id == o.feature_flag_id && + feature_flag_key == o.feature_flag_key && + kpis == o.kpis && + name == o.name && + phase == o.phase && + repository_id == o.repository_id && + steps == o.steps && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [application_id, context, description, feature_flag_id, feature_flag_key, kpis, name, phase, repository_id, steps, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_response.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_response.rb new file mode 100644 index 000000000000..828f40281623 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a launch. + class ProductAnalyticsLaunchResponse + include BaseGenericModel + + # A launch. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ProductAnalyticsLaunchData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_steps.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_steps.rb new file mode 100644 index 000000000000..0636edc79d00 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_steps.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Steps of the launch. + class ProductAnalyticsLaunchSteps + include BaseGenericModel + + # Dashboard linked to the launch. + attr_accessor :dashboard + + # Experiment linked to the launch. The draft fields are cleared when `experiment_id` is set. + attr_accessor :experiment + + # Funnel linked to the launch. + attr_accessor :funnel + + # Tracking plan of a launch, listing the events and properties to instrument. + attr_accessor :tracking_plan + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dashboard' => :'dashboard', + :'experiment' => :'experiment', + :'funnel' => :'funnel', + :'tracking_plan' => :'tracking_plan' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dashboard' => :'ProductAnalyticsLaunchDashboardStep', + :'experiment' => :'ProductAnalyticsLaunchExperimentStep', + :'funnel' => :'ProductAnalyticsLaunchFunnelStep', + :'tracking_plan' => :'ProductAnalyticsLaunchTrackingPlan' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchSteps` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'dashboard') + self.dashboard = attributes[:'dashboard'] + end + + if attributes.key?(:'experiment') + self.experiment = attributes[:'experiment'] + end + + if attributes.key?(:'funnel') + self.funnel = attributes[:'funnel'] + end + + if attributes.key?(:'tracking_plan') + self.tracking_plan = attributes[:'tracking_plan'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + dashboard == o.dashboard && + experiment == o.experiment && + funnel == o.funnel && + tracking_plan == o.tracking_plan && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dashboard, experiment, funnel, tracking_plan, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_steps_request.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_steps_request.rb new file mode 100644 index 000000000000..bc1fad5de3ef --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_steps_request.rb @@ -0,0 +1,153 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Steps of the launch. The tracking plan is required. + class ProductAnalyticsLaunchStepsRequest + include BaseGenericModel + + # Dashboard linked to the launch. + attr_accessor :dashboard + + # Experiment linked to the launch. The draft fields are cleared when `experiment_id` is set. + attr_accessor :experiment + + # Funnel linked to the launch. + attr_accessor :funnel + + # Tracking plan of a launch, listing the events and properties to instrument. + attr_reader :tracking_plan + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dashboard' => :'dashboard', + :'experiment' => :'experiment', + :'funnel' => :'funnel', + :'tracking_plan' => :'tracking_plan' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dashboard' => :'ProductAnalyticsLaunchDashboardStep', + :'experiment' => :'ProductAnalyticsLaunchExperimentStep', + :'funnel' => :'ProductAnalyticsLaunchFunnelStep', + :'tracking_plan' => :'ProductAnalyticsLaunchTrackingPlanRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchStepsRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'dashboard') + self.dashboard = attributes[:'dashboard'] + end + + if attributes.key?(:'experiment') + self.experiment = attributes[:'experiment'] + end + + if attributes.key?(:'funnel') + self.funnel = attributes[:'funnel'] + end + + if attributes.key?(:'tracking_plan') + self.tracking_plan = attributes[:'tracking_plan'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @tracking_plan.nil? + true + end + + # Custom attribute writer method with validation + # @param tracking_plan [Object] Object to be assigned + # @!visibility private + def tracking_plan=(tracking_plan) + if tracking_plan.nil? + fail ArgumentError, 'invalid value for "tracking_plan", tracking_plan cannot be nil.' + end + @tracking_plan = tracking_plan + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + dashboard == o.dashboard && + experiment == o.experiment && + funnel == o.funnel && + tracking_plan == o.tracking_plan && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dashboard, experiment, funnel, tracking_plan, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_tracking_plan.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_tracking_plan.rb new file mode 100644 index 000000000000..02910d256c9a --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_tracking_plan.rb @@ -0,0 +1,257 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Tracking plan of a launch, listing the events and properties to instrument. + class ProductAnalyticsLaunchTrackingPlan + include BaseGenericModel + + # 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. + attr_accessor :code_analysis + + # ID of the code generation session that implemented the plan. + attr_accessor :codegen_session_id + + # Time the tracking plan was created. + attr_reader :created_at + + # UUID of the user who created the tracking plan. + attr_reader :created_by + + # Events to instrument. + attr_accessor :events + + # ID of the tracking plan. + attr_reader :id + + # ID of the Jira ticket that tracks the instrumentation work. + attr_accessor :jira_ticket_id + + # Link to the pull request that implements the plan. + attr_accessor :pr_link + + # Event properties of the tracking plan, keyed by property ID. + attr_accessor :properties + + # Time the tracking plan was last updated. + attr_accessor :updated_at + + # UUID of the user who last updated the tracking plan. + attr_accessor :updated_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'code_analysis' => :'ProductAnalyticsLaunchCodeAnalysis', + :'codegen_session_id' => :'String', + :'created_at' => :'Time', + :'created_by' => :'String', + :'events' => :'Array', + :'id' => :'String', + :'jira_ticket_id' => :'String', + :'pr_link' => :'String', + :'properties' => :'Hash', + :'updated_at' => :'Time', + :'updated_by' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'updated_at', + :'updated_by', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchTrackingPlan` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'code_analysis') + self.code_analysis = attributes[:'code_analysis'] + end + + if attributes.key?(:'codegen_session_id') + self.codegen_session_id = attributes[:'codegen_session_id'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'events') + if (value = attributes[:'events']).is_a?(Array) + self.events = value + end + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'jira_ticket_id') + self.jira_ticket_id = attributes[:'jira_ticket_id'] + end + + if attributes.key?(:'pr_link') + self.pr_link = attributes[:'pr_link'] + end + + if attributes.key?(:'properties') + self.properties = attributes[:'properties'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'updated_by') + self.updated_by = attributes[:'updated_by'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @id.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code_analysis == o.code_analysis && + codegen_session_id == o.codegen_session_id && + created_at == o.created_at && + created_by == o.created_by && + events == o.events && + id == o.id && + jira_ticket_id == o.jira_ticket_id && + pr_link == o.pr_link && + properties == o.properties && + updated_at == o.updated_at && + updated_by == o.updated_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [code_analysis, codegen_session_id, created_at, created_by, events, id, jira_ticket_id, pr_link, properties, updated_at, updated_by, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_tracking_plan_request.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_tracking_plan_request.rb new file mode 100644 index 000000000000..20811ea68d85 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_tracking_plan_request.rb @@ -0,0 +1,158 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Tracking plan of a launch, listing the events and properties to instrument. + class ProductAnalyticsLaunchTrackingPlanRequest + include BaseGenericModel + + # 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. + attr_accessor :code_analysis + + # ID of the code generation session that implemented the plan. + attr_accessor :codegen_session_id + + # Events to instrument. + attr_accessor :events + + # ID of the Jira ticket that tracks the instrumentation work. + attr_accessor :jira_ticket_id + + # Link to the pull request that implements the plan. + attr_accessor :pr_link + + # Event properties of the tracking plan, keyed by property ID. + attr_accessor :properties + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'code_analysis' => :'ProductAnalyticsLaunchCodeAnalysis', + :'codegen_session_id' => :'String', + :'events' => :'Array', + :'jira_ticket_id' => :'String', + :'pr_link' => :'String', + :'properties' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchTrackingPlanRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'code_analysis') + self.code_analysis = attributes[:'code_analysis'] + end + + if attributes.key?(:'codegen_session_id') + self.codegen_session_id = attributes[:'codegen_session_id'] + end + + if attributes.key?(:'events') + if (value = attributes[:'events']).is_a?(Array) + self.events = value + end + end + + if attributes.key?(:'jira_ticket_id') + self.jira_ticket_id = attributes[:'jira_ticket_id'] + end + + if attributes.key?(:'pr_link') + self.pr_link = attributes[:'pr_link'] + end + + if attributes.key?(:'properties') + self.properties = attributes[:'properties'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code_analysis == o.code_analysis && + codegen_session_id == o.codegen_session_id && + events == o.events && + jira_ticket_id == o.jira_ticket_id && + pr_link == o.pr_link && + properties == o.properties && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [code_analysis, codegen_session_id, events, jira_ticket_id, pr_link, properties, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launch_type.rb b/lib/datadog_api_client/v2/models/product_analytics_launch_type.rb new file mode 100644 index 000000000000..0eaa4eb70471 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launch_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Launch resource type. + class ProductAnalyticsLaunchType + include BaseEnumModel + + LIFTOFF = "liftoff".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_launches_response.rb b/lib/datadog_api_client/v2/models/product_analytics_launches_response.rb new file mode 100644 index 000000000000..8ee8454a6aa1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_launches_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of launches. + class ProductAnalyticsLaunchesResponse + include BaseGenericModel + + # The launches. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsLaunchesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_attributes.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_attributes.rb new file mode 100644 index 000000000000..8ea02b39689a --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_attributes.rb @@ -0,0 +1,303 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a Product Analytics monitor. + class ProductAnalyticsMonitorAttributes + include BaseGenericModel + + # Time the monitor was created. + attr_accessor :created_time + + # The user who created the monitor. + attr_accessor :creator + + # Notification message sent when the monitor alerts. + attr_reader :message + + # Time the monitor was last modified. + attr_accessor :modified_time + + # Name of the monitor. + attr_reader :name + + # Options of a Product Analytics monitor. + attr_reader :options + + # ID of the organization that owns the monitor. + attr_reader :org_id + + # Priority of the monitor, from 1 (highest) to 5 (lowest). + attr_reader :priority + + # Monitor query. + attr_reader :query + + # Current alert status of the monitor. `No Data` is returned when the monitor has not been evaluated yet. + attr_reader :status + + # Monitor tags, as `key:value` strings. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_time' => :'Time', + :'creator' => :'ProductAnalyticsMonitorCreator', + :'message' => :'String', + :'modified_time' => :'Time', + :'name' => :'String', + :'options' => :'ProductAnalyticsMonitorOptions', + :'org_id' => :'Integer', + :'priority' => :'Integer', + :'query' => :'String', + :'status' => :'ProductAnalyticsMonitorStatus', + :'tags' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'tags', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_time') + self.created_time = attributes[:'created_time'] + end + + if attributes.key?(:'creator') + self.creator = attributes[:'creator'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'modified_time') + self.modified_time = attributes[:'modified_time'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'options') + self.options = attributes[:'options'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @message.nil? + return false if @name.nil? + return false if @options.nil? + return false if @org_id.nil? + return false if !@priority.nil? && @priority > 5 + return false if !@priority.nil? && @priority < 1 + return false if @query.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param message [Object] Object to be assigned + # @!visibility private + def message=(message) + if message.nil? + fail ArgumentError, 'invalid value for "message", message cannot be nil.' + end + @message = message + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param options [Object] Object to be assigned + # @!visibility private + def options=(options) + if options.nil? + fail ArgumentError, 'invalid value for "options", options cannot be nil.' + end + @options = options + end + + # Custom attribute writer method with validation + # @param org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + end + + # Custom attribute writer method with validation + # @param priority [Object] Object to be assigned + # @!visibility private + def priority=(priority) + if !priority.nil? && priority > 5 + fail ArgumentError, 'invalid value for "priority", must be smaller than or equal to 5.' + end + if !priority.nil? && priority < 1 + fail ArgumentError, 'invalid value for "priority", must be greater than or equal to 1.' + end + @priority = priority + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_time == o.created_time && + creator == o.creator && + message == o.message && + modified_time == o.modified_time && + name == o.name && + options == o.options && + org_id == o.org_id && + priority == o.priority && + query == o.query && + status == o.status && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_time, creator, message, modified_time, name, options, org_id, priority, query, status, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_create_attributes.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_create_attributes.rb new file mode 100644 index 000000000000..5762d7f46b27 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_create_attributes.rb @@ -0,0 +1,212 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the Product Analytics monitor to create. + class ProductAnalyticsMonitorCreateAttributes + include BaseGenericModel + + # Notification message sent when the monitor alerts. It can include `@` notification handles. + attr_reader :message + + # Name of the monitor. + attr_reader :name + + # Options of a Product Analytics monitor. + attr_accessor :options + + # Priority of the monitor, from 1 (highest) to 5 (lowest). + attr_reader :priority + + # Monitor query, for example `formula("query").rollup("sum").last("1h") < 1`. + # Define the variables it references in `options.variables`. + attr_reader :query + + # 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`. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'message' => :'message', + :'name' => :'name', + :'options' => :'options', + :'priority' => :'priority', + :'query' => :'query', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'message' => :'String', + :'name' => :'String', + :'options' => :'ProductAnalyticsMonitorOptions', + :'priority' => :'Integer', + :'query' => :'String', + :'tags' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'options') + self.options = attributes[:'options'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'tags') + self.tags = attributes[:'tags'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @message.nil? + return false if @name.nil? + return false if !@priority.nil? && @priority > 5 + return false if !@priority.nil? && @priority < 1 + return false if @query.nil? + true + end + + # Custom attribute writer method with validation + # @param message [Object] Object to be assigned + # @!visibility private + def message=(message) + if message.nil? + fail ArgumentError, 'invalid value for "message", message cannot be nil.' + end + @message = message + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param priority [Object] Object to be assigned + # @!visibility private + def priority=(priority) + if !priority.nil? && priority > 5 + fail ArgumentError, 'invalid value for "priority", must be smaller than or equal to 5.' + end + if !priority.nil? && priority < 1 + fail ArgumentError, 'invalid value for "priority", must be greater than or equal to 1.' + end + @priority = priority + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message && + name == o.name && + options == o.options && + priority == o.priority && + query == o.query && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [message, name, options, priority, query, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_create_data.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_create_data.rb new file mode 100644 index 000000000000..807837b14490 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the Product Analytics monitor to create. + class ProductAnalyticsMonitorCreateData + include BaseGenericModel + + # Attributes of the Product Analytics monitor to create. + attr_reader :attributes + + # Product Analytics monitor request resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ProductAnalyticsMonitorCreateAttributes', + :'type' => :'ProductAnalyticsMonitorRequestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_create_request.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_create_request.rb new file mode 100644 index 000000000000..5fe807ad41fe --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to create a Product Analytics monitor. + class ProductAnalyticsMonitorCreateRequest + include BaseGenericModel + + # Data of the Product Analytics monitor to create. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ProductAnalyticsMonitorCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_creator.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_creator.rb new file mode 100644 index 000000000000..abef8fe157f5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_creator.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The user who created the monitor. + class ProductAnalyticsMonitorCreator + include BaseGenericModel + + # Email of the user. + attr_accessor :email + + # Handle of the user. + attr_accessor :handle + + # Numeric ID of the user. + attr_accessor :id + + # Name of the user. + attr_accessor :name + + # UUID of the user. + attr_accessor :uuid + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'email' => :'email', + :'handle' => :'handle', + :'id' => :'id', + :'name' => :'name', + :'uuid' => :'uuid' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'email' => :'String', + :'handle' => :'String', + :'id' => :'Integer', + :'name' => :'String', + :'uuid' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorCreator` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'handle') + self.handle = attributes[:'handle'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'uuid') + self.uuid = attributes[:'uuid'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + email == o.email && + handle == o.handle && + id == o.id && + name == o.name && + uuid == o.uuid && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [email, handle, id, name, uuid, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_data.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_data.rb new file mode 100644 index 000000000000..dca98a3e34ed --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A Product Analytics monitor. + class ProductAnalyticsMonitorData + include BaseGenericModel + + # Attributes of a Product Analytics monitor. + attr_reader :attributes + + # ID of the monitor. + attr_reader :id + + # Product Analytics monitor resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ProductAnalyticsMonitorAttributes', + :'id' => :'String', + :'type' => :'ProductAnalyticsMonitorType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_list_attributes.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_list_attributes.rb new file mode 100644 index 000000000000..c369b4505b22 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_list_attributes.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A list of Product Analytics monitors. + class ProductAnalyticsMonitorListAttributes + include BaseGenericModel + + # The monitors. + attr_reader :monitors + + # Total number of monitors that match, across all pages. + attr_reader :total + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'monitors' => :'monitors', + :'total' => :'total' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'monitors' => :'Array', + :'total' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorListAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'monitors') + if (value = attributes[:'monitors']).is_a?(Array) + self.monitors = value + end + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @monitors.nil? + return false if @total.nil? + true + end + + # Custom attribute writer method with validation + # @param monitors [Object] Object to be assigned + # @!visibility private + def monitors=(monitors) + if monitors.nil? + fail ArgumentError, 'invalid value for "monitors", monitors cannot be nil.' + end + @monitors = monitors + end + + # Custom attribute writer method with validation + # @param total [Object] Object to be assigned + # @!visibility private + def total=(total) + if total.nil? + fail ArgumentError, 'invalid value for "total", total cannot be nil.' + end + @total = total + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + monitors == o.monitors && + total == o.total && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [monitors, total, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_list_data.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_list_data.rb new file mode 100644 index 000000000000..7e15a7588c8a --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_list_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of a Product Analytics monitor list. + class ProductAnalyticsMonitorListData + include BaseGenericModel + + # A list of Product Analytics monitors. + attr_reader :attributes + + # ID of the list resource. Always `list`. + attr_reader :id + + # Product Analytics monitor list resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ProductAnalyticsMonitorListAttributes', + :'id' => :'String', + :'type' => :'ProductAnalyticsMonitorListType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorListData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_list_item.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_list_item.rb new file mode 100644 index 000000000000..2ab720941b2f --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_list_item.rb @@ -0,0 +1,324 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A Product Analytics monitor in a list. + class ProductAnalyticsMonitorListItem + include BaseGenericModel + + # Time the monitor was created. + attr_accessor :created_time + + # The user who created the monitor. + attr_accessor :creator + + # ID of the monitor. + attr_reader :id + + # Notification message sent when the monitor alerts. + attr_reader :message + + # Time the monitor was last modified. + attr_accessor :modified_time + + # Name of the monitor. + attr_reader :name + + # Options of a Product Analytics monitor. + attr_reader :options + + # ID of the organization that owns the monitor. + attr_reader :org_id + + # Priority of the monitor, from 1 (highest) to 5 (lowest). + attr_reader :priority + + # Monitor query. + attr_reader :query + + # Current alert status of the monitor. `No Data` is returned when the monitor has not been evaluated yet. + attr_reader :status + + # Monitor tags, as `key:value` strings. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_time' => :'Time', + :'creator' => :'ProductAnalyticsMonitorCreator', + :'id' => :'String', + :'message' => :'String', + :'modified_time' => :'Time', + :'name' => :'String', + :'options' => :'ProductAnalyticsMonitorOptions', + :'org_id' => :'Integer', + :'priority' => :'Integer', + :'query' => :'String', + :'status' => :'ProductAnalyticsMonitorStatus', + :'tags' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'tags', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorListItem` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_time') + self.created_time = attributes[:'created_time'] + end + + if attributes.key?(:'creator') + self.creator = attributes[:'creator'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'modified_time') + self.modified_time = attributes[:'modified_time'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'options') + self.options = attributes[:'options'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @message.nil? + return false if @name.nil? + return false if @options.nil? + return false if @org_id.nil? + return false if !@priority.nil? && @priority > 5 + return false if !@priority.nil? && @priority < 1 + return false if @query.nil? + return false if @status.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param message [Object] Object to be assigned + # @!visibility private + def message=(message) + if message.nil? + fail ArgumentError, 'invalid value for "message", message cannot be nil.' + end + @message = message + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param options [Object] Object to be assigned + # @!visibility private + def options=(options) + if options.nil? + fail ArgumentError, 'invalid value for "options", options cannot be nil.' + end + @options = options + end + + # Custom attribute writer method with validation + # @param org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + end + + # Custom attribute writer method with validation + # @param priority [Object] Object to be assigned + # @!visibility private + def priority=(priority) + if !priority.nil? && priority > 5 + fail ArgumentError, 'invalid value for "priority", must be smaller than or equal to 5.' + end + if !priority.nil? && priority < 1 + fail ArgumentError, 'invalid value for "priority", must be greater than or equal to 1.' + end + @priority = priority + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_time == o.created_time && + creator == o.creator && + id == o.id && + message == o.message && + modified_time == o.modified_time && + name == o.name && + options == o.options && + org_id == o.org_id && + priority == o.priority && + query == o.query && + status == o.status && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_time, creator, id, message, modified_time, name, options, org_id, priority, query, status, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_list_response.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_list_response.rb new file mode 100644 index 000000000000..d1a3de03b574 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_list_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of Product Analytics monitors. + class ProductAnalyticsMonitorListResponse + include BaseGenericModel + + # Data of a Product Analytics monitor list. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ProductAnalyticsMonitorListData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_list_type.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_list_type.rb new file mode 100644 index 000000000000..307784c86525 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_list_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Product Analytics monitor list resource type. + class ProductAnalyticsMonitorListType + include BaseEnumModel + + PA_MONITOR_LIST = "pa_monitor_list".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_options.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_options.rb new file mode 100644 index 000000000000..1dd59c2be4b9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_options.rb @@ -0,0 +1,168 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Options of a Product Analytics monitor. + class ProductAnalyticsMonitorOptions + include BaseGenericModel + + # UUID of the chart the monitor was created from. + attr_accessor :chart_uuid + + # Metric of the chart that the monitor evaluates. + attr_accessor :metric_selector + + # Index of the chart query that the monitor evaluates. + attr_accessor :query_index + + # Number of minutes after the last notification before the monitor notifies again on the current status. `0` means it never notifies again. + attr_accessor :renotify_interval + + # 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. + attr_accessor :thresholds + + # Time frame of the chart that the monitor evaluates. + attr_accessor :timeframe + + # Query variables referenced by the monitor query. + attr_accessor :variables + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'chart_uuid' => :'chart_uuid', + :'metric_selector' => :'metric_selector', + :'query_index' => :'query_index', + :'renotify_interval' => :'renotify_interval', + :'thresholds' => :'thresholds', + :'timeframe' => :'timeframe', + :'variables' => :'variables' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'chart_uuid' => :'String', + :'metric_selector' => :'String', + :'query_index' => :'Integer', + :'renotify_interval' => :'Integer', + :'thresholds' => :'ProductAnalyticsMonitorThresholds', + :'timeframe' => :'String', + :'variables' => :'Array>' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorOptions` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'chart_uuid') + self.chart_uuid = attributes[:'chart_uuid'] + end + + if attributes.key?(:'metric_selector') + self.metric_selector = attributes[:'metric_selector'] + end + + if attributes.key?(:'query_index') + self.query_index = attributes[:'query_index'] + end + + if attributes.key?(:'renotify_interval') + self.renotify_interval = attributes[:'renotify_interval'] + end + + if attributes.key?(:'thresholds') + self.thresholds = attributes[:'thresholds'] + end + + if attributes.key?(:'timeframe') + self.timeframe = attributes[:'timeframe'] + end + + if attributes.key?(:'variables') + if (value = attributes[:'variables']).is_a?(Array) + self.variables = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + chart_uuid == o.chart_uuid && + metric_selector == o.metric_selector && + query_index == o.query_index && + renotify_interval == o.renotify_interval && + thresholds == o.thresholds && + timeframe == o.timeframe && + variables == o.variables && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [chart_uuid, metric_selector, query_index, renotify_interval, thresholds, timeframe, variables, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_request_type.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_request_type.rb new file mode 100644 index 000000000000..6ac1bef91df7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Product Analytics monitor request resource type. + class ProductAnalyticsMonitorRequestType + include BaseEnumModel + + PA_MONITOR_REQUEST = "pa_monitor_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_response.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_response.rb new file mode 100644 index 000000000000..ae2a9827a79d --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a Product Analytics monitor. + class ProductAnalyticsMonitorResponse + include BaseGenericModel + + # A Product Analytics monitor. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ProductAnalyticsMonitorData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_status.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_status.rb new file mode 100644 index 000000000000..12733c9ed555 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_status.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Current alert status of the monitor. `No Data` is returned when the monitor has not been evaluated yet. + class ProductAnalyticsMonitorStatus + include BaseEnumModel + + OK = "OK".freeze + ALERT = "Alert".freeze + WARN = "Warn".freeze + NO_DATA = "No Data".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_thresholds.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_thresholds.rb new file mode 100644 index 000000000000..e1be57352170 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_thresholds.rb @@ -0,0 +1,136 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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. + class ProductAnalyticsMonitorThresholds + include BaseGenericModel + + # Value that triggers a critical alert. + attr_accessor :critical + + # Value at which a critical alert recovers. + attr_accessor :critical_recovery + + # Value that triggers a warning. + attr_accessor :warning + + # Value at which a warning recovers. + attr_accessor :warning_recovery + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'critical' => :'critical', + :'critical_recovery' => :'critical_recovery', + :'warning' => :'warning', + :'warning_recovery' => :'warning_recovery' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'critical' => :'Float', + :'critical_recovery' => :'Float', + :'warning' => :'Float', + :'warning_recovery' => :'Float' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorThresholds` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'critical') + self.critical = attributes[:'critical'] + end + + if attributes.key?(:'critical_recovery') + self.critical_recovery = attributes[:'critical_recovery'] + end + + if attributes.key?(:'warning') + self.warning = attributes[:'warning'] + end + + if attributes.key?(:'warning_recovery') + self.warning_recovery = attributes[:'warning_recovery'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + critical == o.critical && + critical_recovery == o.critical_recovery && + warning == o.warning && + warning_recovery == o.warning_recovery && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [critical, critical_recovery, warning, warning_recovery, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_type.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_type.rb new file mode 100644 index 000000000000..f0f6f3408656 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Product Analytics monitor resource type. + class ProductAnalyticsMonitorType + include BaseEnumModel + + PA_MONITOR = "pa_monitor".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_unlink_attributes.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_unlink_attributes.rb new file mode 100644 index 000000000000..7735bf9cfe5f --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_unlink_attributes.rb @@ -0,0 +1,134 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The 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. + class ProductAnalyticsMonitorUnlinkAttributes + include BaseGenericModel + + # ID of the chart the monitor is linked to. + attr_reader :chart_id + + # ID of the dashboard the monitor is linked to. + attr_accessor :dashboard_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'chart_id' => :'chart_id', + :'dashboard_id' => :'dashboard_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'chart_id' => :'String', + :'dashboard_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorUnlinkAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'chart_id') + self.chart_id = attributes[:'chart_id'] + end + + if attributes.key?(:'dashboard_id') + self.dashboard_id = attributes[:'dashboard_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @chart_id.nil? + true + end + + # Custom attribute writer method with validation + # @param chart_id [Object] Object to be assigned + # @!visibility private + def chart_id=(chart_id) + if chart_id.nil? + fail ArgumentError, 'invalid value for "chart_id", chart_id cannot be nil.' + end + @chart_id = chart_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + chart_id == o.chart_id && + dashboard_id == o.dashboard_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [chart_id, dashboard_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_unlink_data.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_unlink_data.rb new file mode 100644 index 000000000000..3420c282fecd --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_unlink_data.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the Product Analytics monitor unlink request. + class ProductAnalyticsMonitorUnlinkData + include BaseGenericModel + + # 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. + attr_reader :attributes + + # Product Analytics monitor unlink request resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ProductAnalyticsMonitorUnlinkAttributes', + :'type' => :'ProductAnalyticsMonitorUnlinkRequestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorUnlinkData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_unlink_request.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_unlink_request.rb new file mode 100644 index 000000000000..14a3db1aa8de --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_unlink_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to unlink a Product Analytics monitor from its chart. + class ProductAnalyticsMonitorUnlinkRequest + include BaseGenericModel + + # Data of the Product Analytics monitor unlink request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ProductAnalyticsMonitorUnlinkData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorUnlinkRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_unlink_request_type.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_unlink_request_type.rb new file mode 100644 index 000000000000..edb1e1d54bfa --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_unlink_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Product Analytics monitor unlink request resource type. + class ProductAnalyticsMonitorUnlinkRequestType + include BaseEnumModel + + PA_MONITOR_UNLINK_REQUEST = "pa_monitor_unlink_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_update_attributes.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_update_attributes.rb new file mode 100644 index 000000000000..6d23bb0b3e55 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_update_attributes.rb @@ -0,0 +1,179 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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. + class ProductAnalyticsMonitorUpdateAttributes + include BaseGenericModel + + # Notification message sent when the monitor alerts. + attr_accessor :message + + # Name of the monitor. + attr_accessor :name + + # Options of a Product Analytics monitor. + attr_accessor :options + + # Priority of the monitor, from 1 (highest) to 5 (lowest). + attr_reader :priority + + # Monitor query. + attr_accessor :query + + # 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`. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'message' => :'message', + :'name' => :'name', + :'options' => :'options', + :'priority' => :'priority', + :'query' => :'query', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'message' => :'String', + :'name' => :'String', + :'options' => :'ProductAnalyticsMonitorOptions', + :'priority' => :'Integer', + :'query' => :'String', + :'tags' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'options') + self.options = attributes[:'options'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'tags') + self.tags = attributes[:'tags'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@priority.nil? && @priority > 5 + return false if !@priority.nil? && @priority < 1 + true + end + + # Custom attribute writer method with validation + # @param priority [Object] Object to be assigned + # @!visibility private + def priority=(priority) + if !priority.nil? && priority > 5 + fail ArgumentError, 'invalid value for "priority", must be smaller than or equal to 5.' + end + if !priority.nil? && priority < 1 + fail ArgumentError, 'invalid value for "priority", must be greater than or equal to 1.' + end + @priority = priority + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message && + name == o.name && + options == o.options && + priority == o.priority && + query == o.query && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [message, name, options, priority, query, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_update_data.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_update_data.rb new file mode 100644 index 000000000000..d8b0e87481b3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_update_data.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the Product Analytics monitor update. + class ProductAnalyticsMonitorUpdateData + include BaseGenericModel + + # 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. + attr_reader :attributes + + # Product Analytics monitor request resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ProductAnalyticsMonitorUpdateAttributes', + :'type' => :'ProductAnalyticsMonitorRequestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/product_analytics_monitor_update_request.rb b/lib/datadog_api_client/v2/models/product_analytics_monitor_update_request.rb new file mode 100644 index 000000000000..98605dca4cb9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/product_analytics_monitor_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to update a Product Analytics monitor. + class ProductAnalyticsMonitorUpdateRequest + include BaseGenericModel + + # Data of the Product Analytics monitor update. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ProductAnalyticsMonitorUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ProductAnalyticsMonitorUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_attributes.rb b/lib/datadog_api_client/v2/models/segment_attributes.rb new file mode 100644 index 000000000000..1afa595380c9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_attributes.rb @@ -0,0 +1,328 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a segment. + class SegmentAttributes + include BaseGenericModel + + # Time the segment was created. + attr_reader :created_at + + # A Datadog user who created, modified, or disabled a segment. + attr_accessor :created_by + + # 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`. + attr_reader :data_query + + # Description of the segment. + attr_accessor :description + + # Time the segment was disabled, if it was. + attr_accessor :disabled_at + + # A Datadog user who created, modified, or disabled a segment. + attr_accessor :disabled_by + + # Kind of entity that the segment contains, `user` or `account`. + attr_accessor :entity + + # Time the segment membership was last computed. + attr_accessor :materialized_at + + # Time the segment was last modified. + attr_reader :modified_at + + # A Datadog user who created, modified, or disabled a segment. + attr_accessor :modified_by + + # Name of the segment. + attr_reader :name + + # ID of the organization that owns the segment. + attr_accessor :org_id + + # Number of entities in the segment when its membership was last computed. `-1` when the count is not available yet. + attr_accessor :row_count + + # Who created the segment. `0` for a user and `1` for Datadog. + attr_accessor :source + + # Tags of the segment. + attr_accessor :tags + + # Kind of segment, derived from its blocks, such as `event_platform`, `user_store`, or `combination`. + attr_accessor :type + + # Version of the segment, increased on each update. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'created_by' => :'SegmentUser', + :'data_query' => :'SegmentDataQuery', + :'description' => :'String', + :'disabled_at' => :'Time', + :'disabled_by' => :'SegmentUser', + :'entity' => :'String', + :'materialized_at' => :'Time', + :'modified_at' => :'Time', + :'modified_by' => :'SegmentUser', + :'name' => :'String', + :'org_id' => :'Integer', + :'row_count' => :'Integer', + :'source' => :'Integer', + :'tags' => :'Array', + :'type' => :'String', + :'version' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'materialized_at', + :'tags', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'data_query') + self.data_query = attributes[:'data_query'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'disabled_at') + self.disabled_at = attributes[:'disabled_at'] + end + + if attributes.key?(:'disabled_by') + self.disabled_by = attributes[:'disabled_by'] + end + + if attributes.key?(:'entity') + self.entity = attributes[:'entity'] + end + + if attributes.key?(:'materialized_at') + self.materialized_at = attributes[:'materialized_at'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'modified_by') + self.modified_by = attributes[:'modified_by'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'row_count') + self.row_count = attributes[:'row_count'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @data_query.nil? + return false if @modified_at.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param data_query [Object] Object to be assigned + # @!visibility private + def data_query=(data_query) + if data_query.nil? + fail ArgumentError, 'invalid value for "data_query", data_query cannot be nil.' + end + @data_query = data_query + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + created_by == o.created_by && + data_query == o.data_query && + description == o.description && + disabled_at == o.disabled_at && + disabled_by == o.disabled_by && + entity == o.entity && + materialized_at == o.materialized_at && + modified_at == o.modified_at && + modified_by == o.modified_by && + name == o.name && + org_id == o.org_id && + row_count == o.row_count && + source == o.source && + tags == o.tags && + type == o.type && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, created_by, data_query, description, disabled_at, disabled_by, entity, materialized_at, modified_at, modified_by, name, org_id, row_count, source, tags, type, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_create_attributes.rb b/lib/datadog_api_client/v2/models/segment_create_attributes.rb new file mode 100644 index 000000000000..d62393ccd4e1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_create_attributes.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the segment to create. + class SegmentCreateAttributes + include BaseGenericModel + + # 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`. + attr_reader :data_query + + # Description of the segment. + attr_accessor :description + + # Name of the segment. It must be unique in the organization. + attr_reader :name + + # Tags of the segment. Tags cannot contain commas. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_query' => :'data_query', + :'description' => :'description', + :'name' => :'name', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_query' => :'SegmentDataQuery', + :'description' => :'String', + :'name' => :'String', + :'tags' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data_query') + self.data_query = attributes[:'data_query'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_query.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param data_query [Object] Object to be assigned + # @!visibility private + def data_query=(data_query) + if data_query.nil? + fail ArgumentError, 'invalid value for "data_query", data_query cannot be nil.' + end + @data_query = data_query + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data_query == o.data_query && + description == o.description && + name == o.name && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_query, description, name, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_create_data.rb b/lib/datadog_api_client/v2/models/segment_create_data.rb new file mode 100644 index 000000000000..7a4e294441e2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the segment to create. + class SegmentCreateData + include BaseGenericModel + + # Attributes of the segment to create. + attr_reader :attributes + + # Segment resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SegmentCreateAttributes', + :'type' => :'SegmentResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_create_request.rb b/lib/datadog_api_client/v2/models/segment_create_request.rb new file mode 100644 index 000000000000..ec34a6609af0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to create a segment. + class SegmentCreateRequest + include BaseGenericModel + + # Data of the segment to create. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SegmentCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_data.rb b/lib/datadog_api_client/v2/models/segment_data.rb new file mode 100644 index 000000000000..fcb51195628b --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A segment. + class SegmentData + include BaseGenericModel + + # Attributes of a segment. + attr_reader :attributes + + # ID of the segment. + attr_reader :id + + # Segment resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SegmentAttributes', + :'id' => :'String', + :'type' => :'SegmentResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_data_query.rb b/lib/datadog_api_client/v2/models/segment_data_query.rb new file mode 100644 index 000000000000..95c9c24772e7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_data_query.rb @@ -0,0 +1,202 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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`. + class SegmentDataQuery + include BaseGenericModel + + # Account profile blocks. + attr_accessor :account_store + + # Boolean formula that combines blocks by name. + attr_accessor :combination + + # Event blocks. + attr_accessor :event_platform + + # Funnel blocks. + attr_accessor :journeys + + # Reference table blocks. + attr_accessor :reference_table + + # Retention blocks. + attr_accessor :retentions + + # Uploaded list blocks. + attr_accessor :static + + # Template blocks. + attr_accessor :templates + + # User profile blocks. + attr_accessor :user_store + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_store' => :'Array', + :'combination' => :'String', + :'event_platform' => :'Array', + :'journeys' => :'Array', + :'reference_table' => :'Array', + :'retentions' => :'Array>', + :'static' => :'Array', + :'templates' => :'Array', + :'user_store' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentDataQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'account_store') + if (value = attributes[:'account_store']).is_a?(Array) + self.account_store = value + end + end + + if attributes.key?(:'combination') + self.combination = attributes[:'combination'] + end + + if attributes.key?(:'event_platform') + if (value = attributes[:'event_platform']).is_a?(Array) + self.event_platform = value + end + end + + if attributes.key?(:'journeys') + if (value = attributes[:'journeys']).is_a?(Array) + self.journeys = value + end + end + + if attributes.key?(:'reference_table') + if (value = attributes[:'reference_table']).is_a?(Array) + self.reference_table = value + end + end + + if attributes.key?(:'retentions') + if (value = attributes[:'retentions']).is_a?(Array) + self.retentions = value + end + end + + if attributes.key?(:'static') + if (value = attributes[:'static']).is_a?(Array) + self.static = value + end + end + + if attributes.key?(:'templates') + if (value = attributes[:'templates']).is_a?(Array) + self.templates = value + end + end + + if attributes.key?(:'user_store') + if (value = attributes[:'user_store']).is_a?(Array) + self.user_store = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_store == o.account_store && + combination == o.combination && + event_platform == o.event_platform && + journeys == o.journeys && + reference_table == o.reference_table && + retentions == o.retentions && + static == o.static && + templates == o.templates && + user_store == o.user_store && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_store, combination, event_platform, journeys, reference_table, retentions, static, templates, user_store, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_delete_attributes.rb b/lib/datadog_api_client/v2/models/segment_delete_attributes.rb new file mode 100644 index 000000000000..363711c154a6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_delete_attributes.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a deleted segment. + class SegmentDeleteAttributes + include BaseGenericModel + + # Time the segment was deleted. + attr_reader :disabled_at + + # A Datadog user who created, modified, or disabled a segment. + attr_accessor :disabled_by + + # Name of the segment. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'disabled_at' => :'disabled_at', + :'disabled_by' => :'disabled_by', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'disabled_at' => :'Time', + :'disabled_by' => :'SegmentUser', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentDeleteAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'disabled_at') + self.disabled_at = attributes[:'disabled_at'] + end + + if attributes.key?(:'disabled_by') + self.disabled_by = attributes[:'disabled_by'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @disabled_at.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param disabled_at [Object] Object to be assigned + # @!visibility private + def disabled_at=(disabled_at) + if disabled_at.nil? + fail ArgumentError, 'invalid value for "disabled_at", disabled_at cannot be nil.' + end + @disabled_at = disabled_at + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + disabled_at == o.disabled_at && + disabled_by == o.disabled_by && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [disabled_at, disabled_by, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_delete_data.rb b/lib/datadog_api_client/v2/models/segment_delete_data.rb new file mode 100644 index 000000000000..6adc97575665 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_delete_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A deleted segment. + class SegmentDeleteData + include BaseGenericModel + + # Attributes of a deleted segment. + attr_reader :attributes + + # ID of the segment. + attr_reader :id + + # Deleted segment resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SegmentDeleteAttributes', + :'id' => :'String', + :'type' => :'SegmentDeletedType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentDeleteData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_delete_response.rb b/lib/datadog_api_client/v2/models/segment_delete_response.rb new file mode 100644 index 000000000000..018678d6e2ff --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_delete_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response returned when a segment is deleted. + class SegmentDeleteResponse + include BaseGenericModel + + # A deleted segment. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SegmentDeleteData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentDeleteResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_deleted_type.rb b/lib/datadog_api_client/v2/models/segment_deleted_type.rb new file mode 100644 index 000000000000..9e8c9fabff53 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_deleted_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Deleted segment resource type. + class SegmentDeletedType + include BaseEnumModel + + DELETED_SEGMENT = "deleted_segment".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/segment_entity.rb b/lib/datadog_api_client/v2/models/segment_entity.rb new file mode 100644 index 000000000000..bf01e02b863f --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_entity.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Kind of entity that a segment contains. + class SegmentEntity + include BaseEnumModel + + USER = "user".freeze + ACCOUNT = "account".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/segment_event_platform_block.rb b/lib/datadog_api_client/v2/models/segment_event_platform_block.rb new file mode 100644 index 000000000000..6e6ca93f81cf --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_event_platform_block.rb @@ -0,0 +1,164 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # 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. + class SegmentEventPlatformBlock + include BaseGenericModel + + # Facet that identifies the entity, such as `@usr.id`. + attr_reader :facet + + # Start of the time range. + attr_accessor :from + + # Name of the block, used in `combination`. + attr_accessor :name + + # Event search query. + attr_accessor :query + + # End of the time range. + attr_accessor :to + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'facet' => :'facet', + :'from' => :'from', + :'name' => :'name', + :'query' => :'query', + :'to' => :'to' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'facet' => :'String', + :'from' => :'String', + :'name' => :'String', + :'query' => :'String', + :'to' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentEventPlatformBlock` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'facet') + self.facet = attributes[:'facet'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @facet.nil? + true + end + + # Custom attribute writer method with validation + # @param facet [Object] Object to be assigned + # @!visibility private + def facet=(facet) + if facet.nil? + fail ArgumentError, 'invalid value for "facet", facet cannot be nil.' + end + @facet = facet + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + facet == o.facet && + from == o.from && + name == o.name && + query == o.query && + to == o.to && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [facet, from, name, query, to, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_journey_block.rb b/lib/datadog_api_client/v2/models/segment_journey_block.rb new file mode 100644 index 000000000000..e054957dda91 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_journey_block.rb @@ -0,0 +1,177 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Selects the users who converted or dropped off in a funnel. + class SegmentJourneyBlock + include BaseGenericModel + + # Whether to return the entities that converted at the target step, or those that dropped off. + attr_accessor :conversion_type + + # Whether to leave out anonymous users. + attr_accessor :exclude_anonymous_traffic + + # Start of the time range, in epoch milliseconds. + attr_accessor :from + + # Group-by definitions of the funnel query. + attr_accessor :group_by + + # Name of the block, used in `combination`. + attr_accessor :name + + # Funnel search, with the same shape as the `search` of a Product Analytics journey query. + attr_accessor :search + + # Funnel step or step range to evaluate. + attr_accessor :target + + # End of the time range, in epoch milliseconds. + attr_accessor :to + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'conversion_type' => :'ProductAnalyticsJourneyConversionType', + :'exclude_anonymous_traffic' => :'Boolean', + :'from' => :'Integer', + :'group_by' => :'Array>', + :'name' => :'String', + :'search' => :'Hash', + :'target' => :'Hash', + :'to' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentJourneyBlock` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'conversion_type') + self.conversion_type = attributes[:'conversion_type'] + end + + if attributes.key?(:'exclude_anonymous_traffic') + self.exclude_anonymous_traffic = attributes[:'exclude_anonymous_traffic'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'group_by') + if (value = attributes[:'group_by']).is_a?(Array) + self.group_by = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'search') + self.search = attributes[:'search'] + end + + if attributes.key?(:'target') + self.target = attributes[:'target'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + conversion_type == o.conversion_type && + exclude_anonymous_traffic == o.exclude_anonymous_traffic && + from == o.from && + group_by == o.group_by && + name == o.name && + search == o.search && + target == o.target && + to == o.to && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [conversion_type, exclude_anonymous_traffic, from, group_by, name, search, target, to, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_preview_attributes.rb b/lib/datadog_api_client/v2/models/segment_preview_attributes.rb new file mode 100644 index 000000000000..eaa794430caa --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_preview_attributes.rb @@ -0,0 +1,182 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Segment definition to preview and the columns to return. + # Without columns, the response returns the user ID, or the account ID for account segments. + class SegmentPreviewAttributes + include BaseGenericModel + + # Account profile columns to return. + attr_accessor :account_store_columns + + # 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`. + attr_reader :data_query + + # Maximum number of rows to return, up to 1000. Defaults to 1000. + attr_reader :limit + + # Reference table columns to return. + attr_accessor :reference_table_columns + + # User profile columns to return. + attr_accessor :user_store_columns + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_store_columns' => :'Array', + :'data_query' => :'SegmentDataQuery', + :'limit' => :'Integer', + :'reference_table_columns' => :'Array', + :'user_store_columns' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentPreviewAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'account_store_columns') + if (value = attributes[:'account_store_columns']).is_a?(Array) + self.account_store_columns = value + end + end + + if attributes.key?(:'data_query') + self.data_query = attributes[:'data_query'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'reference_table_columns') + if (value = attributes[:'reference_table_columns']).is_a?(Array) + self.reference_table_columns = value + end + end + + if attributes.key?(:'user_store_columns') + if (value = attributes[:'user_store_columns']).is_a?(Array) + self.user_store_columns = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_query.nil? + return false if !@limit.nil? && @limit > 1000 + true + end + + # Custom attribute writer method with validation + # @param data_query [Object] Object to be assigned + # @!visibility private + def data_query=(data_query) + if data_query.nil? + fail ArgumentError, 'invalid value for "data_query", data_query cannot be nil.' + end + @data_query = data_query + end + + # Custom attribute writer method with validation + # @param limit [Object] Object to be assigned + # @!visibility private + def limit=(limit) + if !limit.nil? && limit > 1000 + fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 1000.' + end + @limit = limit + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_store_columns == o.account_store_columns && + data_query == o.data_query && + limit == o.limit && + reference_table_columns == o.reference_table_columns && + user_store_columns == o.user_store_columns && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_store_columns, data_query, limit, reference_table_columns, user_store_columns, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_preview_data.rb b/lib/datadog_api_client/v2/models/segment_preview_data.rb new file mode 100644 index 000000000000..6c636333940d --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_preview_data.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the segment preview request. + class SegmentPreviewData + include BaseGenericModel + + # Segment definition to preview and the columns to return. + # Without columns, the response returns the user ID, or the account ID for account segments. + attr_reader :attributes + + # Segment preview request resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SegmentPreviewAttributes', + :'type' => :'SegmentPreviewRequestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentPreviewData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_preview_request.rb b/lib/datadog_api_client/v2/models/segment_preview_request.rb new file mode 100644 index 000000000000..c75f5c28d2ca --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_preview_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to preview the members of a segment definition. + class SegmentPreviewRequest + include BaseGenericModel + + # Data of the segment preview request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SegmentPreviewData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentPreviewRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_preview_request_type.rb b/lib/datadog_api_client/v2/models/segment_preview_request_type.rb new file mode 100644 index 000000000000..161db024d8c4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_preview_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Segment preview request resource type. + class SegmentPreviewRequestType + include BaseEnumModel + + SEGMENT_PREVIEW_REQUEST = "segment_preview_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/segment_preview_response.rb b/lib/datadog_api_client/v2/models/segment_preview_response.rb new file mode 100644 index 000000000000..bbd6de85791f --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_preview_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a preview of the members of a segment. + class SegmentPreviewResponse + include BaseGenericModel + + # Data of the segment preview response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SegmentPreviewResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentPreviewResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_preview_response_attributes.rb b/lib/datadog_api_client/v2/models/segment_preview_response_attributes.rb new file mode 100644 index 000000000000..b8c74d1a5d23 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_preview_response_attributes.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Members of the previewed segment. + class SegmentPreviewResponseAttributes + include BaseGenericModel + + # Rows of the preview, each as a map of column names to values. + attr_reader :hits + + # Total number of entities in the segment. + attr_reader :total_rows + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'hits' => :'hits', + :'total_rows' => :'total_rows' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'hits' => :'Array>', + :'total_rows' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentPreviewResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'hits') + if (value = attributes[:'hits']).is_a?(Array) + self.hits = value + end + end + + if attributes.key?(:'total_rows') + self.total_rows = attributes[:'total_rows'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @hits.nil? + return false if @total_rows.nil? + true + end + + # Custom attribute writer method with validation + # @param hits [Object] Object to be assigned + # @!visibility private + def hits=(hits) + if hits.nil? + fail ArgumentError, 'invalid value for "hits", hits cannot be nil.' + end + @hits = hits + end + + # Custom attribute writer method with validation + # @param total_rows [Object] Object to be assigned + # @!visibility private + def total_rows=(total_rows) + if total_rows.nil? + fail ArgumentError, 'invalid value for "total_rows", total_rows cannot be nil.' + end + @total_rows = total_rows + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + hits == o.hits && + total_rows == o.total_rows && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [hits, total_rows, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_preview_response_data.rb b/lib/datadog_api_client/v2/models/segment_preview_response_data.rb new file mode 100644 index 000000000000..b440469c6bc9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_preview_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the segment preview response. + class SegmentPreviewResponseData + include BaseGenericModel + + # Members of the previewed segment. + attr_reader :attributes + + # ID of the preview response. + attr_reader :id + + # Segment preview response resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SegmentPreviewResponseAttributes', + :'id' => :'String', + :'type' => :'SegmentPreviewResponseType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentPreviewResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_preview_response_type.rb b/lib/datadog_api_client/v2/models/segment_preview_response_type.rb new file mode 100644 index 000000000000..1d86c219c6ea --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_preview_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Segment preview response resource type. + class SegmentPreviewResponseType + include BaseEnumModel + + UNIFIED_SEGMENT_PREVIEW_RESPONSE = "unified_segment_preview_response".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/segment_profile_store_block.rb b/lib/datadog_api_client/v2/models/segment_profile_store_block.rb new file mode 100644 index 000000000000..1bfd1cdfffc0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_profile_store_block.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Selects users or accounts by their profile attributes. + class SegmentProfileStoreBlock + include BaseGenericModel + + # Name of the block, used in `combination`. + attr_accessor :name + + # Profile attribute query. + attr_reader :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'query' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentProfileStoreBlock` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @query.nil? + true + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_reference_table_block.rb b/lib/datadog_api_client/v2/models/segment_reference_table_block.rb new file mode 100644 index 000000000000..ef9bf2f08cdb --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_reference_table_block.rb @@ -0,0 +1,176 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Selects users or accounts from a reference table. + class SegmentReferenceTableBlock + include BaseGenericModel + + # Columns to include. + attr_accessor :columns + + # Query that filters the reference table rows. + attr_accessor :filter_query + + # How reference table rows are matched to entities. + attr_reader :join_condition + + # Name of the block, used in `combination`. + attr_accessor :name + + # Name of the reference table. + attr_reader :table_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'columns' => :'columns', + :'filter_query' => :'filter_query', + :'join_condition' => :'join_condition', + :'name' => :'name', + :'table_name' => :'table_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'columns' => :'Array', + :'filter_query' => :'String', + :'join_condition' => :'SegmentReferenceTableJoinCondition', + :'name' => :'String', + :'table_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentReferenceTableBlock` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'columns') + if (value = attributes[:'columns']).is_a?(Array) + self.columns = value + end + end + + if attributes.key?(:'filter_query') + self.filter_query = attributes[:'filter_query'] + end + + if attributes.key?(:'join_condition') + self.join_condition = attributes[:'join_condition'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'table_name') + self.table_name = attributes[:'table_name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @join_condition.nil? + return false if @table_name.nil? + true + end + + # Custom attribute writer method with validation + # @param join_condition [Object] Object to be assigned + # @!visibility private + def join_condition=(join_condition) + if join_condition.nil? + fail ArgumentError, 'invalid value for "join_condition", join_condition cannot be nil.' + end + @join_condition = join_condition + end + + # Custom attribute writer method with validation + # @param table_name [Object] Object to be assigned + # @!visibility private + def table_name=(table_name) + if table_name.nil? + fail ArgumentError, 'invalid value for "table_name", table_name cannot be nil.' + end + @table_name = table_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + columns == o.columns && + filter_query == o.filter_query && + join_condition == o.join_condition && + name == o.name && + table_name == o.table_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [columns, filter_query, join_condition, name, table_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_reference_table_column.rb b/lib/datadog_api_client/v2/models/segment_reference_table_column.rb new file mode 100644 index 000000000000..98409e67c833 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_reference_table_column.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A reference table column to include. + class SegmentReferenceTableColumn + include BaseGenericModel + + # Name to use for the column. + attr_accessor :_alias + + # Name of the column in the reference table. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_alias' => :'alias', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_alias' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentReferenceTableColumn` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_alias') + self._alias = attributes[:'_alias'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _alias == o._alias && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_alias, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_reference_table_join_condition.rb b/lib/datadog_api_client/v2/models/segment_reference_table_join_condition.rb new file mode 100644 index 000000000000..58ce98cd56fa --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_reference_table_join_condition.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # How reference table rows are matched to entities. + class SegmentReferenceTableJoinCondition + include BaseGenericModel + + # Reference table column that holds the entity ID. + attr_reader :column_name + + # Facet that identifies the entity, such as `@usr.id`. + attr_accessor :facet + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'column_name' => :'column_name', + :'facet' => :'facet' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'column_name' => :'String', + :'facet' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentReferenceTableJoinCondition` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'column_name') + self.column_name = attributes[:'column_name'] + end + + if attributes.key?(:'facet') + self.facet = attributes[:'facet'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @column_name.nil? + true + end + + # Custom attribute writer method with validation + # @param column_name [Object] Object to be assigned + # @!visibility private + def column_name=(column_name) + if column_name.nil? + fail ArgumentError, 'invalid value for "column_name", column_name cannot be nil.' + end + @column_name = column_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + column_name == o.column_name && + facet == o.facet && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [column_name, facet, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_resource_type.rb b/lib/datadog_api_client/v2/models/segment_resource_type.rb new file mode 100644 index 000000000000..d5dcdc09ef30 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_resource_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Segment resource type. + class SegmentResourceType + include BaseEnumModel + + SEGMENT = "segment".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/segment_response.rb b/lib/datadog_api_client/v2/models/segment_response.rb new file mode 100644 index 000000000000..7dbf2fa85016 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a segment. + class SegmentResponse + include BaseGenericModel + + # A segment. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SegmentData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_sort_column.rb b/lib/datadog_api_client/v2/models/segment_sort_column.rb new file mode 100644 index 000000000000..88489da8dc6d --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_sort_column.rb @@ -0,0 +1,34 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Column to sort segments by. + class SegmentSortColumn + include BaseEnumModel + + NAME = "name".freeze + DESCRIPTION = "description".freeze + CREATED_BY = "created_by".freeze + CREATED_AT = "created_at".freeze + MODIFIED_BY = "modified_by".freeze + MODIFIED_AT = "modified_at".freeze + DISABLED_BY = "disabled_by".freeze + DISABLED_AT = "disabled_at".freeze + UUID = "uuid".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/segment_static_block.rb b/lib/datadog_api_client/v2/models/segment_static_block.rb new file mode 100644 index 000000000000..fd6e347a4db3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_static_block.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A fixed list of users uploaded to Datadog. + class SegmentStaticBlock + include BaseGenericModel + + # ID of the uploaded list. + attr_accessor :id + + # Name of the block, used in `combination`. + attr_accessor :name + + # Number of users in the list. + attr_reader :user_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'user_count' => :'user_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'user_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentStaticBlock` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'user_count') + self.user_count = attributes[:'user_count'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@user_count.nil? && @user_count < 0 + true + end + + # Custom attribute writer method with validation + # @param user_count [Object] Object to be assigned + # @!visibility private + def user_count=(user_count) + if !user_count.nil? && user_count < 0 + fail ArgumentError, 'invalid value for "user_count", must be greater than or equal to 0.' + end + @user_count = user_count + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + user_count == o.user_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, name, user_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_summary_attributes.rb b/lib/datadog_api_client/v2/models/segment_summary_attributes.rb new file mode 100644 index 000000000000..10c92fd6f353 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_summary_attributes.rb @@ -0,0 +1,265 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a segment in a list. The segment definition is not included. + class SegmentSummaryAttributes + include BaseGenericModel + + # Time the segment was created. + attr_reader :created_at + + # A Datadog user who created, modified, or disabled a segment. + attr_accessor :created_by + + # Description of the segment. + attr_accessor :description + + # Kind of entity that the segment contains, `user` or `account`. + attr_accessor :entity + + # Time the segment was last modified. + attr_reader :modified_at + + # A Datadog user who created, modified, or disabled a segment. + attr_accessor :modified_by + + # Name of the segment. + attr_reader :name + + # ID of the organization that owns the segment. + attr_accessor :org_id + + # Number of entities in the segment when its membership was last computed. `-1` when the count is not available yet. + attr_accessor :row_count + + # Who created the segment. `0` for a user and `1` for Datadog. + attr_accessor :source + + # Tags of the segment. + attr_accessor :tags + + # Kind of segment, derived from its blocks. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'created_by' => :'SegmentUser', + :'description' => :'String', + :'entity' => :'String', + :'modified_at' => :'Time', + :'modified_by' => :'SegmentUser', + :'name' => :'String', + :'org_id' => :'Integer', + :'row_count' => :'Integer', + :'source' => :'Integer', + :'tags' => :'Array', + :'type' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'tags', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentSummaryAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'entity') + self.entity = attributes[:'entity'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'modified_by') + self.modified_by = attributes[:'modified_by'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'row_count') + self.row_count = attributes[:'row_count'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @modified_at.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + created_by == o.created_by && + description == o.description && + entity == o.entity && + modified_at == o.modified_at && + modified_by == o.modified_by && + name == o.name && + org_id == o.org_id && + row_count == o.row_count && + source == o.source && + tags == o.tags && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, created_by, description, entity, modified_at, modified_by, name, org_id, row_count, source, tags, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_summary_data.rb b/lib/datadog_api_client/v2/models/segment_summary_data.rb new file mode 100644 index 000000000000..5868ad2ef9dc --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_summary_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A segment in a list. + class SegmentSummaryData + include BaseGenericModel + + # Attributes of a segment in a list. The segment definition is not included. + attr_reader :attributes + + # ID of the segment. + attr_reader :id + + # Segment resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SegmentSummaryAttributes', + :'id' => :'String', + :'type' => :'SegmentResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentSummaryData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_template_block.rb b/lib/datadog_api_client/v2/models/segment_template_block.rb new file mode 100644 index 000000000000..7d1577a44b43 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_template_block.rb @@ -0,0 +1,174 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Selects users or accounts with a segment template. + class SegmentTemplateBlock + include BaseGenericModel + + # Start of the time range, in epoch milliseconds. + attr_accessor :from + + # Name of the block, used in `combination`. + attr_accessor :name + + # Template parameter values, keyed by parameter name. + attr_reader :parameters + + # ID of the segment template, such as `time-spent-v1`. + attr_reader :template_id + + # End of the time range, in epoch milliseconds. + attr_accessor :to + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'from' => :'from', + :'name' => :'name', + :'parameters' => :'parameters', + :'template_id' => :'template_id', + :'to' => :'to' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'from' => :'String', + :'name' => :'String', + :'parameters' => :'Hash', + :'template_id' => :'String', + :'to' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentTemplateBlock` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'parameters') + self.parameters = attributes[:'parameters'] + end + + if attributes.key?(:'template_id') + self.template_id = attributes[:'template_id'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @parameters.nil? + return false if @template_id.nil? + true + end + + # Custom attribute writer method with validation + # @param parameters [Object] Object to be assigned + # @!visibility private + def parameters=(parameters) + if parameters.nil? + fail ArgumentError, 'invalid value for "parameters", parameters cannot be nil.' + end + @parameters = parameters + end + + # Custom attribute writer method with validation + # @param template_id [Object] Object to be assigned + # @!visibility private + def template_id=(template_id) + if template_id.nil? + fail ArgumentError, 'invalid value for "template_id", template_id cannot be nil.' + end + @template_id = template_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + from == o.from && + name == o.name && + parameters == o.parameters && + template_id == o.template_id && + to == o.to && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [from, name, parameters, template_id, to, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_update_attributes.rb b/lib/datadog_api_client/v2/models/segment_update_attributes.rb new file mode 100644 index 000000000000..e306f7b58813 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_update_attributes.rb @@ -0,0 +1,138 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes to update on a segment. Fields that are not set are left unchanged. + class SegmentUpdateAttributes + include BaseGenericModel + + # 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`. + attr_accessor :data_query + + # Description of the segment. + attr_accessor :description + + # Name of the segment. It must be unique in the organization. + attr_accessor :name + + # Tags of the segment. Replaces the stored tags. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_query' => :'data_query', + :'description' => :'description', + :'name' => :'name', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_query' => :'SegmentDataQuery', + :'description' => :'String', + :'name' => :'String', + :'tags' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data_query') + self.data_query = attributes[:'data_query'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data_query == o.data_query && + description == o.description && + name == o.name && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_query, description, name, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_update_data.rb b/lib/datadog_api_client/v2/models/segment_update_data.rb new file mode 100644 index 000000000000..25efce5ab5de --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_update_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the segment update. + class SegmentUpdateData + include BaseGenericModel + + # Attributes to update on a segment. Fields that are not set are left unchanged. + attr_reader :attributes + + # ID of the segment. It must match the ID in the path. + attr_reader :id + + # Segment resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SegmentUpdateAttributes', + :'id' => :'String', + :'type' => :'SegmentResourceType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_update_request.rb b/lib/datadog_api_client/v2/models/segment_update_request.rb new file mode 100644 index 000000000000..fb7ca4d34554 --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to update a segment. + class SegmentUpdateRequest + include BaseGenericModel + + # Data of the segment update. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SegmentUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segment_user.rb b/lib/datadog_api_client/v2/models/segment_user.rb new file mode 100644 index 000000000000..316b73fd5b5d --- /dev/null +++ b/lib/datadog_api_client/v2/models/segment_user.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A Datadog user who created, modified, or disabled a segment. + class SegmentUser + include BaseGenericModel + + # Handle of the user. + attr_accessor :handle + + # URL of the user avatar. + attr_accessor :icon + + # Numeric ID of the user, as a string. + attr_accessor :id + + # Name of the user. + attr_accessor :name + + # UUID of the user. + attr_accessor :uuid + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'handle' => :'handle', + :'icon' => :'icon', + :'id' => :'id', + :'name' => :'name', + :'uuid' => :'uuid' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'handle' => :'String', + :'icon' => :'String', + :'id' => :'String', + :'name' => :'String', + :'uuid' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentUser` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'handle') + self.handle = attributes[:'handle'] + end + + if attributes.key?(:'icon') + self.icon = attributes[:'icon'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'uuid') + self.uuid = attributes[:'uuid'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + handle == o.handle && + icon == o.icon && + id == o.id && + name == o.name && + uuid == o.uuid && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [handle, icon, id, name, uuid, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/segments_response.rb b/lib/datadog_api_client/v2/models/segments_response.rb new file mode 100644 index 000000000000..29d5ae523abf --- /dev/null +++ b/lib/datadog_api_client/v2/models/segments_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of segments. + class SegmentsResponse + include BaseGenericModel + + # The segments. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SegmentsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end