From 3a23341103ccebc682c3c4cd77fef5055bf0f638 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 23 Oct 2026 22:35:59 +0000 Subject: [PATCH] Regenerate client from commit 5478fa1 of spec repo --- .generator/schemas/v2/openapi.yaml | 1443 ++++++++++++++- .../ArchiveExperimentProtocol.java | 41 + .../experiments/CreateExperimentProtocol.java | 39 + .../experiments/DeleteExperimentProtocol.java | 38 + .../v2/experiments/GetExperimentProtocol.java | 11 +- .../experiments/ListExperimentProtocols.java | 15 +- .../experiments/PatchExperimentProtocol.java | 49 + .../PublishExperimentProtocol.java | 36 + .../ReplaceExperimentProtocol.java | 70 + .../api/client/v2/api/ExperimentsApi.java | 1544 ++++++++++++++--- ...imentsCreateExperimentProtocolRequest.java | 154 ++ ...tsCreateExperimentProtocolRequestData.java | 193 +++ ...perimentProtocolRequestDataAttributes.java | 249 +++ ...rimentsPatchExperimentProtocolRequest.java | 156 ++ ...ntsPatchExperimentProtocolRequestData.java | 218 +++ ...perimentProtocolRequestDataAttributes.java | 1123 ++++++++++++ ...rimentsPatchProtocolAnalysisPlanInput.java | 286 +++ ...erimentsPatchProtocolEnforcementInput.java | 725 ++++++++ ...ntsPatchProtocolExposureScheduleInput.java | 342 ++++ .../ExperimentsProtocolAnalysisPlanInput.java | 274 +++ .../ExperimentsProtocolConditionInput.java | 287 +++ ...erimentsProtocolExposureScheduleInput.java | 318 ++++ .../ExperimentsProtocolExposureStepInput.java | 275 +++ .../ExperimentsProtocolMetricGroupInput.java | 220 +++ .../model/ExperimentsProtocolMetricInput.java | 149 ++ ...ExperimentsProtocolTargetingRuleInput.java | 166 ++ ...licProtocolListResponseDataAttributes.java | 36 +- ...sPublicProtocolResponseDataAttributes.java | 93 +- ...ocolResponseDataAttributesEnforcement.java | 6 +- ...mentsReplaceExperimentProtocolRequest.java | 158 ++ ...sReplaceExperimentProtocolRequestData.java | 224 +++ ...perimentProtocolRequestDataAttributes.java | 954 ++++++++++ ...imentsReplaceProtocolEnforcementInput.java | 597 +++++++ .../api/client/v2/api/experiments.feature | 230 ++- .../com/datadog/api/client/v2/api/given.json | 40 + .../com/datadog/api/client/v2/api/undo.json | 57 + .../test-runner-data/manifest.json | 49 + ...periment-protocol-returns-ok-response.json | 51 + ...ent-protocol-returns-created-response.json | 34 + ...-protocol-returns-no-content-response.json | 51 + ...periment-protocol-returns-ok-response.json | 35 + ...eriment-protocols-returns-ok-response.json | 42 +- ...periment-protocol-returns-ok-response.json | 35 + ...periment-protocol-returns-ok-response.json | 73 + ...periment-protocol-returns-ok-response.json | 51 + .../test-server-data/v2/experiments.json | 1181 +++++++++++-- 46 files changed, 12072 insertions(+), 346 deletions(-) create mode 100644 examples/v2/experiments/ArchiveExperimentProtocol.java create mode 100644 examples/v2/experiments/CreateExperimentProtocol.java create mode 100644 examples/v2/experiments/DeleteExperimentProtocol.java create mode 100644 examples/v2/experiments/PatchExperimentProtocol.java create mode 100644 examples/v2/experiments/PublishExperimentProtocol.java create mode 100644 examples/v2/experiments/ReplaceExperimentProtocol.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchExperimentProtocolRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchExperimentProtocolRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchExperimentProtocolRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchProtocolAnalysisPlanInput.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchProtocolEnforcementInput.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchProtocolExposureScheduleInput.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolAnalysisPlanInput.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolConditionInput.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolExposureScheduleInput.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolExposureStepInput.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolMetricGroupInput.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolMetricInput.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolTargetingRuleInput.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceExperimentProtocolRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceExperimentProtocolRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceExperimentProtocolRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceProtocolEnforcementInput.java create mode 100644 src/test/resources/generated-test/test-runner-data/v2/experiments/archive-experiment-protocol-returns-ok-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/experiments/create-experiment-protocol-returns-created-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/experiments/delete-experiment-protocol-returns-no-content-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/experiments/get-experiment-protocol-returns-ok-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/experiments/publish-experiment-protocol-returns-ok-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/experiments/replace-experiment-protocol-returns-ok-response.json create mode 100644 src/test/resources/generated-test/test-runner-data/v2/experiments/update-experiment-protocol-returns-ok-response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c892a380ecc..a05d136ff76 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -42535,6 +42535,48 @@ components: required: - metric_id type: object + ExperimentsCreateExperimentProtocolRequest: + description: Create a draft protocol with the organization default subject type. + properties: + data: + $ref: "#/components/schemas/ExperimentsCreateExperimentProtocolRequestData" + required: + - data + type: object + ExperimentsCreateExperimentProtocolRequestData: + description: JSON:API protocol request resource. + properties: + attributes: + $ref: "#/components/schemas/ExperimentsCreateExperimentProtocolRequestDataAttributes" + type: + $ref: "#/components/schemas/ExperimentsPublicProtocolResponseDataType" + required: + - type + - attributes + type: object + ExperimentsCreateExperimentProtocolRequestDataAttributes: + description: Create a draft protocol with the organization default subject type. + properties: + description: + description: Optional text that explains the protocol. + nullable: true + type: string + migration_metadata: + additionalProperties: {} + description: >- + Metadata for imported resources. Must encode to at most 4096 bytes. Null clears it; omission preserves it on update. + nullable: true + type: object + name: + description: >- + Protocol name. Leading and trailing spaces are removed. The trimmed name must contain 1 to 255 characters. + example: Checkout conversion + minLength: 1 + pattern: .*\S.* + type: string + required: + - name + type: object ExperimentsCreateExperimentV2Request: description: "Request to create an experiment draft." example: @@ -46188,6 +46230,148 @@ components: type: string x-enum-varnames: - EXPERIMENT_METRIC_GROUPS + ExperimentsPatchExperimentProtocolRequest: + description: >- + Partial protocol update. Omitted attributes remain unchanged. Published protocols accept only name, description, and migration_metadata; archived protocols reject updates. + properties: + data: + $ref: "#/components/schemas/ExperimentsPatchExperimentProtocolRequestData" + required: + - data + type: object + ExperimentsPatchExperimentProtocolRequestData: + description: JSON:API protocol request resource. + properties: + attributes: + $ref: "#/components/schemas/ExperimentsPatchExperimentProtocolRequestDataAttributes" + id: + description: Protocol ID. If supplied, must match the path protocol_id. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + type: + $ref: "#/components/schemas/ExperimentsPublicProtocolResponseDataType" + required: + - type + type: object + ExperimentsPatchExperimentProtocolRequestDataAttributes: + description: >- + Partial protocol update. Omitted attributes remain unchanged. Published protocols accept only name, description, and migration_metadata; archived protocols reject updates. + properties: + analysis_plan: + $ref: "#/components/schemas/ExperimentsPatchProtocolAnalysisPlanInput" + assignment_source_default_properties: + description: Assignment properties. Omission or null preserves them; an array replaces them. + items: + $ref: >- + #/components/schemas/ExperimentsPublicProtocolResponseDataAttributesAssignmentSourceDefaultPropertiesItems + nullable: true + type: array + assignment_source_id: + description: >- + ID of the assignment source selected by the protocol. Omission or null keeps the current value. An empty string clears it. + nullable: true + pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})?$ + type: string + default_duration_days: + description: >- + Default experiment duration supplied by the protocol, in days. Omission preserves it; null clears it. Sets analysis_plan.target_duration_days on experiments created from this protocol. + format: int64 + minimum: 0 + nullable: true + type: integer + description: + description: Description. Empty string clears it; omission or null preserves it. + nullable: true + type: string + enforcement: + $ref: "#/components/schemas/ExperimentsPatchProtocolEnforcementInput" + environment_id: + description: >- + ID of the feature flag environment used by the experiment. Omission or null keeps the current value. An empty string clears it. + nullable: true + pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})?$ + type: string + exposure_schedule: + $ref: "#/components/schemas/ExperimentsPatchProtocolExposureScheduleInput" + is_duration_required_to_start: + description: >- + Whether the protocol requires a duration before an experiment can start. Omission or null preserves it. + example: false + nullable: true + type: boolean + is_equal_split_enforced: + description: >- + Whether the protocol requires equal traffic allocation across variants. Omission or null preserves it. + example: false + nullable: true + type: boolean + is_metric_limit_enabled: + description: Whether the protocol limits the number of metrics. Omission or null preserves it. + example: false + nullable: true + type: boolean + is_minimum_duration_enabled: + description: Whether the protocol enforces a minimum experiment duration. Omission or null preserves it. + example: false + nullable: true + type: boolean + metric_groups: + description: Metric groups. Omission or null preserves them; an array replaces them. + items: + $ref: "#/components/schemas/ExperimentsProtocolMetricGroupInput" + nullable: true + type: array + metric_limit: + description: Maximum number of metrics allowed by the protocol. Omission preserves it; null clears it. + format: int64 + minimum: 0 + nullable: true + type: integer + migration_metadata: + additionalProperties: {} + description: >- + Metadata for imported resources. Must encode to at most 4096 bytes. Null clears it; omission preserves it on update. + nullable: true + type: object + minimum_duration_unit: + description: Minimum duration unit, `DAYS` or `WEEKS`. Empty string clears it. Omission or null preserves it. + nullable: true + pattern: ^(DAYS|WEEKS)?$ + type: string + minimum_duration_value: + description: Minimum experiment duration in the specified unit. Omission preserves it; null clears it. + format: int64 + minimum: 0 + nullable: true + type: integer + name: + description: >- + Protocol name. Leading and trailing spaces are removed. The trimmed name must contain 1 to 255 characters. + example: Checkout conversion + minLength: 1 + nullable: true + pattern: .*\S.* + type: string + primary_metric_id: + description: >- + ID of the primary metric supplied by the protocol. Omission or null keeps the current value. An empty string clears it. + nullable: true + pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})?$ + type: string + subject_type_id: + description: >- + ID of the subject type used by this configuration. Omission or null keeps the current value. An empty string clears it. + nullable: true + pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})?$ + type: string + targeting_rules: + description: Targeting rules. Omission or null preserves them; an array replaces them. + items: + $ref: "#/components/schemas/ExperimentsProtocolTargetingRuleInput" + nullable: true + type: array + type: object ExperimentsPatchExperimentV2MetaDTO: description: "Refresh requirements and warnings returned by an experiment update." properties: @@ -46993,6 +47177,144 @@ components: type: string x-enum-varnames: - METRIC_COLLECTIONS + ExperimentsPatchProtocolAnalysisPlanInput: + description: >- + Partial statistical settings. Omitted fields remain unchanged. Null clears the whole plan. Null clears nullable fields; null or an empty string clears confidence_interval_method. + nullable: true + properties: + compute_cuped: + description: Whether to use pre-experiment data to reduce variance with CUPED. + nullable: true + type: boolean + confidence_interval_method: + description: >- + Confidence interval method: `Sequential`, `FixedSample`, `Bayesian`, or `SequentialFixedHybrid`. An empty string leaves the method unset. + nullable: true + pattern: ^(Sequential|FixedSample|Bayesian|SequentialFixedHybrid)?$ + type: string + confidence_level: + description: Confidence level used by the statistical analysis. + format: double + maximum: 1 + minimum: 0 + nullable: true + type: number + multiple_testing_correction_method: + description: Method used to adjust for testing multiple metrics. + nullable: true + type: string + type: object + ExperimentsPatchProtocolEnforcementInput: + description: >- + Partial lock map. Omitted fields remain unchanged. Null clears the whole map. Empty or null field values become `EDITABLE`, except `subject_type`, `flag_source`, and `confidence_interval_method`, which remain `LOCKED`. + nullable: true + properties: + confidence_interval_method: + description: Always `LOCKED`. The server keeps this setting locked regardless of the supplied value. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + confidence_level: + description: LOCKED prevents changes to confidence level. EDITABLE permits changes. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + cuped_calculation: + description: LOCKED prevents changes to CUPED variance reduction. EDITABLE permits changes. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + default_duration: + description: LOCKED prevents changes to default duration. EDITABLE permits changes. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + environment: + description: LOCKED prevents changes to environment. EDITABLE permits changes. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + flag_source: + description: Always LOCKED. The server keeps this setting locked regardless of the supplied value. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + multiple_testing_correction: + description: LOCKED prevents changes to multiple testing correction. EDITABLE permits changes. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + notifications: + description: LOCKED prevents changes to notifications. EDITABLE permits changes. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + primary_metric: + description: LOCKED prevents changes to primary metric. EDITABLE permits changes. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + secondary_metrics: + description: LOCKED prevents changes to secondary metrics. EDITABLE permits changes. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + split_by_exploration_dimensions: + description: LOCKED prevents changes to result exploration dimensions. EDITABLE permits changes. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + subject_type: + description: Always LOCKED. The server keeps this setting locked regardless of the supplied value. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + targeting_rules: + description: LOCKED prevents changes to targeting rules. EDITABLE permits changes. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + traffic_exposure: + description: LOCKED prevents changes to traffic exposure. EDITABLE permits changes. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + warehouse_exposure_source: + description: LOCKED prevents changes to warehouse exposure source. EDITABLE permits changes. + nullable: true + pattern: ^(LOCKED|EDITABLE)?$ + type: string + type: object + ExperimentsPatchProtocolExposureScheduleInput: + description: >- + Partial traffic schedule. Omitted fields remain unchanged. Null clears the whole schedule. Null clears nullable fields and rollout_steps; null sets strategy to an empty string and `autostart` to false. + nullable: true + properties: + autostart: + description: Whether the exposure schedule starts automatically. + nullable: true + type: boolean + guardrail_triggered_action: + description: Action taken when a guardrail triggers during the exposure schedule. + nullable: true + type: string + rollout_steps: + description: Rollout steps, replaced when supplied. + items: + $ref: "#/components/schemas/ExperimentsProtocolExposureStepInput" + nullable: true + type: array + selection_interval_ms: + description: Interval between traffic selections, in milliseconds. + format: int64 + minimum: 0 + nullable: true + type: integer + strategy: + description: Method used to increase traffic exposure over the schedule. + nullable: true + type: string + type: object ExperimentsPatchSubjectTypeV2Request: description: "Request to update the subject type." example: @@ -47156,6 +47478,156 @@ components: x-enum-varnames: - IS_NULL - IS_NOT_NULL + ExperimentsProtocolAnalysisPlanInput: + description: >- + Statistical settings. Use `default_duration_days` for duration; `target_duration_days` is not accepted here. + nullable: true + properties: + compute_cuped: + description: Whether to use pre-experiment data to reduce variance with CUPED. + nullable: true + type: boolean + confidence_interval_method: + description: >- + Confidence interval method: `Sequential`, `FixedSample`, `Bayesian`, or `SequentialFixedHybrid`. An empty string leaves the method unset. + pattern: ^(Sequential|FixedSample|Bayesian|SequentialFixedHybrid)?$ + type: string + confidence_level: + description: Confidence level used by the statistical analysis. + format: double + maximum: 1 + minimum: 0 + nullable: true + type: number + multiple_testing_correction_method: + description: Method used to adjust for testing multiple metrics. + nullable: true + type: string + type: object + ExperimentsProtocolConditionInput: + description: >- + Protocol targeting condition. Publishing and replacement require a saved filter or a valid inline attribute, operator, and values. + properties: + attribute: + description: Subject attribute evaluated by the targeting condition. + type: string + operator: + description: Comparison applied to the subject attribute. + type: string + order_position: + description: Position of this entry in the ordered configuration. + format: int64 + minimum: 0 + type: integer + saved_filter_id: + description: >- + Saved filter UUID. Null selects an inline condition. An empty string skips the saved-filter lookup. + nullable: true + pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})?$ + type: string + value: + description: Values compared with the subject attribute in this condition. + items: + description: One value compared with the subject attribute. + type: string + nullable: true + type: array + type: object + ExperimentsProtocolExposureScheduleInput: + description: >- + Traffic schedule. Publishing and replacement require `NO_ROLLOUT` with exactly one step, or `UNIFORM_INTERVALS` with a positive selection interval and at least one step. Requires `environment_id`. + nullable: true + properties: + autostart: + description: Whether the exposure schedule starts automatically. + type: boolean + guardrail_triggered_action: + description: Action taken when a guardrail triggers during the exposure schedule. + nullable: true + type: string + rollout_steps: + description: Rollout steps, replaced when supplied. + items: + $ref: "#/components/schemas/ExperimentsProtocolExposureStepInput" + nullable: true + type: array + selection_interval_ms: + description: Interval between traffic selections, in milliseconds. + format: int64 + minimum: 0 + nullable: true + type: integer + strategy: + description: Method used to increase traffic exposure over the schedule. + type: string + type: object + ExperimentsProtocolExposureStepInput: + description: A traffic exposure step in the protocol template. + properties: + exposure_ratio: + description: Fraction of traffic exposed during this rollout step. + format: double + maximum: 1 + minimum: 0 + type: number + grouped_step_index: + description: Index of the group that contains this rollout step. + format: int64 + minimum: 0 + nullable: true + type: integer + interval_ms: + description: Duration of this rollout step, in milliseconds. + format: int64 + minimum: 0 + nullable: true + type: integer + is_pause_record: + description: Whether this schedule entry represents a pause. + type: boolean + order_position: + description: Position of this entry in the ordered configuration. + format: int64 + minimum: 0 + type: integer + type: object + ExperimentsProtocolMetricGroupInput: + description: A metric group supplied by the protocol. Empty decision groups are removed. + properties: + is_decision: + description: Whether this group contains decision metrics. + type: boolean + metrics: + description: Metrics in the group. + items: + $ref: "#/components/schemas/ExperimentsProtocolMetricInput" + nullable: true + type: array + name: + description: Metric group name. + type: string + type: object + ExperimentsProtocolMetricInput: + description: A metric included in a protocol. Select the primary metric with `primary_metric_id`, not `is_primary`. + properties: + metric_id: + description: Metric UUID. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + required: + - metric_id + type: object + ExperimentsProtocolTargetingRuleInput: + description: A targeting rule in the protocol template. + properties: + conditions: + description: Conditions in this rule. + items: + $ref: "#/components/schemas/ExperimentsProtocolConditionInput" + nullable: true + type: array + type: object ExperimentsPublicProtocolListResponseArray: description: "List of protocol resources with pagination information." properties: @@ -47194,6 +47666,13 @@ components: description: description: "Text that explains the protocol." type: string + experiment_count: + description: >- + Number of experiments in the organization that use this protocol, excluding deleted experiments. + example: 0 + format: int64 + minimum: 0 + type: integer name: description: "Display name of the protocol." example: Checkout conversion @@ -47211,10 +47690,13 @@ components: description: "ID of the subject type used by this configuration." type: string updated_at: - description: "RFC3339 update time. Preserve all fractional seconds when passing this value as expected_updated_at." + description: |- + RFC3339 update time. Preserve all fractional seconds when passing this value as + `expected_updated_at`. example: "2026-01-01T00:00:00Z" type: string required: + - experiment_count - name - status - updated_at @@ -47248,6 +47730,11 @@ components: properties: analysis_plan: $ref: "#/components/schemas/ExperimentsPublicProtocolResponseDataAttributesAnalysisPlan" + archived_at: + description: "Time when the protocol was archived. Omitted if it has not been archived." + example: "2026-07-31T14:00:00Z" + format: date-time + type: string assignment_source_default_properties: description: "Default properties supplied by the protocol's assignment source." items: @@ -47257,6 +47744,11 @@ components: assignment_source_id: description: "ID of the assignment source selected by the protocol." type: string + created_at: + description: "Time when the protocol was created." + example: "2026-07-31T12:00:00Z" + format: date-time + type: string default_duration_days: description: "Default experiment duration supplied by the protocol, in days." format: int64 @@ -47269,6 +47761,13 @@ components: environment_id: description: "ID of the feature flag environment used by the experiment." type: string + experiment_count: + description: >- + Number of experiments in the organization that use this protocol, excluding deleted experiments. Omitted if the count cannot be retrieved. An omitted count does not mean zero. + example: 0 + format: int64 + minimum: 0 + type: integer exposure_schedule: $ref: "#/components/schemas/ExperimentsPublicProtocolResponseDataAttributesExposureSchedule" is_duration_required_to_start: @@ -47332,10 +47831,13 @@ components: $ref: "#/components/schemas/ExperimentsPublicProtocolResponseDataAttributesTargetingRulesItems" type: array updated_at: - description: "RFC3339 update time. Preserve all fractional seconds when passing this value as expected_updated_at." + description: |- + RFC3339 update time. Preserve all fractional seconds when passing this value as + `expected_updated_at`. example: "2026-01-01T00:00:00Z" type: string required: + - created_at - is_duration_required_to_start - is_equal_split_enforced - is_metric_limit_enabled @@ -47379,7 +47881,7 @@ components: description: "Controls that determine which protocol settings can be changed in an experiment." properties: confidence_interval_method: - description: "LOCKED prevents changes to confidence interval method. EDITABLE permits changes." + description: "Always LOCKED. The server keeps this setting locked regardless of the supplied value." type: string confidence_level: description: "LOCKED prevents changes to confidence level. EDITABLE permits changes." @@ -47394,7 +47896,7 @@ components: description: "LOCKED prevents changes to environment. EDITABLE permits changes." type: string flag_source: - description: "LOCKED prevents changes to feature flag source. EDITABLE permits changes." + description: "Always LOCKED. The server keeps this setting locked regardless of the supplied value." type: string multiple_testing_correction: description: "LOCKED prevents changes to multiple testing correction. EDITABLE permits changes." @@ -47412,7 +47914,7 @@ components: description: "LOCKED prevents changes to result exploration dimensions. EDITABLE permits changes." type: string subject_type: - description: "LOCKED prevents changes to subject type. EDITABLE permits changes." + description: "Always LOCKED. The server keeps this setting locked regardless of the supplied value." type: string targeting_rules: description: "LOCKED prevents changes to targeting rules. EDITABLE permits changes." @@ -47641,6 +48143,230 @@ components: type: string x-enum-varnames: - EXPERIMENT_RESULTS_REFRESH + ExperimentsReplaceExperimentProtocolRequest: + description: >- + Replace a published protocol template. Omitted optional template fields are cleared. Omitted enforcement and migration_metadata are preserved. Enabled limits require their values; allocation settings require environment_id. + properties: + data: + $ref: "#/components/schemas/ExperimentsReplaceExperimentProtocolRequestData" + required: + - data + type: object + ExperimentsReplaceExperimentProtocolRequestData: + description: JSON:API protocol request resource. + properties: + attributes: + $ref: "#/components/schemas/ExperimentsReplaceExperimentProtocolRequestDataAttributes" + id: + description: Protocol ID. If supplied, must match the path protocol_id. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + type: + $ref: "#/components/schemas/ExperimentsPublicProtocolResponseDataType" + required: + - type + - attributes + type: object + ExperimentsReplaceExperimentProtocolRequestDataAttributes: + description: >- + Replace a published protocol template. Omitted optional template fields are cleared. Omitted enforcement and migration_metadata are preserved. Enabled limits require their values; allocation settings require environment_id. + properties: + analysis_plan: + $ref: "#/components/schemas/ExperimentsProtocolAnalysisPlanInput" + assignment_source_default_properties: + description: Assignment properties. + items: + $ref: >- + #/components/schemas/ExperimentsPublicProtocolResponseDataAttributesAssignmentSourceDefaultPropertiesItems + type: array + assignment_source_id: + description: ID of the assignment source selected by the protocol. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + nullable: true + type: string + default_duration_days: + description: Default experiment duration supplied by the protocol, in days. + format: int64 + minimum: 0 + nullable: true + type: integer + enforcement: + $ref: "#/components/schemas/ExperimentsReplaceProtocolEnforcementInput" + environment_id: + description: ID of the feature flag environment used by the experiment. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + nullable: true + type: string + exposure_schedule: + $ref: "#/components/schemas/ExperimentsProtocolExposureScheduleInput" + is_duration_required_to_start: + description: Whether the protocol requires a duration before an experiment can start. + example: false + type: boolean + is_equal_split_enforced: + description: Whether the protocol requires equal traffic allocation across variants. + example: false + type: boolean + is_metric_limit_enabled: + description: Whether the protocol limits the number of metrics. + example: false + type: boolean + is_minimum_duration_enabled: + description: Whether the protocol enforces a minimum experiment duration. + example: false + type: boolean + metric_groups: + description: Metric groups. + example: [] + items: + $ref: "#/components/schemas/ExperimentsProtocolMetricGroupInput" + type: array + metric_limit: + description: Maximum number of metrics allowed by the protocol. + format: int64 + minimum: 0 + nullable: true + type: integer + migration_metadata: + additionalProperties: {} + description: >- + Metadata for imported resources. Must encode to at most 4096 bytes. Null clears it; omission preserves it on update. + nullable: true + type: object + minimum_duration_unit: + description: Minimum duration unit, DAYS or WEEKS. + nullable: true + pattern: ^(DAYS|WEEKS)$ + type: string + minimum_duration_value: + description: Minimum experiment duration in the specified unit. + format: int64 + minimum: 0 + nullable: true + type: integer + primary_metric_id: + description: ID of the primary metric supplied by the protocol. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + nullable: true + type: string + subject_type_id: + description: ID of the subject type used by this configuration. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + targeting_rules: + description: Targeting rules. + items: + $ref: "#/components/schemas/ExperimentsProtocolTargetingRuleInput" + type: array + required: + - subject_type_id + - is_equal_split_enforced + - is_minimum_duration_enabled + - is_duration_required_to_start + - is_metric_limit_enabled + - metric_groups + type: object + ExperimentsReplaceProtocolEnforcementInput: + description: >- + Complete lock map. Omit this object to preserve current locks. Null is rejected; every field is required. + properties: + confidence_interval_method: + description: Always LOCKED. The server keeps this setting locked regardless of the supplied value. + example: LOCKED + pattern: ^(LOCKED|EDITABLE)$ + type: string + confidence_level: + description: LOCKED prevents changes to confidence level. EDITABLE permits changes. + example: EDITABLE + pattern: ^(LOCKED|EDITABLE)$ + type: string + cuped_calculation: + description: LOCKED prevents changes to CUPED variance reduction. EDITABLE permits changes. + example: EDITABLE + pattern: ^(LOCKED|EDITABLE)$ + type: string + default_duration: + description: LOCKED prevents changes to default duration. EDITABLE permits changes. + example: EDITABLE + pattern: ^(LOCKED|EDITABLE)$ + type: string + environment: + description: LOCKED prevents changes to environment. EDITABLE permits changes. + example: EDITABLE + pattern: ^(LOCKED|EDITABLE)$ + type: string + flag_source: + description: Always LOCKED. The server keeps this setting locked regardless of the supplied value. + example: LOCKED + pattern: ^(LOCKED|EDITABLE)$ + type: string + multiple_testing_correction: + description: LOCKED prevents changes to multiple testing correction. EDITABLE permits changes. + example: EDITABLE + pattern: ^(LOCKED|EDITABLE)$ + type: string + notifications: + description: LOCKED prevents changes to notifications. EDITABLE permits changes. + example: EDITABLE + pattern: ^(LOCKED|EDITABLE)$ + type: string + primary_metric: + description: LOCKED prevents changes to primary metric. EDITABLE permits changes. + example: EDITABLE + pattern: ^(LOCKED|EDITABLE)$ + type: string + secondary_metrics: + description: LOCKED prevents changes to secondary metrics. EDITABLE permits changes. + example: EDITABLE + pattern: ^(LOCKED|EDITABLE)$ + type: string + split_by_exploration_dimensions: + description: LOCKED prevents changes to result exploration dimensions. EDITABLE permits changes. + example: EDITABLE + pattern: ^(LOCKED|EDITABLE)$ + type: string + subject_type: + description: Always LOCKED. The server keeps this setting locked regardless of the supplied value. + example: LOCKED + pattern: ^(LOCKED|EDITABLE)$ + type: string + targeting_rules: + description: LOCKED prevents changes to targeting rules. EDITABLE permits changes. + example: EDITABLE + pattern: ^(LOCKED|EDITABLE)$ + type: string + traffic_exposure: + description: LOCKED prevents changes to traffic exposure. EDITABLE permits changes. + example: EDITABLE + pattern: ^(LOCKED|EDITABLE)$ + type: string + warehouse_exposure_source: + description: LOCKED prevents changes to warehouse exposure source. EDITABLE permits changes. + example: EDITABLE + pattern: ^(LOCKED|EDITABLE)$ + type: string + required: + - confidence_interval_method + - confidence_level + - cuped_calculation + - default_duration + - environment + - flag_source + - multiple_testing_correction + - notifications + - primary_metric + - secondary_metrics + - split_by_exploration_dimensions + - subject_type + - targeting_rules + - traffic_exposure + - warehouse_exposure_source + type: object ExperimentsSQLModelPropertyInput: description: A property column defined by an exposure SQL model. example: @@ -170321,7 +171047,14 @@ paths: examples: default: value: - data: [] + data: + - attributes: + experiment_count: 0 + name: Checkout protocol + status: DRAFT + updated_at: "2026-07-31T12:00:00Z" + id: e4d5f6a7-0000-0000-0000-000000000000 + type: protocols schema: $ref: "#/components/schemas/ExperimentsPublicProtocolListResponseArray" description: OK @@ -170357,7 +171090,193 @@ paths: operator: AND permissions: - product_analytics_experiments_read + post: + description: >- + Create a draft protocol with a name and optional description and migration metadata. The organization's default subject type is selected. Use PATCH to configure the draft, then publish it before creating experiments from it. + operationId: CreateExperimentProtocol + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Defaults for checkout experiments. + name: Checkout protocol + type: protocols + schema: + $ref: "#/components/schemas/ExperimentsCreateExperimentProtocolRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-07-31T12:00:00Z" + description: Defaults for checkout experiments. + enforcement: + confidence_interval_method: LOCKED + confidence_level: EDITABLE + cuped_calculation: EDITABLE + default_duration: EDITABLE + environment: EDITABLE + flag_source: LOCKED + multiple_testing_correction: EDITABLE + notifications: EDITABLE + primary_metric: EDITABLE + secondary_metrics: EDITABLE + split_by_exploration_dimensions: EDITABLE + subject_type: LOCKED + targeting_rules: EDITABLE + traffic_exposure: EDITABLE + warehouse_exposure_source: EDITABLE + experiment_count: 0 + is_duration_required_to_start: false + is_equal_split_enforced: false + is_metric_limit_enabled: false + is_minimum_duration_enabled: false + metric_groups: [] + name: Checkout protocol + status: DRAFT + subject_type: + id: c2b3d4e5-0000-0000-0000-000000000000 + name: User + subject_type_id: c2b3d4e5-0000-0000-0000-000000000000 + updated_at: "2026-07-31T12:00:00Z" + id: e4d5f6a7-0000-0000-0000-000000000000 + type: protocols + schema: + $ref: "#/components/schemas/ExperimentsPublicProtocolResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Invalid request or protocol settings. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Missing or invalid authentication. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: The caller lacks the product_analytics_experiments_write permission. + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: A protocol with this name already exists. + "415": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unsupported request content type. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - product_analytics_experiments_write + summary: Create experiment protocol + tags: + - Experiments + x-permission: + operator: AND + permissions: + - product_analytics_experiments_write /api/v2/experiments/protocols/{protocol_id}: + delete: + description: >- + Delete a protocol with no linked experiments. Draft, published, and archived protocols can be deleted. Returns 204 with no response body. + operationId: DeleteExperimentProtocol + parameters: + - description: The UUID of the protocol. + in: path + name: protocol_id + required: true + schema: + description: The UUID of the protocol. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + - description: >- + The updated_at value from the last read. Include the full timestamp, with fractional seconds. Returns 409 if another write changed the protocol. Omit to skip this check. + in: query + name: expected_updated_at + schema: + type: string + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Invalid request or protocol settings. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Missing or invalid authentication. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: The caller lacks the product_analytics_experiments_write permission. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: No protocol with this ID exists in the organization. + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: The protocol has linked experiments or expected_updated_at is stale. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - product_analytics_experiments_write + summary: Delete experiment protocol + tags: + - Experiments + x-permission: + operator: AND + permissions: + - product_analytics_experiments_write get: description: Get a draft, published, or archived experiment protocol by ID. operationId: GetExperimentProtocol @@ -170380,6 +171299,7 @@ paths: value: data: attributes: + created_at: "2026-07-31T12:00:00Z" description: Default settings for checkout experiments. enforcement: confidence_interval_method: LOCKED @@ -170397,6 +171317,7 @@ paths: targeting_rules: EDITABLE traffic_exposure: EDITABLE warehouse_exposure_source: EDITABLE + experiment_count: 0 is_duration_required_to_start: false is_equal_split_enforced: false is_metric_limit_enabled: false @@ -170457,6 +171378,516 @@ paths: operator: AND permissions: - product_analytics_experiments_read + patch: + description: >- + Update the supplied fields of a draft protocol. Published protocols accept only name, description, and migration_metadata changes through PATCH. Use PUT to replace their settings. Archived protocols cannot be edited. + + + Omitted fields keep their current values, including fields inside analysis_plan, exposure_schedule, and enforcement. Arrays replace the stored arrays. Supported null values clear fields; see the request schema. Use primary_metric_id to select the primary metric and default_duration_days to set the experiment analysis duration. Nested metric is_primary and analysis_plan.target_duration_days fields are rejected. + operationId: PatchExperimentProtocol + parameters: + - description: The UUID of the protocol. + in: path + name: protocol_id + required: true + schema: + description: The UUID of the protocol. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Updated defaults for checkout experiments. + type: protocols + schema: + $ref: "#/components/schemas/ExperimentsPatchExperimentProtocolRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-07-31T12:00:00Z" + description: Updated defaults for checkout experiments. + enforcement: + confidence_interval_method: LOCKED + confidence_level: EDITABLE + cuped_calculation: EDITABLE + default_duration: EDITABLE + environment: EDITABLE + flag_source: LOCKED + multiple_testing_correction: EDITABLE + notifications: EDITABLE + primary_metric: EDITABLE + secondary_metrics: EDITABLE + split_by_exploration_dimensions: EDITABLE + subject_type: LOCKED + targeting_rules: EDITABLE + traffic_exposure: EDITABLE + warehouse_exposure_source: EDITABLE + experiment_count: 0 + is_duration_required_to_start: false + is_equal_split_enforced: false + is_metric_limit_enabled: false + is_minimum_duration_enabled: false + metric_groups: [] + name: Checkout protocol + status: DRAFT + subject_type: + id: c2b3d4e5-0000-0000-0000-000000000000 + name: User + subject_type_id: c2b3d4e5-0000-0000-0000-000000000000 + updated_at: "2026-07-31T12:00:00Z" + id: e4d5f6a7-0000-0000-0000-000000000000 + type: protocols + schema: + $ref: "#/components/schemas/ExperimentsPublicProtocolResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Invalid request or protocol settings. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Missing or invalid authentication. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: The caller lacks the product_analytics_experiments_write permission. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: No protocol with this ID exists in the organization. + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: >- + The protocol is archived, a published protocol receives settings changes, or the name is already in use. + "415": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unsupported request content type. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - product_analytics_experiments_write + summary: Update experiment protocol + tags: + - Experiments + x-permission: + operator: AND + permissions: + - product_analytics_experiments_write + put: + description: >- + Replace the template of a published protocol. Draft and archived protocols return 409. Send subject_type_id, all four required boolean settings, and metric_groups. Omitted optional template fields are cleared. Omitted enforcement keeps the existing locks. + + + Use primary_metric_id to select the primary metric. Use default_duration_days to set target_duration_days on experiments created from the protocol. The nested metric is_primary and analysis_plan.target_duration_days fields are rejected. An unchanged GET response can be sent as the request body. Response-only fields are ignored. + + + Independent configuration errors are returned together in the JSON:API errors array. Each error identifies the field in source.pointer. Earlier request and reference checks can stop on the first error. A failed request leaves the protocol unchanged. Changes apply to future experiments; existing experiments keep their settings. + operationId: ReplaceExperimentProtocol + parameters: + - description: The UUID of the protocol. + in: path + name: protocol_id + required: true + schema: + description: The UUID of the protocol. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + - description: >- + The updated_at value from the last read. Include the full timestamp, with fractional seconds. Returns 409 if another write changed the protocol. Omit to skip this check. + in: query + name: expected_updated_at + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + is_duration_required_to_start: false + is_equal_split_enforced: false + is_metric_limit_enabled: false + is_minimum_duration_enabled: false + metric_groups: [] + subject_type_id: c2b3d4e5-0000-0000-0000-000000000000 + type: protocols + schema: + $ref: "#/components/schemas/ExperimentsReplaceExperimentProtocolRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-07-31T12:00:00Z" + description: Defaults for checkout experiments. + enforcement: + confidence_interval_method: LOCKED + confidence_level: EDITABLE + cuped_calculation: EDITABLE + default_duration: EDITABLE + environment: EDITABLE + flag_source: LOCKED + multiple_testing_correction: EDITABLE + notifications: EDITABLE + primary_metric: EDITABLE + secondary_metrics: EDITABLE + split_by_exploration_dimensions: EDITABLE + subject_type: LOCKED + targeting_rules: EDITABLE + traffic_exposure: EDITABLE + warehouse_exposure_source: EDITABLE + experiment_count: 0 + is_duration_required_to_start: false + is_equal_split_enforced: false + is_metric_limit_enabled: false + is_minimum_duration_enabled: false + metric_groups: [] + name: Checkout protocol + published_at: "2026-07-31T12:00:00Z" + status: PUBLISHED + subject_type: + id: c2b3d4e5-0000-0000-0000-000000000000 + name: User + subject_type_id: c2b3d4e5-0000-0000-0000-000000000000 + updated_at: "2026-07-31T12:00:00Z" + id: e4d5f6a7-0000-0000-0000-000000000000 + type: protocols + schema: + $ref: "#/components/schemas/ExperimentsPublicProtocolResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Invalid request or protocol settings. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Missing or invalid authentication. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: The caller lacks the product_analytics_experiments_write permission. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: No protocol with this ID exists in the organization. + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: The protocol is not published or expected_updated_at is stale. + "415": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unsupported request content type. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - product_analytics_experiments_write + summary: Replace experiment protocol + tags: + - Experiments + x-permission: + operator: AND + permissions: + - product_analytics_experiments_write + /api/v2/experiments/protocols/{protocol_id}/archive: + post: + description: >- + Archive a draft or published protocol. Archived protocols cannot be edited or used to create new experiments. Existing experiments keep their settings. Archiving an already archived protocol returns 409. + operationId: ArchiveExperimentProtocol + parameters: + - description: The UUID of the protocol. + in: path + name: protocol_id + required: true + schema: + description: The UUID of the protocol. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + - description: >- + The updated_at value from the last read. Include the full timestamp, with fractional seconds. Returns 409 if another write changed the protocol. Omit to skip this check. + in: query + name: expected_updated_at + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + archived_at: "2026-07-31T14:00:00Z" + created_at: "2026-07-31T12:00:00Z" + description: Defaults for checkout experiments. + enforcement: + confidence_interval_method: LOCKED + confidence_level: EDITABLE + cuped_calculation: EDITABLE + default_duration: EDITABLE + environment: EDITABLE + flag_source: LOCKED + multiple_testing_correction: EDITABLE + notifications: EDITABLE + primary_metric: EDITABLE + secondary_metrics: EDITABLE + split_by_exploration_dimensions: EDITABLE + subject_type: LOCKED + targeting_rules: EDITABLE + traffic_exposure: EDITABLE + warehouse_exposure_source: EDITABLE + experiment_count: 0 + is_duration_required_to_start: false + is_equal_split_enforced: false + is_metric_limit_enabled: false + is_minimum_duration_enabled: false + metric_groups: [] + name: Checkout protocol + published_at: "2026-07-31T12:00:00Z" + status: ARCHIVED + subject_type: + id: c2b3d4e5-0000-0000-0000-000000000000 + name: User + subject_type_id: c2b3d4e5-0000-0000-0000-000000000000 + updated_at: "2026-07-31T14:00:00Z" + id: e4d5f6a7-0000-0000-0000-000000000000 + type: protocols + schema: + $ref: "#/components/schemas/ExperimentsPublicProtocolResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Invalid request or protocol settings. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Missing or invalid authentication. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: The caller lacks the product_analytics_experiments_write permission. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: No protocol with this ID exists in the organization. + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: The protocol is already archived or expected_updated_at is stale. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - product_analytics_experiments_write + summary: Archive experiment protocol + tags: + - Experiments + x-permission: + operator: AND + permissions: + - product_analytics_experiments_write + /api/v2/experiments/protocols/{protocol_id}/publish: + post: + description: >- + Publish a valid draft protocol. The protocol must have a name and subject type. Supplied references and settings must be valid. An exposure schedule or targeting rules require an environment. Enabled limits require their values. Configurable template fields must have a value before they can be locked. + + + Independent configuration errors are returned together in the JSON:API errors array with source.pointer values that identify the fields. Earlier request and reference checks can stop on the first error. A failed request leaves the protocol unchanged. + operationId: PublishExperimentProtocol + parameters: + - description: The UUID of the protocol. + in: path + name: protocol_id + required: true + schema: + description: The UUID of the protocol. + example: 550e8400-e29b-41d4-a716-446655440000 + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-07-31T12:00:00Z" + description: Defaults for checkout experiments. + enforcement: + confidence_interval_method: LOCKED + confidence_level: EDITABLE + cuped_calculation: EDITABLE + default_duration: EDITABLE + environment: EDITABLE + flag_source: LOCKED + multiple_testing_correction: EDITABLE + notifications: EDITABLE + primary_metric: EDITABLE + secondary_metrics: EDITABLE + split_by_exploration_dimensions: EDITABLE + subject_type: LOCKED + targeting_rules: EDITABLE + traffic_exposure: EDITABLE + warehouse_exposure_source: EDITABLE + experiment_count: 0 + is_duration_required_to_start: false + is_equal_split_enforced: false + is_metric_limit_enabled: false + is_minimum_duration_enabled: false + metric_groups: [] + name: Checkout protocol + published_at: "2026-07-31T12:00:00Z" + status: PUBLISHED + subject_type: + id: c2b3d4e5-0000-0000-0000-000000000000 + name: User + subject_type_id: c2b3d4e5-0000-0000-0000-000000000000 + updated_at: "2026-07-31T12:00:00Z" + id: e4d5f6a7-0000-0000-0000-000000000000 + type: protocols + schema: + $ref: "#/components/schemas/ExperimentsPublicProtocolResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Invalid request or protocol settings. + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Missing or invalid authentication. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: The caller lacks the product_analytics_experiments_write permission. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: No protocol with this ID exists in the organization. + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Only draft protocols can be published. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - product_analytics_experiments_write + summary: Publish experiment protocol + tags: + - Experiments + x-permission: + operator: AND + permissions: + - product_analytics_experiments_write /api/v2/experiments/results/refresh: post: description: >- diff --git a/examples/v2/experiments/ArchiveExperimentProtocol.java b/examples/v2/experiments/ArchiveExperimentProtocol.java new file mode 100644 index 00000000000..bfa30aaa303 --- /dev/null +++ b/examples/v2/experiments/ArchiveExperimentProtocol.java @@ -0,0 +1,41 @@ +// Archive experiment protocol returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ExperimentsApi; +import com.datadog.api.client.v2.api.ExperimentsApi.ArchiveExperimentProtocolOptionalParameters; +import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + ExperimentsApi apiInstance = new ExperimentsApi(defaultClient); + + // there is a valid "experiment_protocol" in the system + String EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT = + System.getenv("EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT"); + UUID EXPERIMENT_PROTOCOL_DATA_ID = null; + try { + EXPERIMENT_PROTOCOL_DATA_ID = UUID.fromString(System.getenv("EXPERIMENT_PROTOCOL_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + ExperimentsPublicProtocolResponse result = + apiInstance.archiveExperimentProtocol( + EXPERIMENT_PROTOCOL_DATA_ID, + new ArchiveExperimentProtocolOptionalParameters() + .expectedUpdatedAt(EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT)); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentsApi#archiveExperimentProtocol"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/experiments/CreateExperimentProtocol.java b/examples/v2/experiments/CreateExperimentProtocol.java new file mode 100644 index 00000000000..a5abae0dc4d --- /dev/null +++ b/examples/v2/experiments/CreateExperimentProtocol.java @@ -0,0 +1,39 @@ +// Create experiment protocol returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ExperimentsApi; +import com.datadog.api.client.v2.model.ExperimentsCreateExperimentProtocolRequest; +import com.datadog.api.client.v2.model.ExperimentsCreateExperimentProtocolRequestData; +import com.datadog.api.client.v2.model.ExperimentsCreateExperimentProtocolRequestDataAttributes; +import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponse; +import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponseDataType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + ExperimentsApi apiInstance = new ExperimentsApi(defaultClient); + + ExperimentsCreateExperimentProtocolRequest body = + new ExperimentsCreateExperimentProtocolRequest() + .data( + new ExperimentsCreateExperimentProtocolRequestData() + .type(ExperimentsPublicProtocolResponseDataType.PROTOCOLS) + .attributes( + new ExperimentsCreateExperimentProtocolRequestDataAttributes() + .name("ex-protocol-14bb9543f523edde") + .description("Protocol created by the API test."))); + + try { + ExperimentsPublicProtocolResponse result = apiInstance.createExperimentProtocol(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentsApi#createExperimentProtocol"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/experiments/DeleteExperimentProtocol.java b/examples/v2/experiments/DeleteExperimentProtocol.java new file mode 100644 index 00000000000..5851ce51505 --- /dev/null +++ b/examples/v2/experiments/DeleteExperimentProtocol.java @@ -0,0 +1,38 @@ +// Delete experiment protocol returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ExperimentsApi; +import com.datadog.api.client.v2.api.ExperimentsApi.DeleteExperimentProtocolOptionalParameters; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + ExperimentsApi apiInstance = new ExperimentsApi(defaultClient); + + // there is a valid "experiment_protocol" in the system + String EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT = + System.getenv("EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT"); + UUID EXPERIMENT_PROTOCOL_DATA_ID = null; + try { + EXPERIMENT_PROTOCOL_DATA_ID = UUID.fromString(System.getenv("EXPERIMENT_PROTOCOL_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + apiInstance.deleteExperimentProtocol( + EXPERIMENT_PROTOCOL_DATA_ID, + new DeleteExperimentProtocolOptionalParameters() + .expectedUpdatedAt(EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT)); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentsApi#deleteExperimentProtocol"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/experiments/GetExperimentProtocol.java b/examples/v2/experiments/GetExperimentProtocol.java index 8ca8497fab7..f4d58ffae7b 100644 --- a/examples/v2/experiments/GetExperimentProtocol.java +++ b/examples/v2/experiments/GetExperimentProtocol.java @@ -12,10 +12,17 @@ public static void main(String[] args) { defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); ExperimentsApi apiInstance = new ExperimentsApi(defaultClient); + // there is a valid "experiment_protocol" in the system + UUID EXPERIMENT_PROTOCOL_DATA_ID = null; + try { + EXPERIMENT_PROTOCOL_DATA_ID = UUID.fromString(System.getenv("EXPERIMENT_PROTOCOL_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + try { ExperimentsPublicProtocolResponse result = - apiInstance.getExperimentProtocol( - UUID.fromString("550e8400-e29b-41d4-a716-446655440000")); + apiInstance.getExperimentProtocol(EXPERIMENT_PROTOCOL_DATA_ID); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ExperimentsApi#getExperimentProtocol"); diff --git a/examples/v2/experiments/ListExperimentProtocols.java b/examples/v2/experiments/ListExperimentProtocols.java index bf1c7d8e3ed..e9e85edcd04 100644 --- a/examples/v2/experiments/ListExperimentProtocols.java +++ b/examples/v2/experiments/ListExperimentProtocols.java @@ -3,7 +3,10 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.ExperimentsApi; +import com.datadog.api.client.v2.api.ExperimentsApi.ListExperimentProtocolsOptionalParameters; import com.datadog.api.client.v2.model.ExperimentsPublicProtocolListResponseArray; +import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponseDataAttributesStatus; +import java.util.Collections; public class Example { public static void main(String[] args) { @@ -11,8 +14,18 @@ public static void main(String[] args) { defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); ExperimentsApi apiInstance = new ExperimentsApi(defaultClient); + // there is a valid "experiment_protocol" in the system + String EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_NAME = + System.getenv("EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_NAME"); + try { - ExperimentsPublicProtocolListResponseArray result = apiInstance.listExperimentProtocols(); + ExperimentsPublicProtocolListResponseArray result = + apiInstance.listExperimentProtocols( + new ListExperimentProtocolsOptionalParameters() + .filterStatus( + Collections.singletonList( + ExperimentsPublicProtocolResponseDataAttributesStatus.DRAFT)) + .filterQuery(EXPERIMENT_PROTOCOL_DATA_ATTRIBUTES_NAME)); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ExperimentsApi#listExperimentProtocols"); diff --git a/examples/v2/experiments/PatchExperimentProtocol.java b/examples/v2/experiments/PatchExperimentProtocol.java new file mode 100644 index 00000000000..7e6630d2e0a --- /dev/null +++ b/examples/v2/experiments/PatchExperimentProtocol.java @@ -0,0 +1,49 @@ +// Update experiment protocol returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ExperimentsApi; +import com.datadog.api.client.v2.model.ExperimentsPatchExperimentProtocolRequest; +import com.datadog.api.client.v2.model.ExperimentsPatchExperimentProtocolRequestData; +import com.datadog.api.client.v2.model.ExperimentsPatchExperimentProtocolRequestDataAttributes; +import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponse; +import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponseDataType; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + ExperimentsApi apiInstance = new ExperimentsApi(defaultClient); + + // there is a valid "experiment_protocol" in the system + UUID EXPERIMENT_PROTOCOL_DATA_ID = null; + try { + EXPERIMENT_PROTOCOL_DATA_ID = UUID.fromString(System.getenv("EXPERIMENT_PROTOCOL_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + ExperimentsPatchExperimentProtocolRequest body = + new ExperimentsPatchExperimentProtocolRequest() + .data( + new ExperimentsPatchExperimentProtocolRequestData() + .type(ExperimentsPublicProtocolResponseDataType.PROTOCOLS) + .id(EXPERIMENT_PROTOCOL_DATA_ID) + .attributes( + new ExperimentsPatchExperimentProtocolRequestDataAttributes() + .description("Updated protocol description."))); + + try { + ExperimentsPublicProtocolResponse result = + apiInstance.patchExperimentProtocol(EXPERIMENT_PROTOCOL_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentsApi#patchExperimentProtocol"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/experiments/PublishExperimentProtocol.java b/examples/v2/experiments/PublishExperimentProtocol.java new file mode 100644 index 00000000000..6b503c96f4f --- /dev/null +++ b/examples/v2/experiments/PublishExperimentProtocol.java @@ -0,0 +1,36 @@ +// Publish experiment protocol returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ExperimentsApi; +import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + ExperimentsApi apiInstance = new ExperimentsApi(defaultClient); + + // there is a valid "configured_experiment_protocol" in the system + UUID CONFIGURED_EXPERIMENT_PROTOCOL_DATA_ID = null; + try { + CONFIGURED_EXPERIMENT_PROTOCOL_DATA_ID = + UUID.fromString(System.getenv("CONFIGURED_EXPERIMENT_PROTOCOL_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + ExperimentsPublicProtocolResponse result = + apiInstance.publishExperimentProtocol(CONFIGURED_EXPERIMENT_PROTOCOL_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentsApi#publishExperimentProtocol"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/experiments/ReplaceExperimentProtocol.java b/examples/v2/experiments/ReplaceExperimentProtocol.java new file mode 100644 index 00000000000..94fed74e262 --- /dev/null +++ b/examples/v2/experiments/ReplaceExperimentProtocol.java @@ -0,0 +1,70 @@ +// Replace experiment protocol returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ExperimentsApi; +import com.datadog.api.client.v2.api.ExperimentsApi.ReplaceExperimentProtocolOptionalParameters; +import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponse; +import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponseDataType; +import com.datadog.api.client.v2.model.ExperimentsReplaceExperimentProtocolRequest; +import com.datadog.api.client.v2.model.ExperimentsReplaceExperimentProtocolRequestData; +import com.datadog.api.client.v2.model.ExperimentsReplaceExperimentProtocolRequestDataAttributes; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + ExperimentsApi apiInstance = new ExperimentsApi(defaultClient); + + // there is a valid "published_protocol" in the system + String PUBLISHED_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT = + System.getenv("PUBLISHED_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT"); + UUID PUBLISHED_PROTOCOL_DATA_ID = null; + try { + PUBLISHED_PROTOCOL_DATA_ID = UUID.fromString(System.getenv("PUBLISHED_PROTOCOL_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + // there is a valid "experiment_subject_type" in the system + UUID EXPERIMENT_SUBJECT_TYPE_DATA_ID = null; + try { + EXPERIMENT_SUBJECT_TYPE_DATA_ID = + UUID.fromString(System.getenv("EXPERIMENT_SUBJECT_TYPE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + ExperimentsReplaceExperimentProtocolRequest body = + new ExperimentsReplaceExperimentProtocolRequest() + .data( + new ExperimentsReplaceExperimentProtocolRequestData() + .type(ExperimentsPublicProtocolResponseDataType.PROTOCOLS) + .id(PUBLISHED_PROTOCOL_DATA_ID) + .attributes( + new ExperimentsReplaceExperimentProtocolRequestDataAttributes() + .subjectTypeId(EXPERIMENT_SUBJECT_TYPE_DATA_ID) + .isEqualSplitEnforced(false) + .isMinimumDurationEnabled(false) + .isDurationRequiredToStart(false) + .isMetricLimitEnabled(false) + .defaultDurationDays(14L))); + + try { + ExperimentsPublicProtocolResponse result = + apiInstance.replaceExperimentProtocol( + PUBLISHED_PROTOCOL_DATA_ID, + body, + new ReplaceExperimentProtocolOptionalParameters() + .expectedUpdatedAt(PUBLISHED_PROTOCOL_DATA_ATTRIBUTES_UPDATED_AT)); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ExperimentsApi#replaceExperimentProtocol"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/ExperimentsApi.java b/src/main/java/com/datadog/api/client/v2/api/ExperimentsApi.java index 2d2d9cdfa95..dc9094340b2 100644 --- a/src/main/java/com/datadog/api/client/v2/api/ExperimentsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/ExperimentsApi.java @@ -10,6 +10,7 @@ import com.datadog.api.client.v2.model.ExperimentsCancelExperimentV2Request; import com.datadog.api.client.v2.model.ExperimentsConcludeExperimentV2Request; import com.datadog.api.client.v2.model.ExperimentsCreateExperimentMetricGroupV2Request; +import com.datadog.api.client.v2.model.ExperimentsCreateExperimentProtocolRequest; import com.datadog.api.client.v2.model.ExperimentsCreateExperimentV2Request; import com.datadog.api.client.v2.model.ExperimentsCreateExposureSQLModelV2Request; import com.datadog.api.client.v2.model.ExperimentsCreateMetricCollectionV2Request; @@ -30,6 +31,7 @@ import com.datadog.api.client.v2.model.ExperimentsMetricV2DTO; import com.datadog.api.client.v2.model.ExperimentsMetricV2DTOArray; import com.datadog.api.client.v2.model.ExperimentsPatchExperimentMetricGroupV2Request; +import com.datadog.api.client.v2.model.ExperimentsPatchExperimentProtocolRequest; import com.datadog.api.client.v2.model.ExperimentsPatchExperimentV2Request; import com.datadog.api.client.v2.model.ExperimentsPatchExperimentV2Response; import com.datadog.api.client.v2.model.ExperimentsPatchMetricCollectionV2Request; @@ -39,6 +41,7 @@ import com.datadog.api.client.v2.model.ExperimentsPublicProtocolResponseDataAttributesStatus; import com.datadog.api.client.v2.model.ExperimentsRefreshExperimentResultsV2DTO; import com.datadog.api.client.v2.model.ExperimentsRefreshExperimentResultsV2DTOArray; +import com.datadog.api.client.v2.model.ExperimentsReplaceExperimentProtocolRequest; import com.datadog.api.client.v2.model.ExperimentsStartExperimentV2Request; import com.datadog.api.client.v2.model.ExperimentsSubjectTypeV2DTO; import com.datadog.api.client.v2.model.ExperimentsSubjectTypeV2DTOArray; @@ -88,6 +91,223 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** Manage optional parameters to archiveExperimentProtocol. */ + public static class ArchiveExperimentProtocolOptionalParameters { + private String expectedUpdatedAt; + + /** + * Set expectedUpdatedAt. + * + * @param expectedUpdatedAt The updated_at value from the last read. Include the full timestamp, + * with fractional seconds. Returns 409 if another write changed the protocol. Omit to skip + * this check. (optional) + * @return ArchiveExperimentProtocolOptionalParameters + */ + public ArchiveExperimentProtocolOptionalParameters expectedUpdatedAt(String expectedUpdatedAt) { + this.expectedUpdatedAt = expectedUpdatedAt; + return this; + } + } + + /** + * Archive experiment protocol. + * + *

See {@link #archiveExperimentProtocolWithHttpInfo}. + * + * @param protocolId The UUID of the protocol. (required) + * @return ExperimentsPublicProtocolResponse + * @throws ApiException if fails to make API call + */ + public ExperimentsPublicProtocolResponse archiveExperimentProtocol(UUID protocolId) + throws ApiException { + return archiveExperimentProtocolWithHttpInfo( + protocolId, new ArchiveExperimentProtocolOptionalParameters()) + .getData(); + } + + /** + * Archive experiment protocol. + * + *

See {@link #archiveExperimentProtocolWithHttpInfoAsync}. + * + * @param protocolId The UUID of the protocol. (required) + * @return CompletableFuture<ExperimentsPublicProtocolResponse> + */ + public CompletableFuture archiveExperimentProtocolAsync( + UUID protocolId) { + return archiveExperimentProtocolWithHttpInfoAsync( + protocolId, new ArchiveExperimentProtocolOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Archive experiment protocol. + * + *

See {@link #archiveExperimentProtocolWithHttpInfo}. + * + * @param protocolId The UUID of the protocol. (required) + * @param parameters Optional parameters for the request. + * @return ExperimentsPublicProtocolResponse + * @throws ApiException if fails to make API call + */ + public ExperimentsPublicProtocolResponse archiveExperimentProtocol( + UUID protocolId, ArchiveExperimentProtocolOptionalParameters parameters) throws ApiException { + return archiveExperimentProtocolWithHttpInfo(protocolId, parameters).getData(); + } + + /** + * Archive experiment protocol. + * + *

See {@link #archiveExperimentProtocolWithHttpInfoAsync}. + * + * @param protocolId The UUID of the protocol. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ExperimentsPublicProtocolResponse> + */ + public CompletableFuture archiveExperimentProtocolAsync( + UUID protocolId, ArchiveExperimentProtocolOptionalParameters parameters) { + return archiveExperimentProtocolWithHttpInfoAsync(protocolId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Archive a draft or published protocol. Archived protocols cannot be edited or used to create + * new experiments. Existing experiments keep their settings. Archiving an already archived + * protocol returns 409. + * + * @param protocolId The UUID of the protocol. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<ExperimentsPublicProtocolResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Invalid request or protocol settings. -
401 Missing or invalid authentication. -
403 The caller lacks the product_analytics_experiments_write permission. -
404 No protocol with this ID exists in the organization. -
409 The protocol is already archived or expected_updated_at is stale. -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse archiveExperimentProtocolWithHttpInfo( + UUID protocolId, ArchiveExperimentProtocolOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'protocolId' is set + if (protocolId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'protocolId' when calling archiveExperimentProtocol"); + } + String expectedUpdatedAt = parameters.expectedUpdatedAt; + // create path and map variables + String localVarPath = + "/api/v2/experiments/protocols/{protocol_id}/archive" + .replaceAll( + "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "expected_updated_at", expectedUpdatedAt)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ExperimentsApi.archiveExperimentProtocol", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Archive experiment protocol. + * + *

See {@link #archiveExperimentProtocolWithHttpInfo}. + * + * @param protocolId The UUID of the protocol. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ExperimentsPublicProtocolResponse>> + */ + public CompletableFuture> + archiveExperimentProtocolWithHttpInfoAsync( + UUID protocolId, ArchiveExperimentProtocolOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'protocolId' is set + if (protocolId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'protocolId' when calling" + + " archiveExperimentProtocol")); + return result; + } + String expectedUpdatedAt = parameters.expectedUpdatedAt; + // create path and map variables + String localVarPath = + "/api/v2/experiments/protocols/{protocol_id}/archive" + .replaceAll( + "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "expected_updated_at", expectedUpdatedAt)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ExperimentsApi.archiveExperimentProtocol", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Archive exposure SQL model. * @@ -1087,30 +1307,30 @@ public ExperimentsExperimentMetricGroupMutationV2 createExperimentMetricGroupFro } /** - * Create exposure SQL model. + * Create experiment protocol. * - *

See {@link #createExposureSQLModelWithHttpInfo}. + *

See {@link #createExperimentProtocolWithHttpInfo}. * * @param body (required) - * @return ExperimentsExposureSQLModelV2DTO + * @return ExperimentsPublicProtocolResponse * @throws ApiException if fails to make API call */ - public ExperimentsExposureSQLModelV2DTO createExposureSQLModel( - ExperimentsCreateExposureSQLModelV2Request body) throws ApiException { - return createExposureSQLModelWithHttpInfo(body).getData(); + public ExperimentsPublicProtocolResponse createExperimentProtocol( + ExperimentsCreateExperimentProtocolRequest body) throws ApiException { + return createExperimentProtocolWithHttpInfo(body).getData(); } /** - * Create exposure SQL model. + * Create experiment protocol. * - *

See {@link #createExposureSQLModelWithHttpInfoAsync}. + *

See {@link #createExperimentProtocolWithHttpInfoAsync}. * * @param body (required) - * @return CompletableFuture<ExperimentsExposureSQLModelV2DTO> + * @return CompletableFuture<ExperimentsPublicProtocolResponse> */ - public CompletableFuture createExposureSQLModelAsync( - ExperimentsCreateExposureSQLModelV2Request body) { - return createExposureSQLModelWithHttpInfoAsync(body) + public CompletableFuture createExperimentProtocolAsync( + ExperimentsCreateExperimentProtocolRequest body) { + return createExperimentProtocolWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -1118,42 +1338,44 @@ public CompletableFuture createExposureSQLMode } /** - * Create an exposure SQL model. Requires at least one subject type. The warehouse connection is - * resolved from the organization, which has exactly one. + * Create a draft protocol with a name and optional description and migration metadata. The + * organization's default subject type is selected. Use PATCH to configure the draft, then publish + * it before creating experiments from it. * * @param body (required) - * @return ApiResponse<ExperimentsExposureSQLModelV2DTO> + * @return ApiResponse<ExperimentsPublicProtocolResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * + * * - * - * - * + * + * + * * + * *
Response details
Status Code Description Response Headers
201 Created -
400 Malformed body, validation failure, or the SQL was rejected by the warehouse validator. -
400 Invalid request or protocol settings. -
401 Missing or invalid authentication. -
403 Authenticated caller lacks the product_analytics_warehouse_model_write permission. -
409 The write collided with an existing record for the organization. -
415 Request body sent with a media type other than application/json or application/vnd.api+json. -
403 The caller lacks the product_analytics_experiments_write permission. -
409 A protocol with this name already exists. -
415 Unsupported request content type. -
429 Too many requests -
500 Internal Server Error -
*/ - public ApiResponse createExposureSQLModelWithHttpInfo( - ExperimentsCreateExposureSQLModelV2Request body) throws ApiException { + public ApiResponse createExperimentProtocolWithHttpInfo( + ExperimentsCreateExperimentProtocolRequest body) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling createExposureSQLModel"); + 400, "Missing the required parameter 'body' when calling createExperimentProtocol"); } // create path and map variables - String localVarPath = "/api/v2/experiments/exposure-sql-models"; + String localVarPath = "/api/v2/experiments/protocols"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.ExperimentsApi.createExposureSQLModel", + "v2.ExperimentsApi.createExperimentProtocol", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1168,32 +1390,32 @@ public ApiResponse createExposureSQLModelWithH localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create exposure SQL model. + * Create experiment protocol. * - *

See {@link #createExposureSQLModelWithHttpInfo}. + *

See {@link #createExperimentProtocolWithHttpInfo}. * * @param body (required) - * @return CompletableFuture<ApiResponse<ExperimentsExposureSQLModelV2DTO>> + * @return CompletableFuture<ApiResponse<ExperimentsPublicProtocolResponse>> */ - public CompletableFuture> - createExposureSQLModelWithHttpInfoAsync(ExperimentsCreateExposureSQLModelV2Request body) { + public CompletableFuture> + createExperimentProtocolWithHttpInfoAsync(ExperimentsCreateExperimentProtocolRequest body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling createExposureSQLModel")); + 400, "Missing the required parameter 'body' when calling createExperimentProtocol")); return result; } // create path and map variables - String localVarPath = "/api/v2/experiments/exposure-sql-models"; + String localVarPath = "/api/v2/experiments/protocols"; Map localVarHeaderParams = new HashMap(); @@ -1201,7 +1423,7 @@ public ApiResponse createExposureSQLModelWithH try { builder = apiClient.createBuilder( - "v2.ExperimentsApi.createExposureSQLModel", + "v2.ExperimentsApi.createExperimentProtocol", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1209,7 +1431,7 @@ public ApiResponse createExposureSQLModelWithH new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -1222,34 +1444,34 @@ public ApiResponse createExposureSQLModelWithH localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create metric. + * Create exposure SQL model. * - *

See {@link #createMetricWithHttpInfo}. + *

See {@link #createExposureSQLModelWithHttpInfo}. * * @param body (required) - * @return ExperimentsMetricV2DTO + * @return ExperimentsExposureSQLModelV2DTO * @throws ApiException if fails to make API call */ - public ExperimentsMetricV2DTO createMetric(ExperimentsCreateMetricV2Request body) - throws ApiException { - return createMetricWithHttpInfo(body).getData(); + public ExperimentsExposureSQLModelV2DTO createExposureSQLModel( + ExperimentsCreateExposureSQLModelV2Request body) throws ApiException { + return createExposureSQLModelWithHttpInfo(body).getData(); } /** - * Create metric. + * Create exposure SQL model. * - *

See {@link #createMetricWithHttpInfoAsync}. + *

See {@link #createExposureSQLModelWithHttpInfoAsync}. * * @param body (required) - * @return CompletableFuture<ExperimentsMetricV2DTO> + * @return CompletableFuture<ExperimentsExposureSQLModelV2DTO> */ - public CompletableFuture createMetricAsync( - ExperimentsCreateMetricV2Request body) { - return createMetricWithHttpInfoAsync(body) + public CompletableFuture createExposureSQLModelAsync( + ExperimentsCreateExposureSQLModelV2Request body) { + return createExposureSQLModelWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -1257,40 +1479,179 @@ public CompletableFuture createMetricAsync( } /** - * Create a metric. The metric's type is derived from the aggregation shape: a numerator alone is - * SIMPLE, a numerator with a denominator is RATIO, and a percentile aggregation is PERCENTILE. - * Warehouse aggregations reference measures by UUID. Property filters use property_id or - * measure_id UUIDs returned by the same metric SQL model; every reference must belong to the - * aggregation's data source. The is_certified attribute is rejected. Certification cannot be - * changed through this endpoint. + * Create an exposure SQL model. Requires at least one subject type. The warehouse connection is + * resolved from the organization, which has exactly one. * * @param body (required) - * @return ApiResponse<ExperimentsMetricV2DTO> + * @return ApiResponse<ExperimentsExposureSQLModelV2DTO> * @throws ApiException if fails to make API call * @http.response.details * * * * - * + * * - * - * + * + * * * *
Response details
Status Code Description Response Headers
201 Created -
400 Malformed body, validation failure, or an aggregation that does not match metric_type. -
400 Malformed body, validation failure, or the SQL was rejected by the warehouse validator. -
401 Missing or invalid authentication. -
403 Caller lacks product_analytics_metrics_write. -
409 Another metric in this organization already uses one of these values. -
403 Authenticated caller lacks the product_analytics_warehouse_model_write permission. -
409 The write collided with an existing record for the organization. -
415 Request body sent with a media type other than application/json or application/vnd.api+json. -
429 Too many requests -
*/ - public ApiResponse createMetricWithHttpInfo( - ExperimentsCreateMetricV2Request body) throws ApiException { + public ApiResponse createExposureSQLModelWithHttpInfo( + ExperimentsCreateExposureSQLModelV2Request body) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling createMetric"); + 400, "Missing the required parameter 'body' when calling createExposureSQLModel"); } // create path and map variables - String localVarPath = "/api/v2/experiments/metrics"; + String localVarPath = "/api/v2/experiments/exposure-sql-models"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ExperimentsApi.createExposureSQLModel", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create exposure SQL model. + * + *

See {@link #createExposureSQLModelWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<ExperimentsExposureSQLModelV2DTO>> + */ + public CompletableFuture> + createExposureSQLModelWithHttpInfoAsync(ExperimentsCreateExposureSQLModelV2Request body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createExposureSQLModel")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/experiments/exposure-sql-models"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ExperimentsApi.createExposureSQLModel", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create metric. + * + *

See {@link #createMetricWithHttpInfo}. + * + * @param body (required) + * @return ExperimentsMetricV2DTO + * @throws ApiException if fails to make API call + */ + public ExperimentsMetricV2DTO createMetric(ExperimentsCreateMetricV2Request body) + throws ApiException { + return createMetricWithHttpInfo(body).getData(); + } + + /** + * Create metric. + * + *

See {@link #createMetricWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<ExperimentsMetricV2DTO> + */ + public CompletableFuture createMetricAsync( + ExperimentsCreateMetricV2Request body) { + return createMetricWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a metric. The metric's type is derived from the aggregation shape: a numerator alone is + * SIMPLE, a numerator with a denominator is RATIO, and a percentile aggregation is PERCENTILE. + * Warehouse aggregations reference measures by UUID. Property filters use property_id or + * measure_id UUIDs returned by the same metric SQL model; every reference must belong to the + * aggregation's data source. The is_certified attribute is rejected. Certification cannot be + * changed through this endpoint. + * + * @param body (required) + * @return ApiResponse<ExperimentsMetricV2DTO> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Malformed body, validation failure, or an aggregation that does not match metric_type. -
401 Missing or invalid authentication. -
403 Caller lacks product_analytics_metrics_write. -
409 Another metric in this organization already uses one of these values. -
415 Request body sent with a media type other than application/json or application/vnd.api+json. -
429 Too many requests -
+ */ + public ApiResponse createMetricWithHttpInfo( + ExperimentsCreateMetricV2Request body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createMetric"); + } + // create path and map variables + String localVarPath = "/api/v2/experiments/metrics"; Map localVarHeaderParams = new HashMap(); @@ -2096,28 +2457,48 @@ public CompletableFuture> deleteExperimentMetricGroupWithHttpI null); } + /** Manage optional parameters to deleteExperimentProtocol. */ + public static class DeleteExperimentProtocolOptionalParameters { + private String expectedUpdatedAt; + + /** + * Set expectedUpdatedAt. + * + * @param expectedUpdatedAt The updated_at value from the last read. Include the full timestamp, + * with fractional seconds. Returns 409 if another write changed the protocol. Omit to skip + * this check. (optional) + * @return DeleteExperimentProtocolOptionalParameters + */ + public DeleteExperimentProtocolOptionalParameters expectedUpdatedAt(String expectedUpdatedAt) { + this.expectedUpdatedAt = expectedUpdatedAt; + return this; + } + } + /** - * Delete metric. + * Delete experiment protocol. * - *

See {@link #deleteMetricWithHttpInfo}. + *

See {@link #deleteExperimentProtocolWithHttpInfo}. * - * @param metricId The UUID of the metric. (required) + * @param protocolId The UUID of the protocol. (required) * @throws ApiException if fails to make API call */ - public void deleteMetric(UUID metricId) throws ApiException { - deleteMetricWithHttpInfo(metricId); + public void deleteExperimentProtocol(UUID protocolId) throws ApiException { + deleteExperimentProtocolWithHttpInfo( + protocolId, new DeleteExperimentProtocolOptionalParameters()); } /** - * Delete metric. + * Delete experiment protocol. * - *

See {@link #deleteMetricWithHttpInfoAsync}. + *

See {@link #deleteExperimentProtocolWithHttpInfoAsync}. * - * @param metricId The UUID of the metric. (required) + * @param protocolId The UUID of the protocol. (required) * @return CompletableFuture */ - public CompletableFuture deleteMetricAsync(UUID metricId) { - return deleteMetricWithHttpInfoAsync(metricId) + public CompletableFuture deleteExperimentProtocolAsync(UUID protocolId) { + return deleteExperimentProtocolWithHttpInfoAsync( + protocolId, new DeleteExperimentProtocolOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -2125,46 +2506,86 @@ public CompletableFuture deleteMetricAsync(UUID metricId) { } /** - * Delete a metric. Certified metrics are read-only through this endpoint. The record is - * soft-deleted and stops appearing in reads. A metric still referenced by an experiment cannot be - * deleted; detach it from those experiments first. + * Delete experiment protocol. * - * @param metricId The UUID of the metric. (required) + *

See {@link #deleteExperimentProtocolWithHttpInfo}. + * + * @param protocolId The UUID of the protocol. (required) + * @param parameters Optional parameters for the request. + * @throws ApiException if fails to make API call + */ + public void deleteExperimentProtocol( + UUID protocolId, DeleteExperimentProtocolOptionalParameters parameters) throws ApiException { + deleteExperimentProtocolWithHttpInfo(protocolId, parameters); + } + + /** + * Delete experiment protocol. + * + *

See {@link #deleteExperimentProtocolWithHttpInfoAsync}. + * + * @param protocolId The UUID of the protocol. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture + */ + public CompletableFuture deleteExperimentProtocolAsync( + UUID protocolId, DeleteExperimentProtocolOptionalParameters parameters) { + return deleteExperimentProtocolWithHttpInfoAsync(protocolId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a protocol with no linked experiments. Draft, published, and archived protocols can be + * deleted. Returns 204 with no response body. + * + * @param protocolId The UUID of the protocol. (required) + * @param parameters Optional parameters for the request. * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * * - * - * - * + * + * + * * + * *
Response details
Status Code Description Response Headers
204 The metric was deleted. -
400 Malformed metric ID (not a valid UUID). -
204 No Content -
400 Invalid request or protocol settings. -
401 Missing or invalid authentication. -
403 Caller lacks product_analytics_metrics_write or edit access to this specific metric. -
404 No metric with this ID exists for the organization. -
409 The metric is imported, certified, managed by metric sync, or still referenced by one or more experiments and cannot be deleted. -
403 The caller lacks the product_analytics_experiments_write permission. -
404 No protocol with this ID exists in the organization. -
409 The protocol has linked experiments or expected_updated_at is stale. -
429 Too many requests -
500 Internal Server Error -
*/ - public ApiResponse deleteMetricWithHttpInfo(UUID metricId) throws ApiException { + public ApiResponse deleteExperimentProtocolWithHttpInfo( + UUID protocolId, DeleteExperimentProtocolOptionalParameters parameters) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'metricId' is set - if (metricId == null) { + // verify the required parameter 'protocolId' is set + if (protocolId == null) { throw new ApiException( - 400, "Missing the required parameter 'metricId' when calling deleteMetric"); + 400, "Missing the required parameter 'protocolId' when calling deleteExperimentProtocol"); } + String expectedUpdatedAt = parameters.expectedUpdatedAt; // create path and map variables String localVarPath = - "/api/v2/experiments/metrics/{metric_id}" - .replaceAll("\\{" + "metric_id" + "\\}", apiClient.escapeString(metricId.toString())); + "/api/v2/experiments/protocols/{protocol_id}" + .replaceAll( + "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "expected_updated_at", expectedUpdatedAt)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.ExperimentsApi.deleteMetric", + "v2.ExperimentsApi.deleteExperimentProtocol", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"*/*"}, @@ -2181,38 +2602,47 @@ public ApiResponse deleteMetricWithHttpInfo(UUID metricId) throws ApiExcep } /** - * Delete metric. + * Delete experiment protocol. * - *

See {@link #deleteMetricWithHttpInfo}. + *

See {@link #deleteExperimentProtocolWithHttpInfo}. * - * @param metricId The UUID of the metric. (required) + * @param protocolId The UUID of the protocol. (required) + * @param parameters Optional parameters for the request. * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteMetricWithHttpInfoAsync(UUID metricId) { + public CompletableFuture> deleteExperimentProtocolWithHttpInfoAsync( + UUID protocolId, DeleteExperimentProtocolOptionalParameters parameters) { Object localVarPostBody = null; - // verify the required parameter 'metricId' is set - if (metricId == null) { + // verify the required parameter 'protocolId' is set + if (protocolId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'metricId' when calling deleteMetric")); + 400, + "Missing the required parameter 'protocolId' when calling deleteExperimentProtocol")); return result; } + String expectedUpdatedAt = parameters.expectedUpdatedAt; // create path and map variables String localVarPath = - "/api/v2/experiments/metrics/{metric_id}" - .replaceAll("\\{" + "metric_id" + "\\}", apiClient.escapeString(metricId.toString())); + "/api/v2/experiments/protocols/{protocol_id}" + .replaceAll( + "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "expected_updated_at", expectedUpdatedAt)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.ExperimentsApi.deleteMetric", + "v2.ExperimentsApi.deleteExperimentProtocol", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"*/*"}, @@ -2234,27 +2664,164 @@ public CompletableFuture> deleteMetricWithHttpInfoAsync(UUID m } /** - * Delete metric collection. + * Delete metric. * - *

See {@link #deleteMetricCollectionWithHttpInfo}. + *

See {@link #deleteMetricWithHttpInfo}. * - * @param metricCollectionId The UUID of the metric collection. (required) + * @param metricId The UUID of the metric. (required) * @throws ApiException if fails to make API call */ - public void deleteMetricCollection(UUID metricCollectionId) throws ApiException { - deleteMetricCollectionWithHttpInfo(metricCollectionId); + public void deleteMetric(UUID metricId) throws ApiException { + deleteMetricWithHttpInfo(metricId); } /** - * Delete metric collection. + * Delete metric. * - *

See {@link #deleteMetricCollectionWithHttpInfoAsync}. + *

See {@link #deleteMetricWithHttpInfoAsync}. * - * @param metricCollectionId The UUID of the metric collection. (required) + * @param metricId The UUID of the metric. (required) * @return CompletableFuture */ - public CompletableFuture deleteMetricCollectionAsync(UUID metricCollectionId) { - return deleteMetricCollectionWithHttpInfoAsync(metricCollectionId) + public CompletableFuture deleteMetricAsync(UUID metricId) { + return deleteMetricWithHttpInfoAsync(metricId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a metric. Certified metrics are read-only through this endpoint. The record is + * soft-deleted and stops appearing in reads. A metric still referenced by an experiment cannot be + * deleted; detach it from those experiments first. + * + * @param metricId The UUID of the metric. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 The metric was deleted. -
400 Malformed metric ID (not a valid UUID). -
401 Missing or invalid authentication. -
403 Caller lacks product_analytics_metrics_write or edit access to this specific metric. -
404 No metric with this ID exists for the organization. -
409 The metric is imported, certified, managed by metric sync, or still referenced by one or more experiments and cannot be deleted. -
429 Too many requests -
+ */ + public ApiResponse deleteMetricWithHttpInfo(UUID metricId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'metricId' is set + if (metricId == null) { + throw new ApiException( + 400, "Missing the required parameter 'metricId' when calling deleteMetric"); + } + // create path and map variables + String localVarPath = + "/api/v2/experiments/metrics/{metric_id}" + .replaceAll("\\{" + "metric_id" + "\\}", apiClient.escapeString(metricId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ExperimentsApi.deleteMetric", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete metric. + * + *

See {@link #deleteMetricWithHttpInfo}. + * + * @param metricId The UUID of the metric. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteMetricWithHttpInfoAsync(UUID metricId) { + Object localVarPostBody = null; + + // verify the required parameter 'metricId' is set + if (metricId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'metricId' when calling deleteMetric")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/experiments/metrics/{metric_id}" + .replaceAll("\\{" + "metric_id" + "\\}", apiClient.escapeString(metricId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ExperimentsApi.deleteMetric", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete metric collection. + * + *

See {@link #deleteMetricCollectionWithHttpInfo}. + * + * @param metricCollectionId The UUID of the metric collection. (required) + * @throws ApiException if fails to make API call + */ + public void deleteMetricCollection(UUID metricCollectionId) throws ApiException { + deleteMetricCollectionWithHttpInfo(metricCollectionId); + } + + /** + * Delete metric collection. + * + *

See {@link #deleteMetricCollectionWithHttpInfoAsync}. + * + * @param metricCollectionId The UUID of the metric collection. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteMetricCollectionAsync(UUID metricCollectionId) { + return deleteMetricCollectionWithHttpInfoAsync(metricCollectionId) .thenApply( response -> { return response.getData(); @@ -6634,32 +7201,32 @@ public ApiResponse patchExperimentWithHttp } /** - * Patch subject type. + * Update experiment protocol. * - *

See {@link #patchSubjectTypeWithHttpInfo}. + *

See {@link #patchExperimentProtocolWithHttpInfo}. * - * @param subjectTypeId The UUID of the subject type. (required) + * @param protocolId The UUID of the protocol. (required) * @param body (required) - * @return ExperimentsSubjectTypeV2DTO + * @return ExperimentsPublicProtocolResponse * @throws ApiException if fails to make API call */ - public ExperimentsSubjectTypeV2DTO patchSubjectType( - UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) throws ApiException { - return patchSubjectTypeWithHttpInfo(subjectTypeId, body).getData(); + public ExperimentsPublicProtocolResponse patchExperimentProtocol( + UUID protocolId, ExperimentsPatchExperimentProtocolRequest body) throws ApiException { + return patchExperimentProtocolWithHttpInfo(protocolId, body).getData(); } /** - * Patch subject type. + * Update experiment protocol. * - *

See {@link #patchSubjectTypeWithHttpInfoAsync}. + *

See {@link #patchExperimentProtocolWithHttpInfoAsync}. * - * @param subjectTypeId The UUID of the subject type. (required) + * @param protocolId The UUID of the protocol. (required) * @param body (required) - * @return CompletableFuture<ExperimentsSubjectTypeV2DTO> + * @return CompletableFuture<ExperimentsPublicProtocolResponse> */ - public CompletableFuture patchSubjectTypeAsync( - UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) { - return patchSubjectTypeWithHttpInfoAsync(subjectTypeId, body) + public CompletableFuture patchExperimentProtocolAsync( + UUID protocolId, ExperimentsPatchExperimentProtocolRequest body) { + return patchExperimentProtocolWithHttpInfoAsync(protocolId, body) .thenApply( response -> { return response.getData(); @@ -6667,54 +7234,61 @@ public CompletableFuture patchSubjectTypeAsync( } /** - * Update mutable fields on a subject type. Only the fields present in the body are changed. Any - * subject type can be updated, including the organization's default one, but the is_default flag - * itself is read-only here: which subject type is the default cannot be changed through this - * endpoint. + * Update the supplied fields of a draft protocol. Published protocols accept only name, + * description, and migration_metadata changes through PATCH. Use PUT to replace their settings. + * Archived protocols cannot be edited. * - * @param subjectTypeId The UUID of the subject type. (required) + *

Omitted fields keep their current values, including fields inside analysis_plan, + * exposure_schedule, and enforcement. Arrays replace the stored arrays. Supported null values + * clear fields; see the request schema. Use primary_metric_id to select the primary metric and + * default_duration_days to set the experiment analysis duration. Nested metric is_primary and + * analysis_plan.target_duration_days fields are rejected. + * + * @param protocolId The UUID of the protocol. (required) * @param body (required) - * @return ApiResponse<ExperimentsSubjectTypeV2DTO> + * @return ApiResponse<ExperimentsPublicProtocolResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * + * * - * - * + * + * + * + * * + * *
Response details
Status Code Description Response Headers
200 OK -
400 Malformed subject type ID, malformed body, or no updatable field supplied. -
400 Invalid request or protocol settings. -
401 Missing or invalid authentication. -
403 Authenticated caller lacks the product_analytics_settings_write permission. -
404 No subject type with this ID exists for the organization. -
403 The caller lacks the product_analytics_experiments_write permission. -
404 No protocol with this ID exists in the organization. -
409 The protocol is archived, a published protocol receives settings changes, or the name is already in use. -
415 Unsupported request content type. -
429 Too many requests -
500 Internal Server Error -
*/ - public ApiResponse patchSubjectTypeWithHttpInfo( - UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) throws ApiException { + public ApiResponse patchExperimentProtocolWithHttpInfo( + UUID protocolId, ExperimentsPatchExperimentProtocolRequest body) throws ApiException { Object localVarPostBody = body; - // verify the required parameter 'subjectTypeId' is set - if (subjectTypeId == null) { + // verify the required parameter 'protocolId' is set + if (protocolId == null) { throw new ApiException( - 400, "Missing the required parameter 'subjectTypeId' when calling patchSubjectType"); + 400, "Missing the required parameter 'protocolId' when calling patchExperimentProtocol"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling patchSubjectType"); + 400, "Missing the required parameter 'body' when calling patchExperimentProtocol"); } // create path and map variables String localVarPath = - "/api/v2/experiments/subject-types/{subject_type_id}" + "/api/v2/experiments/protocols/{protocol_id}" .replaceAll( - "\\{" + "subject_type_id" + "\\}", - apiClient.escapeString(subjectTypeId.toString())); + "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.ExperimentsApi.patchSubjectType", + "v2.ExperimentsApi.patchExperimentProtocol", localVarPath, new ArrayList(), localVarHeaderParams, @@ -6729,48 +7303,48 @@ public ApiResponse patchSubjectTypeWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Patch subject type. + * Update experiment protocol. * - *

See {@link #patchSubjectTypeWithHttpInfo}. + *

See {@link #patchExperimentProtocolWithHttpInfo}. * - * @param subjectTypeId The UUID of the subject type. (required) + * @param protocolId The UUID of the protocol. (required) * @param body (required) - * @return CompletableFuture<ApiResponse<ExperimentsSubjectTypeV2DTO>> + * @return CompletableFuture<ApiResponse<ExperimentsPublicProtocolResponse>> */ - public CompletableFuture> - patchSubjectTypeWithHttpInfoAsync( - UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) { + public CompletableFuture> + patchExperimentProtocolWithHttpInfoAsync( + UUID protocolId, ExperimentsPatchExperimentProtocolRequest body) { Object localVarPostBody = body; - // verify the required parameter 'subjectTypeId' is set - if (subjectTypeId == null) { - CompletableFuture> result = + // verify the required parameter 'protocolId' is set + if (protocolId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'subjectTypeId' when calling patchSubjectType")); + 400, + "Missing the required parameter 'protocolId' when calling patchExperimentProtocol")); return result; } // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling patchSubjectType")); + 400, "Missing the required parameter 'body' when calling patchExperimentProtocol")); return result; } // create path and map variables String localVarPath = - "/api/v2/experiments/subject-types/{subject_type_id}" + "/api/v2/experiments/protocols/{protocol_id}" .replaceAll( - "\\{" + "subject_type_id" + "\\}", - apiClient.escapeString(subjectTypeId.toString())); + "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString())); Map localVarHeaderParams = new HashMap(); @@ -6778,7 +7352,7 @@ public ApiResponse patchSubjectTypeWithHttpInfo( try { builder = apiClient.createBuilder( - "v2.ExperimentsApi.patchSubjectType", + "v2.ExperimentsApi.patchExperimentProtocol", localVarPath, new ArrayList(), localVarHeaderParams, @@ -6786,7 +7360,7 @@ public ApiResponse patchSubjectTypeWithHttpInfo( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -6799,49 +7373,373 @@ public ApiResponse patchSubjectTypeWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to refreshExperimentResults. */ - public static class RefreshExperimentResultsOptionalParameters { - private Boolean fullRefresh; - - /** - * Set fullRefresh. - * - * @param fullRefresh Force a full warehouse rebuild. Defaults to false when omitted. (optional) - * @return RefreshExperimentResultsOptionalParameters - */ - public RefreshExperimentResultsOptionalParameters fullRefresh(Boolean fullRefresh) { - this.fullRefresh = fullRefresh; - return this; - } + new GenericType() {}); } /** - * Refresh experiment results. + * Patch subject type. * - *

See {@link #refreshExperimentResultsWithHttpInfo}. + *

See {@link #patchSubjectTypeWithHttpInfo}. * - * @param experimentId The UUID of the experiment. (required) - * @return ExperimentsRefreshExperimentResultsV2DTO + * @param subjectTypeId The UUID of the subject type. (required) + * @param body (required) + * @return ExperimentsSubjectTypeV2DTO * @throws ApiException if fails to make API call */ - public ExperimentsRefreshExperimentResultsV2DTO refreshExperimentResults(UUID experimentId) - throws ApiException { - return refreshExperimentResultsWithHttpInfo( - experimentId, new RefreshExperimentResultsOptionalParameters()) - .getData(); + public ExperimentsSubjectTypeV2DTO patchSubjectType( + UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) throws ApiException { + return patchSubjectTypeWithHttpInfo(subjectTypeId, body).getData(); } /** - * Refresh experiment results. + * Patch subject type. * - *

See {@link #refreshExperimentResultsWithHttpInfoAsync}. + *

See {@link #patchSubjectTypeWithHttpInfoAsync}. * - * @param experimentId The UUID of the experiment. (required) - * @return CompletableFuture<ExperimentsRefreshExperimentResultsV2DTO> - */ + * @param subjectTypeId The UUID of the subject type. (required) + * @param body (required) + * @return CompletableFuture<ExperimentsSubjectTypeV2DTO> + */ + public CompletableFuture patchSubjectTypeAsync( + UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) { + return patchSubjectTypeWithHttpInfoAsync(subjectTypeId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update mutable fields on a subject type. Only the fields present in the body are changed. Any + * subject type can be updated, including the organization's default one, but the is_default flag + * itself is read-only here: which subject type is the default cannot be changed through this + * endpoint. + * + * @param subjectTypeId The UUID of the subject type. (required) + * @param body (required) + * @return ApiResponse<ExperimentsSubjectTypeV2DTO> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Malformed subject type ID, malformed body, or no updatable field supplied. -
401 Missing or invalid authentication. -
403 Authenticated caller lacks the product_analytics_settings_write permission. -
404 No subject type with this ID exists for the organization. -
429 Too many requests -
+ */ + public ApiResponse patchSubjectTypeWithHttpInfo( + UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'subjectTypeId' is set + if (subjectTypeId == null) { + throw new ApiException( + 400, "Missing the required parameter 'subjectTypeId' when calling patchSubjectType"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling patchSubjectType"); + } + // create path and map variables + String localVarPath = + "/api/v2/experiments/subject-types/{subject_type_id}" + .replaceAll( + "\\{" + "subject_type_id" + "\\}", + apiClient.escapeString(subjectTypeId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ExperimentsApi.patchSubjectType", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Patch subject type. + * + *

See {@link #patchSubjectTypeWithHttpInfo}. + * + * @param subjectTypeId The UUID of the subject type. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<ExperimentsSubjectTypeV2DTO>> + */ + public CompletableFuture> + patchSubjectTypeWithHttpInfoAsync( + UUID subjectTypeId, ExperimentsPatchSubjectTypeV2Request body) { + Object localVarPostBody = body; + + // verify the required parameter 'subjectTypeId' is set + if (subjectTypeId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'subjectTypeId' when calling patchSubjectType")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling patchSubjectType")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/experiments/subject-types/{subject_type_id}" + .replaceAll( + "\\{" + "subject_type_id" + "\\}", + apiClient.escapeString(subjectTypeId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ExperimentsApi.patchSubjectType", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Publish experiment protocol. + * + *

See {@link #publishExperimentProtocolWithHttpInfo}. + * + * @param protocolId The UUID of the protocol. (required) + * @return ExperimentsPublicProtocolResponse + * @throws ApiException if fails to make API call + */ + public ExperimentsPublicProtocolResponse publishExperimentProtocol(UUID protocolId) + throws ApiException { + return publishExperimentProtocolWithHttpInfo(protocolId).getData(); + } + + /** + * Publish experiment protocol. + * + *

See {@link #publishExperimentProtocolWithHttpInfoAsync}. + * + * @param protocolId The UUID of the protocol. (required) + * @return CompletableFuture<ExperimentsPublicProtocolResponse> + */ + public CompletableFuture publishExperimentProtocolAsync( + UUID protocolId) { + return publishExperimentProtocolWithHttpInfoAsync(protocolId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Publish a valid draft protocol. The protocol must have a name and subject type. Supplied + * references and settings must be valid. An exposure schedule or targeting rules require an + * environment. Enabled limits require their values. Configurable template fields must have a + * value before they can be locked. + * + *

Independent configuration errors are returned together in the JSON:API errors array with + * source.pointer values that identify the fields. Earlier request and reference checks can stop + * on the first error. A failed request leaves the protocol unchanged. + * + * @param protocolId The UUID of the protocol. (required) + * @return ApiResponse<ExperimentsPublicProtocolResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Invalid request or protocol settings. -
401 Missing or invalid authentication. -
403 The caller lacks the product_analytics_experiments_write permission. -
404 No protocol with this ID exists in the organization. -
409 Only draft protocols can be published. -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse publishExperimentProtocolWithHttpInfo( + UUID protocolId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'protocolId' is set + if (protocolId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'protocolId' when calling publishExperimentProtocol"); + } + // create path and map variables + String localVarPath = + "/api/v2/experiments/protocols/{protocol_id}/publish" + .replaceAll( + "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ExperimentsApi.publishExperimentProtocol", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Publish experiment protocol. + * + *

See {@link #publishExperimentProtocolWithHttpInfo}. + * + * @param protocolId The UUID of the protocol. (required) + * @return CompletableFuture<ApiResponse<ExperimentsPublicProtocolResponse>> + */ + public CompletableFuture> + publishExperimentProtocolWithHttpInfoAsync(UUID protocolId) { + Object localVarPostBody = null; + + // verify the required parameter 'protocolId' is set + if (protocolId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'protocolId' when calling" + + " publishExperimentProtocol")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/experiments/protocols/{protocol_id}/publish" + .replaceAll( + "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ExperimentsApi.publishExperimentProtocol", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to refreshExperimentResults. */ + public static class RefreshExperimentResultsOptionalParameters { + private Boolean fullRefresh; + + /** + * Set fullRefresh. + * + * @param fullRefresh Force a full warehouse rebuild. Defaults to false when omitted. (optional) + * @return RefreshExperimentResultsOptionalParameters + */ + public RefreshExperimentResultsOptionalParameters fullRefresh(Boolean fullRefresh) { + this.fullRefresh = fullRefresh; + return this; + } + } + + /** + * Refresh experiment results. + * + *

See {@link #refreshExperimentResultsWithHttpInfo}. + * + * @param experimentId The UUID of the experiment. (required) + * @return ExperimentsRefreshExperimentResultsV2DTO + * @throws ApiException if fails to make API call + */ + public ExperimentsRefreshExperimentResultsV2DTO refreshExperimentResults(UUID experimentId) + throws ApiException { + return refreshExperimentResultsWithHttpInfo( + experimentId, new RefreshExperimentResultsOptionalParameters()) + .getData(); + } + + /** + * Refresh experiment results. + * + *

See {@link #refreshExperimentResultsWithHttpInfoAsync}. + * + * @param experimentId The UUID of the experiment. (required) + * @return CompletableFuture<ExperimentsRefreshExperimentResultsV2DTO> + */ public CompletableFuture refreshExperimentResultsAsync( UUID experimentId) { return refreshExperimentResultsWithHttpInfoAsync( @@ -7199,6 +8097,266 @@ public ExperimentsRefreshExperimentResultsV2DTOArray refreshExperimentResultsFor new GenericType() {}); } + /** Manage optional parameters to replaceExperimentProtocol. */ + public static class ReplaceExperimentProtocolOptionalParameters { + private String expectedUpdatedAt; + + /** + * Set expectedUpdatedAt. + * + * @param expectedUpdatedAt The updated_at value from the last read. Include the full timestamp, + * with fractional seconds. Returns 409 if another write changed the protocol. Omit to skip + * this check. (optional) + * @return ReplaceExperimentProtocolOptionalParameters + */ + public ReplaceExperimentProtocolOptionalParameters expectedUpdatedAt(String expectedUpdatedAt) { + this.expectedUpdatedAt = expectedUpdatedAt; + return this; + } + } + + /** + * Replace experiment protocol. + * + *

See {@link #replaceExperimentProtocolWithHttpInfo}. + * + * @param protocolId The UUID of the protocol. (required) + * @param body (required) + * @return ExperimentsPublicProtocolResponse + * @throws ApiException if fails to make API call + */ + public ExperimentsPublicProtocolResponse replaceExperimentProtocol( + UUID protocolId, ExperimentsReplaceExperimentProtocolRequest body) throws ApiException { + return replaceExperimentProtocolWithHttpInfo( + protocolId, body, new ReplaceExperimentProtocolOptionalParameters()) + .getData(); + } + + /** + * Replace experiment protocol. + * + *

See {@link #replaceExperimentProtocolWithHttpInfoAsync}. + * + * @param protocolId The UUID of the protocol. (required) + * @param body (required) + * @return CompletableFuture<ExperimentsPublicProtocolResponse> + */ + public CompletableFuture replaceExperimentProtocolAsync( + UUID protocolId, ExperimentsReplaceExperimentProtocolRequest body) { + return replaceExperimentProtocolWithHttpInfoAsync( + protocolId, body, new ReplaceExperimentProtocolOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Replace experiment protocol. + * + *

See {@link #replaceExperimentProtocolWithHttpInfo}. + * + * @param protocolId The UUID of the protocol. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return ExperimentsPublicProtocolResponse + * @throws ApiException if fails to make API call + */ + public ExperimentsPublicProtocolResponse replaceExperimentProtocol( + UUID protocolId, + ExperimentsReplaceExperimentProtocolRequest body, + ReplaceExperimentProtocolOptionalParameters parameters) + throws ApiException { + return replaceExperimentProtocolWithHttpInfo(protocolId, body, parameters).getData(); + } + + /** + * Replace experiment protocol. + * + *

See {@link #replaceExperimentProtocolWithHttpInfoAsync}. + * + * @param protocolId The UUID of the protocol. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ExperimentsPublicProtocolResponse> + */ + public CompletableFuture replaceExperimentProtocolAsync( + UUID protocolId, + ExperimentsReplaceExperimentProtocolRequest body, + ReplaceExperimentProtocolOptionalParameters parameters) { + return replaceExperimentProtocolWithHttpInfoAsync(protocolId, body, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Replace the template of a published protocol. Draft and archived protocols return 409. Send + * subject_type_id, all four required boolean settings, and metric_groups. Omitted optional + * template fields are cleared. Omitted enforcement keeps the existing locks. + * + *

Use primary_metric_id to select the primary metric. Use default_duration_days to set + * target_duration_days on experiments created from the protocol. The nested metric is_primary and + * analysis_plan.target_duration_days fields are rejected. An unchanged GET response can be sent + * as the request body. Response-only fields are ignored. + * + *

Independent configuration errors are returned together in the JSON:API errors array. Each + * error identifies the field in source.pointer. Earlier request and reference checks can stop on + * the first error. A failed request leaves the protocol unchanged. Changes apply to future + * experiments; existing experiments keep their settings. + * + * @param protocolId The UUID of the protocol. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<ExperimentsPublicProtocolResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Invalid request or protocol settings. -
401 Missing or invalid authentication. -
403 The caller lacks the product_analytics_experiments_write permission. -
404 No protocol with this ID exists in the organization. -
409 The protocol is not published or expected_updated_at is stale. -
415 Unsupported request content type. -
429 Too many requests -
500 Internal Server Error -
+ */ + public ApiResponse replaceExperimentProtocolWithHttpInfo( + UUID protocolId, + ExperimentsReplaceExperimentProtocolRequest body, + ReplaceExperimentProtocolOptionalParameters parameters) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'protocolId' is set + if (protocolId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'protocolId' when calling replaceExperimentProtocol"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling replaceExperimentProtocol"); + } + String expectedUpdatedAt = parameters.expectedUpdatedAt; + // create path and map variables + String localVarPath = + "/api/v2/experiments/protocols/{protocol_id}" + .replaceAll( + "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "expected_updated_at", expectedUpdatedAt)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ExperimentsApi.replaceExperimentProtocol", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Replace experiment protocol. + * + *

See {@link #replaceExperimentProtocolWithHttpInfo}. + * + * @param protocolId The UUID of the protocol. (required) + * @param body (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ExperimentsPublicProtocolResponse>> + */ + public CompletableFuture> + replaceExperimentProtocolWithHttpInfoAsync( + UUID protocolId, + ExperimentsReplaceExperimentProtocolRequest body, + ReplaceExperimentProtocolOptionalParameters parameters) { + Object localVarPostBody = body; + + // verify the required parameter 'protocolId' is set + if (protocolId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'protocolId' when calling" + + " replaceExperimentProtocol")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling replaceExperimentProtocol")); + return result; + } + String expectedUpdatedAt = parameters.expectedUpdatedAt; + // create path and map variables + String localVarPath = + "/api/v2/experiments/protocols/{protocol_id}" + .replaceAll( + "\\{" + "protocol_id" + "\\}", apiClient.escapeString(protocolId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "expected_updated_at", expectedUpdatedAt)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ExperimentsApi.replaceExperimentProtocol", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Set default subject type. * diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequest.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequest.java new file mode 100644 index 00000000000..bf5033e65bc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequest.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Create a draft protocol with the organization default subject type. */ +@JsonPropertyOrder({ExperimentsCreateExperimentProtocolRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsCreateExperimentProtocolRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ExperimentsCreateExperimentProtocolRequestData data; + + public ExperimentsCreateExperimentProtocolRequest() {} + + @JsonCreator + public ExperimentsCreateExperimentProtocolRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ExperimentsCreateExperimentProtocolRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ExperimentsCreateExperimentProtocolRequest data( + ExperimentsCreateExperimentProtocolRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * JSON:API protocol request resource. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ExperimentsCreateExperimentProtocolRequestData getData() { + return data; + } + + public void setData(ExperimentsCreateExperimentProtocolRequestData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsCreateExperimentProtocolRequest + */ + @JsonAnySetter + public ExperimentsCreateExperimentProtocolRequest putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsCreateExperimentProtocolRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsCreateExperimentProtocolRequest experimentsCreateExperimentProtocolRequest = + (ExperimentsCreateExperimentProtocolRequest) o; + return Objects.equals(this.data, experimentsCreateExperimentProtocolRequest.data) + && Objects.equals( + this.additionalProperties, + experimentsCreateExperimentProtocolRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsCreateExperimentProtocolRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestData.java new file mode 100644 index 00000000000..36045f63393 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestData.java @@ -0,0 +1,193 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** JSON:API protocol request resource. */ +@JsonPropertyOrder({ + ExperimentsCreateExperimentProtocolRequestData.JSON_PROPERTY_ATTRIBUTES, + ExperimentsCreateExperimentProtocolRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsCreateExperimentProtocolRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ExperimentsCreateExperimentProtocolRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ExperimentsPublicProtocolResponseDataType type = + ExperimentsPublicProtocolResponseDataType.PROTOCOLS; + + public ExperimentsCreateExperimentProtocolRequestData() {} + + @JsonCreator + public ExperimentsCreateExperimentProtocolRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ExperimentsCreateExperimentProtocolRequestDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ExperimentsPublicProtocolResponseDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ExperimentsCreateExperimentProtocolRequestData attributes( + ExperimentsCreateExperimentProtocolRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Create a draft protocol with the organization default subject type. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ExperimentsCreateExperimentProtocolRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ExperimentsCreateExperimentProtocolRequestDataAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ExperimentsCreateExperimentProtocolRequestData type( + ExperimentsPublicProtocolResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Protocols resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ExperimentsPublicProtocolResponseDataType getType() { + return type; + } + + public void setType(ExperimentsPublicProtocolResponseDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsCreateExperimentProtocolRequestData + */ + @JsonAnySetter + public ExperimentsCreateExperimentProtocolRequestData putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsCreateExperimentProtocolRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsCreateExperimentProtocolRequestData experimentsCreateExperimentProtocolRequestData = + (ExperimentsCreateExperimentProtocolRequestData) o; + return Objects.equals( + this.attributes, experimentsCreateExperimentProtocolRequestData.attributes) + && Objects.equals(this.type, experimentsCreateExperimentProtocolRequestData.type) + && Objects.equals( + this.additionalProperties, + experimentsCreateExperimentProtocolRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsCreateExperimentProtocolRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestDataAttributes.java new file mode 100644 index 00000000000..7d4eeb40ec2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsCreateExperimentProtocolRequestDataAttributes.java @@ -0,0 +1,249 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Create a draft protocol with the organization default subject type. */ +@JsonPropertyOrder({ + ExperimentsCreateExperimentProtocolRequestDataAttributes.JSON_PROPERTY_DESCRIPTION, + ExperimentsCreateExperimentProtocolRequestDataAttributes.JSON_PROPERTY_MIGRATION_METADATA, + ExperimentsCreateExperimentProtocolRequestDataAttributes.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsCreateExperimentProtocolRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private JsonNullable description = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MIGRATION_METADATA = "migration_metadata"; + private JsonNullable> migrationMetadata = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public ExperimentsCreateExperimentProtocolRequestDataAttributes() {} + + @JsonCreator + public ExperimentsCreateExperimentProtocolRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) { + this.name = name; + } + + public ExperimentsCreateExperimentProtocolRequestDataAttributes description(String description) { + this.description = JsonNullable.of(description); + return this; + } + + /** + * Optional text that explains the protocol. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getDescription() { + return description.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDescription_JsonNullable() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + public void setDescription_JsonNullable(JsonNullable description) { + this.description = description; + } + + public void setDescription(String description) { + this.description = JsonNullable.of(description); + } + + public ExperimentsCreateExperimentProtocolRequestDataAttributes migrationMetadata( + Map migrationMetadata) { + this.migrationMetadata = JsonNullable.>of(migrationMetadata); + return this; + } + + public ExperimentsCreateExperimentProtocolRequestDataAttributes putMigrationMetadataItem( + String key, Object migrationMetadataItem) { + if (this.migrationMetadata == null || !this.migrationMetadata.isPresent()) { + this.migrationMetadata = JsonNullable.>of(new HashMap<>()); + } + try { + this.migrationMetadata.get().put(key, migrationMetadataItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Metadata for imported resources. Must encode to at most 4096 bytes. Null clears it; omission + * preserves it on update. + * + * @return migrationMetadata + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Map getMigrationMetadata() { + return migrationMetadata.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MIGRATION_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getMigrationMetadata_JsonNullable() { + return migrationMetadata; + } + + @JsonProperty(JSON_PROPERTY_MIGRATION_METADATA) + public void setMigrationMetadata_JsonNullable( + JsonNullable> migrationMetadata) { + this.migrationMetadata = migrationMetadata; + } + + public void setMigrationMetadata(Map migrationMetadata) { + this.migrationMetadata = JsonNullable.>of(migrationMetadata); + } + + public ExperimentsCreateExperimentProtocolRequestDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Protocol name. Leading and trailing spaces are removed. The trimmed name must contain 1 to 255 + * characters. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsCreateExperimentProtocolRequestDataAttributes + */ + @JsonAnySetter + public ExperimentsCreateExperimentProtocolRequestDataAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this ExperimentsCreateExperimentProtocolRequestDataAttributes object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsCreateExperimentProtocolRequestDataAttributes + experimentsCreateExperimentProtocolRequestDataAttributes = + (ExperimentsCreateExperimentProtocolRequestDataAttributes) o; + return Objects.equals( + this.description, experimentsCreateExperimentProtocolRequestDataAttributes.description) + && Objects.equals( + this.migrationMetadata, + experimentsCreateExperimentProtocolRequestDataAttributes.migrationMetadata) + && Objects.equals(this.name, experimentsCreateExperimentProtocolRequestDataAttributes.name) + && Objects.equals( + this.additionalProperties, + experimentsCreateExperimentProtocolRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, migrationMetadata, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsCreateExperimentProtocolRequestDataAttributes {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" migrationMetadata: ").append(toIndentedString(migrationMetadata)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchExperimentProtocolRequest.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchExperimentProtocolRequest.java new file mode 100644 index 00000000000..4cd2f31ea1b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchExperimentProtocolRequest.java @@ -0,0 +1,156 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Partial protocol update. Omitted attributes remain unchanged. Published protocols accept only + * name, description, and migration_metadata; archived protocols reject updates. + */ +@JsonPropertyOrder({ExperimentsPatchExperimentProtocolRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsPatchExperimentProtocolRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ExperimentsPatchExperimentProtocolRequestData data; + + public ExperimentsPatchExperimentProtocolRequest() {} + + @JsonCreator + public ExperimentsPatchExperimentProtocolRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ExperimentsPatchExperimentProtocolRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ExperimentsPatchExperimentProtocolRequest data( + ExperimentsPatchExperimentProtocolRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * JSON:API protocol request resource. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ExperimentsPatchExperimentProtocolRequestData getData() { + return data; + } + + public void setData(ExperimentsPatchExperimentProtocolRequestData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsPatchExperimentProtocolRequest + */ + @JsonAnySetter + public ExperimentsPatchExperimentProtocolRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsPatchExperimentProtocolRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsPatchExperimentProtocolRequest experimentsPatchExperimentProtocolRequest = + (ExperimentsPatchExperimentProtocolRequest) o; + return Objects.equals(this.data, experimentsPatchExperimentProtocolRequest.data) + && Objects.equals( + this.additionalProperties, + experimentsPatchExperimentProtocolRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsPatchExperimentProtocolRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchExperimentProtocolRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchExperimentProtocolRequestData.java new file mode 100644 index 00000000000..dbdcf039bde --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchExperimentProtocolRequestData.java @@ -0,0 +1,218 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** JSON:API protocol request resource. */ +@JsonPropertyOrder({ + ExperimentsPatchExperimentProtocolRequestData.JSON_PROPERTY_ATTRIBUTES, + ExperimentsPatchExperimentProtocolRequestData.JSON_PROPERTY_ID, + ExperimentsPatchExperimentProtocolRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsPatchExperimentProtocolRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ExperimentsPatchExperimentProtocolRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ExperimentsPublicProtocolResponseDataType type = + ExperimentsPublicProtocolResponseDataType.PROTOCOLS; + + public ExperimentsPatchExperimentProtocolRequestData() {} + + @JsonCreator + public ExperimentsPatchExperimentProtocolRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ExperimentsPublicProtocolResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ExperimentsPatchExperimentProtocolRequestData attributes( + ExperimentsPatchExperimentProtocolRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Partial protocol update. Omitted attributes remain unchanged. Published protocols accept only + * name, description, and migration_metadata; archived protocols reject updates. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ExperimentsPatchExperimentProtocolRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ExperimentsPatchExperimentProtocolRequestDataAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ExperimentsPatchExperimentProtocolRequestData id(UUID id) { + this.id = id; + return this; + } + + /** + * Protocol ID. If supplied, must match the path protocol_id. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public ExperimentsPatchExperimentProtocolRequestData type( + ExperimentsPublicProtocolResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Protocols resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ExperimentsPublicProtocolResponseDataType getType() { + return type; + } + + public void setType(ExperimentsPublicProtocolResponseDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsPatchExperimentProtocolRequestData + */ + @JsonAnySetter + public ExperimentsPatchExperimentProtocolRequestData putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsPatchExperimentProtocolRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsPatchExperimentProtocolRequestData experimentsPatchExperimentProtocolRequestData = + (ExperimentsPatchExperimentProtocolRequestData) o; + return Objects.equals(this.attributes, experimentsPatchExperimentProtocolRequestData.attributes) + && Objects.equals(this.id, experimentsPatchExperimentProtocolRequestData.id) + && Objects.equals(this.type, experimentsPatchExperimentProtocolRequestData.type) + && Objects.equals( + this.additionalProperties, + experimentsPatchExperimentProtocolRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsPatchExperimentProtocolRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchExperimentProtocolRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchExperimentProtocolRequestDataAttributes.java new file mode 100644 index 00000000000..83749bec15c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchExperimentProtocolRequestDataAttributes.java @@ -0,0 +1,1123 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Partial protocol update. Omitted attributes remain unchanged. Published protocols accept only + * name, description, and migration_metadata; archived protocols reject updates. + */ +@JsonPropertyOrder({ + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_ANALYSIS_PLAN, + ExperimentsPatchExperimentProtocolRequestDataAttributes + .JSON_PROPERTY_ASSIGNMENT_SOURCE_DEFAULT_PROPERTIES, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_ASSIGNMENT_SOURCE_ID, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_DEFAULT_DURATION_DAYS, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_DESCRIPTION, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_ENFORCEMENT, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_ENVIRONMENT_ID, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_EXPOSURE_SCHEDULE, + ExperimentsPatchExperimentProtocolRequestDataAttributes + .JSON_PROPERTY_IS_DURATION_REQUIRED_TO_START, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_IS_EQUAL_SPLIT_ENFORCED, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_IS_METRIC_LIMIT_ENABLED, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_IS_MINIMUM_DURATION_ENABLED, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_METRIC_GROUPS, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_METRIC_LIMIT, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_MIGRATION_METADATA, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_MINIMUM_DURATION_UNIT, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_MINIMUM_DURATION_VALUE, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_NAME, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_PRIMARY_METRIC_ID, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_SUBJECT_TYPE_ID, + ExperimentsPatchExperimentProtocolRequestDataAttributes.JSON_PROPERTY_TARGETING_RULES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsPatchExperimentProtocolRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANALYSIS_PLAN = "analysis_plan"; + private JsonNullable analysisPlan = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ASSIGNMENT_SOURCE_DEFAULT_PROPERTIES = + "assignment_source_default_properties"; + private JsonNullable< + List< + ExperimentsPublicProtocolResponseDataAttributesAssignmentSourceDefaultPropertiesItems>> + assignmentSourceDefaultProperties = + JsonNullable + .> + undefined(); + + public static final String JSON_PROPERTY_ASSIGNMENT_SOURCE_ID = "assignment_source_id"; + private JsonNullable assignmentSourceId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DEFAULT_DURATION_DAYS = "default_duration_days"; + private JsonNullable defaultDurationDays = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private JsonNullable description = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ENFORCEMENT = "enforcement"; + private JsonNullable enforcement = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ENVIRONMENT_ID = "environment_id"; + private JsonNullable environmentId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_EXPOSURE_SCHEDULE = "exposure_schedule"; + private JsonNullable exposureSchedule = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_DURATION_REQUIRED_TO_START = + "is_duration_required_to_start"; + private JsonNullable isDurationRequiredToStart = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_EQUAL_SPLIT_ENFORCED = "is_equal_split_enforced"; + private JsonNullable isEqualSplitEnforced = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_METRIC_LIMIT_ENABLED = "is_metric_limit_enabled"; + private JsonNullable isMetricLimitEnabled = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_MINIMUM_DURATION_ENABLED = + "is_minimum_duration_enabled"; + private JsonNullable isMinimumDurationEnabled = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_METRIC_GROUPS = "metric_groups"; + private JsonNullable> metricGroups = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_METRIC_LIMIT = "metric_limit"; + private JsonNullable metricLimit = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MIGRATION_METADATA = "migration_metadata"; + private JsonNullable> migrationMetadata = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_MINIMUM_DURATION_UNIT = "minimum_duration_unit"; + private JsonNullable minimumDurationUnit = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MINIMUM_DURATION_VALUE = "minimum_duration_value"; + private JsonNullable minimumDurationValue = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NAME = "name"; + private JsonNullable name = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PRIMARY_METRIC_ID = "primary_metric_id"; + private JsonNullable primaryMetricId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SUBJECT_TYPE_ID = "subject_type_id"; + private JsonNullable subjectTypeId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TARGETING_RULES = "targeting_rules"; + private JsonNullable> targetingRules = + JsonNullable.>undefined(); + + public ExperimentsPatchExperimentProtocolRequestDataAttributes analysisPlan( + ExperimentsPatchProtocolAnalysisPlanInput analysisPlan) { + this.analysisPlan = JsonNullable.of(analysisPlan); + return this; + } + + /** + * Partial statistical settings. Omitted fields remain unchanged. Null clears the whole plan. Null + * clears nullable fields; null or an empty string clears confidence_interval_method. + * + * @return analysisPlan + */ + @jakarta.annotation.Nullable + @JsonIgnore + public ExperimentsPatchProtocolAnalysisPlanInput getAnalysisPlan() { + return analysisPlan.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ANALYSIS_PLAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAnalysisPlan_JsonNullable() { + return analysisPlan; + } + + @JsonProperty(JSON_PROPERTY_ANALYSIS_PLAN) + public void setAnalysisPlan_JsonNullable( + JsonNullable analysisPlan) { + this.analysisPlan = analysisPlan; + } + + public void setAnalysisPlan(ExperimentsPatchProtocolAnalysisPlanInput analysisPlan) { + this.analysisPlan = JsonNullable.of(analysisPlan); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes assignmentSourceDefaultProperties( + List + assignmentSourceDefaultProperties) { + this.assignmentSourceDefaultProperties = + JsonNullable + .> + of(assignmentSourceDefaultProperties); + return this; + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes + addAssignmentSourceDefaultPropertiesItem( + ExperimentsPublicProtocolResponseDataAttributesAssignmentSourceDefaultPropertiesItems + assignmentSourceDefaultPropertiesItem) { + if (this.assignmentSourceDefaultProperties == null + || !this.assignmentSourceDefaultProperties.isPresent()) { + this.assignmentSourceDefaultProperties = + JsonNullable + .> + of(new ArrayList<>()); + } + try { + this.assignmentSourceDefaultProperties.get().add(assignmentSourceDefaultPropertiesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Assignment properties. Omission or null preserves them; an array replaces them. + * + * @return assignmentSourceDefaultProperties + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List + getAssignmentSourceDefaultProperties() { + return assignmentSourceDefaultProperties.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_SOURCE_DEFAULT_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable< + List< + ExperimentsPublicProtocolResponseDataAttributesAssignmentSourceDefaultPropertiesItems>> + getAssignmentSourceDefaultProperties_JsonNullable() { + return assignmentSourceDefaultProperties; + } + + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_SOURCE_DEFAULT_PROPERTIES) + public void setAssignmentSourceDefaultProperties_JsonNullable( + JsonNullable< + List< + ExperimentsPublicProtocolResponseDataAttributesAssignmentSourceDefaultPropertiesItems>> + assignmentSourceDefaultProperties) { + this.assignmentSourceDefaultProperties = assignmentSourceDefaultProperties; + } + + public void setAssignmentSourceDefaultProperties( + List + assignmentSourceDefaultProperties) { + this.assignmentSourceDefaultProperties = + JsonNullable + .> + of(assignmentSourceDefaultProperties); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes assignmentSourceId( + String assignmentSourceId) { + this.assignmentSourceId = JsonNullable.of(assignmentSourceId); + return this; + } + + /** + * ID of the assignment source selected by the protocol. Omission or null keeps the current value. + * An empty string clears it. + * + * @return assignmentSourceId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getAssignmentSourceId() { + return assignmentSourceId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAssignmentSourceId_JsonNullable() { + return assignmentSourceId; + } + + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_SOURCE_ID) + public void setAssignmentSourceId_JsonNullable(JsonNullable assignmentSourceId) { + this.assignmentSourceId = assignmentSourceId; + } + + public void setAssignmentSourceId(String assignmentSourceId) { + this.assignmentSourceId = JsonNullable.of(assignmentSourceId); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes defaultDurationDays( + Long defaultDurationDays) { + this.defaultDurationDays = JsonNullable.of(defaultDurationDays); + return this; + } + + /** + * Default experiment duration supplied by the protocol, in days. Omission preserves it; null + * clears it. Sets analysis_plan.target_duration_days on experiments created from this protocol. + * minimum: 0 + * + * @return defaultDurationDays + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getDefaultDurationDays() { + return defaultDurationDays.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_DURATION_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDefaultDurationDays_JsonNullable() { + return defaultDurationDays; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_DURATION_DAYS) + public void setDefaultDurationDays_JsonNullable(JsonNullable defaultDurationDays) { + this.defaultDurationDays = defaultDurationDays; + } + + public void setDefaultDurationDays(Long defaultDurationDays) { + this.defaultDurationDays = JsonNullable.of(defaultDurationDays); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes description(String description) { + this.description = JsonNullable.of(description); + return this; + } + + /** + * Description. Empty string clears it; omission or null preserves it. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getDescription() { + return description.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDescription_JsonNullable() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + public void setDescription_JsonNullable(JsonNullable description) { + this.description = description; + } + + public void setDescription(String description) { + this.description = JsonNullable.of(description); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes enforcement( + ExperimentsPatchProtocolEnforcementInput enforcement) { + this.enforcement = JsonNullable.of(enforcement); + return this; + } + + /** + * Partial lock map. Omitted fields remain unchanged. Null clears the whole map. Empty or null + * field values become EDITABLE, except subject_type, flag_source + * , and confidence_interval_method, which remain LOCKED. + * + * @return enforcement + */ + @jakarta.annotation.Nullable + @JsonIgnore + public ExperimentsPatchProtocolEnforcementInput getEnforcement() { + return enforcement.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ENFORCEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getEnforcement_JsonNullable() { + return enforcement; + } + + @JsonProperty(JSON_PROPERTY_ENFORCEMENT) + public void setEnforcement_JsonNullable( + JsonNullable enforcement) { + this.enforcement = enforcement; + } + + public void setEnforcement(ExperimentsPatchProtocolEnforcementInput enforcement) { + this.enforcement = JsonNullable.of(enforcement); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes environmentId( + String environmentId) { + this.environmentId = JsonNullable.of(environmentId); + return this; + } + + /** + * ID of the feature flag environment used by the experiment. Omission or null keeps the current + * value. An empty string clears it. + * + * @return environmentId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getEnvironmentId() { + return environmentId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ENVIRONMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getEnvironmentId_JsonNullable() { + return environmentId; + } + + @JsonProperty(JSON_PROPERTY_ENVIRONMENT_ID) + public void setEnvironmentId_JsonNullable(JsonNullable environmentId) { + this.environmentId = environmentId; + } + + public void setEnvironmentId(String environmentId) { + this.environmentId = JsonNullable.of(environmentId); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes exposureSchedule( + ExperimentsPatchProtocolExposureScheduleInput exposureSchedule) { + this.exposureSchedule = + JsonNullable.of(exposureSchedule); + return this; + } + + /** + * Partial traffic schedule. Omitted fields remain unchanged. Null clears the whole schedule. Null + * clears nullable fields and rollout_steps; null sets strategy to an empty string and + * autostart to false. + * + * @return exposureSchedule + */ + @jakarta.annotation.Nullable + @JsonIgnore + public ExperimentsPatchProtocolExposureScheduleInput getExposureSchedule() { + return exposureSchedule.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_EXPOSURE_SCHEDULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable + getExposureSchedule_JsonNullable() { + return exposureSchedule; + } + + @JsonProperty(JSON_PROPERTY_EXPOSURE_SCHEDULE) + public void setExposureSchedule_JsonNullable( + JsonNullable exposureSchedule) { + this.exposureSchedule = exposureSchedule; + } + + public void setExposureSchedule(ExperimentsPatchProtocolExposureScheduleInput exposureSchedule) { + this.exposureSchedule = + JsonNullable.of(exposureSchedule); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes isDurationRequiredToStart( + Boolean isDurationRequiredToStart) { + this.isDurationRequiredToStart = JsonNullable.of(isDurationRequiredToStart); + return this; + } + + /** + * Whether the protocol requires a duration before an experiment can start. Omission or null + * preserves it. + * + * @return isDurationRequiredToStart + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsDurationRequiredToStart() { + return isDurationRequiredToStart.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_DURATION_REQUIRED_TO_START) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsDurationRequiredToStart_JsonNullable() { + return isDurationRequiredToStart; + } + + @JsonProperty(JSON_PROPERTY_IS_DURATION_REQUIRED_TO_START) + public void setIsDurationRequiredToStart_JsonNullable( + JsonNullable isDurationRequiredToStart) { + this.isDurationRequiredToStart = isDurationRequiredToStart; + } + + public void setIsDurationRequiredToStart(Boolean isDurationRequiredToStart) { + this.isDurationRequiredToStart = JsonNullable.of(isDurationRequiredToStart); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes isEqualSplitEnforced( + Boolean isEqualSplitEnforced) { + this.isEqualSplitEnforced = JsonNullable.of(isEqualSplitEnforced); + return this; + } + + /** + * Whether the protocol requires equal traffic allocation across variants. Omission or null + * preserves it. + * + * @return isEqualSplitEnforced + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsEqualSplitEnforced() { + return isEqualSplitEnforced.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_EQUAL_SPLIT_ENFORCED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsEqualSplitEnforced_JsonNullable() { + return isEqualSplitEnforced; + } + + @JsonProperty(JSON_PROPERTY_IS_EQUAL_SPLIT_ENFORCED) + public void setIsEqualSplitEnforced_JsonNullable(JsonNullable isEqualSplitEnforced) { + this.isEqualSplitEnforced = isEqualSplitEnforced; + } + + public void setIsEqualSplitEnforced(Boolean isEqualSplitEnforced) { + this.isEqualSplitEnforced = JsonNullable.of(isEqualSplitEnforced); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes isMetricLimitEnabled( + Boolean isMetricLimitEnabled) { + this.isMetricLimitEnabled = JsonNullable.of(isMetricLimitEnabled); + return this; + } + + /** + * Whether the protocol limits the number of metrics. Omission or null preserves it. + * + * @return isMetricLimitEnabled + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsMetricLimitEnabled() { + return isMetricLimitEnabled.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_METRIC_LIMIT_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsMetricLimitEnabled_JsonNullable() { + return isMetricLimitEnabled; + } + + @JsonProperty(JSON_PROPERTY_IS_METRIC_LIMIT_ENABLED) + public void setIsMetricLimitEnabled_JsonNullable(JsonNullable isMetricLimitEnabled) { + this.isMetricLimitEnabled = isMetricLimitEnabled; + } + + public void setIsMetricLimitEnabled(Boolean isMetricLimitEnabled) { + this.isMetricLimitEnabled = JsonNullable.of(isMetricLimitEnabled); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes isMinimumDurationEnabled( + Boolean isMinimumDurationEnabled) { + this.isMinimumDurationEnabled = JsonNullable.of(isMinimumDurationEnabled); + return this; + } + + /** + * Whether the protocol enforces a minimum experiment duration. Omission or null preserves it. + * + * @return isMinimumDurationEnabled + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getIsMinimumDurationEnabled() { + return isMinimumDurationEnabled.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_IS_MINIMUM_DURATION_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIsMinimumDurationEnabled_JsonNullable() { + return isMinimumDurationEnabled; + } + + @JsonProperty(JSON_PROPERTY_IS_MINIMUM_DURATION_ENABLED) + public void setIsMinimumDurationEnabled_JsonNullable( + JsonNullable isMinimumDurationEnabled) { + this.isMinimumDurationEnabled = isMinimumDurationEnabled; + } + + public void setIsMinimumDurationEnabled(Boolean isMinimumDurationEnabled) { + this.isMinimumDurationEnabled = JsonNullable.of(isMinimumDurationEnabled); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes metricGroups( + List metricGroups) { + this.metricGroups = JsonNullable.>of(metricGroups); + return this; + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes addMetricGroupsItem( + ExperimentsProtocolMetricGroupInput metricGroupsItem) { + if (this.metricGroups == null || !this.metricGroups.isPresent()) { + this.metricGroups = + JsonNullable.>of(new ArrayList<>()); + } + try { + this.metricGroups.get().add(metricGroupsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Metric groups. Omission or null preserves them; an array replaces them. + * + * @return metricGroups + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getMetricGroups() { + return metricGroups.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_METRIC_GROUPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getMetricGroups_JsonNullable() { + return metricGroups; + } + + @JsonProperty(JSON_PROPERTY_METRIC_GROUPS) + public void setMetricGroups_JsonNullable( + JsonNullable> metricGroups) { + this.metricGroups = metricGroups; + } + + public void setMetricGroups(List metricGroups) { + this.metricGroups = JsonNullable.>of(metricGroups); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes metricLimit(Long metricLimit) { + this.metricLimit = JsonNullable.of(metricLimit); + return this; + } + + /** + * Maximum number of metrics allowed by the protocol. Omission preserves it; null clears it. + * minimum: 0 + * + * @return metricLimit + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getMetricLimit() { + return metricLimit.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_METRIC_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getMetricLimit_JsonNullable() { + return metricLimit; + } + + @JsonProperty(JSON_PROPERTY_METRIC_LIMIT) + public void setMetricLimit_JsonNullable(JsonNullable metricLimit) { + this.metricLimit = metricLimit; + } + + public void setMetricLimit(Long metricLimit) { + this.metricLimit = JsonNullable.of(metricLimit); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes migrationMetadata( + Map migrationMetadata) { + this.migrationMetadata = JsonNullable.>of(migrationMetadata); + return this; + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes putMigrationMetadataItem( + String key, Object migrationMetadataItem) { + if (this.migrationMetadata == null || !this.migrationMetadata.isPresent()) { + this.migrationMetadata = JsonNullable.>of(new HashMap<>()); + } + try { + this.migrationMetadata.get().put(key, migrationMetadataItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Metadata for imported resources. Must encode to at most 4096 bytes. Null clears it; omission + * preserves it on update. + * + * @return migrationMetadata + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Map getMigrationMetadata() { + return migrationMetadata.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MIGRATION_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getMigrationMetadata_JsonNullable() { + return migrationMetadata; + } + + @JsonProperty(JSON_PROPERTY_MIGRATION_METADATA) + public void setMigrationMetadata_JsonNullable( + JsonNullable> migrationMetadata) { + this.migrationMetadata = migrationMetadata; + } + + public void setMigrationMetadata(Map migrationMetadata) { + this.migrationMetadata = JsonNullable.>of(migrationMetadata); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes minimumDurationUnit( + String minimumDurationUnit) { + this.minimumDurationUnit = JsonNullable.of(minimumDurationUnit); + return this; + } + + /** + * Minimum duration unit, DAYS or WEEKS. Empty string clears it. + * Omission or null preserves it. + * + * @return minimumDurationUnit + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getMinimumDurationUnit() { + return minimumDurationUnit.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MINIMUM_DURATION_UNIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getMinimumDurationUnit_JsonNullable() { + return minimumDurationUnit; + } + + @JsonProperty(JSON_PROPERTY_MINIMUM_DURATION_UNIT) + public void setMinimumDurationUnit_JsonNullable(JsonNullable minimumDurationUnit) { + this.minimumDurationUnit = minimumDurationUnit; + } + + public void setMinimumDurationUnit(String minimumDurationUnit) { + this.minimumDurationUnit = JsonNullable.of(minimumDurationUnit); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes minimumDurationValue( + Long minimumDurationValue) { + this.minimumDurationValue = JsonNullable.of(minimumDurationValue); + return this; + } + + /** + * Minimum experiment duration in the specified unit. Omission preserves it; null clears it. + * minimum: 0 + * + * @return minimumDurationValue + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getMinimumDurationValue() { + return minimumDurationValue.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MINIMUM_DURATION_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getMinimumDurationValue_JsonNullable() { + return minimumDurationValue; + } + + @JsonProperty(JSON_PROPERTY_MINIMUM_DURATION_VALUE) + public void setMinimumDurationValue_JsonNullable(JsonNullable minimumDurationValue) { + this.minimumDurationValue = minimumDurationValue; + } + + public void setMinimumDurationValue(Long minimumDurationValue) { + this.minimumDurationValue = JsonNullable.of(minimumDurationValue); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes name(String name) { + this.name = JsonNullable.of(name); + return this; + } + + /** + * Protocol name. Leading and trailing spaces are removed. The trimmed name must contain 1 to 255 + * characters. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getName() { + return name.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getName_JsonNullable() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + public void setName_JsonNullable(JsonNullable name) { + this.name = name; + } + + public void setName(String name) { + this.name = JsonNullable.of(name); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes primaryMetricId( + String primaryMetricId) { + this.primaryMetricId = JsonNullable.of(primaryMetricId); + return this; + } + + /** + * ID of the primary metric supplied by the protocol. Omission or null keeps the current value. An + * empty string clears it. + * + * @return primaryMetricId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getPrimaryMetricId() { + return primaryMetricId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_METRIC_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrimaryMetricId_JsonNullable() { + return primaryMetricId; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_METRIC_ID) + public void setPrimaryMetricId_JsonNullable(JsonNullable primaryMetricId) { + this.primaryMetricId = primaryMetricId; + } + + public void setPrimaryMetricId(String primaryMetricId) { + this.primaryMetricId = JsonNullable.of(primaryMetricId); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes subjectTypeId( + String subjectTypeId) { + this.subjectTypeId = JsonNullable.of(subjectTypeId); + return this; + } + + /** + * ID of the subject type used by this configuration. Omission or null keeps the current value. An + * empty string clears it. + * + * @return subjectTypeId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getSubjectTypeId() { + return subjectTypeId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_TYPE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSubjectTypeId_JsonNullable() { + return subjectTypeId; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_TYPE_ID) + public void setSubjectTypeId_JsonNullable(JsonNullable subjectTypeId) { + this.subjectTypeId = subjectTypeId; + } + + public void setSubjectTypeId(String subjectTypeId) { + this.subjectTypeId = JsonNullable.of(subjectTypeId); + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes targetingRules( + List targetingRules) { + this.targetingRules = + JsonNullable.>of(targetingRules); + return this; + } + + public ExperimentsPatchExperimentProtocolRequestDataAttributes addTargetingRulesItem( + ExperimentsProtocolTargetingRuleInput targetingRulesItem) { + if (this.targetingRules == null || !this.targetingRules.isPresent()) { + this.targetingRules = + JsonNullable.>of(new ArrayList<>()); + } + try { + this.targetingRules.get().add(targetingRulesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Targeting rules. Omission or null preserves them; an array replaces them. + * + * @return targetingRules + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getTargetingRules() { + return targetingRules.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TARGETING_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> + getTargetingRules_JsonNullable() { + return targetingRules; + } + + @JsonProperty(JSON_PROPERTY_TARGETING_RULES) + public void setTargetingRules_JsonNullable( + JsonNullable> targetingRules) { + this.targetingRules = targetingRules; + } + + public void setTargetingRules(List targetingRules) { + this.targetingRules = + JsonNullable.>of(targetingRules); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsPatchExperimentProtocolRequestDataAttributes + */ + @JsonAnySetter + public ExperimentsPatchExperimentProtocolRequestDataAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this ExperimentsPatchExperimentProtocolRequestDataAttributes object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsPatchExperimentProtocolRequestDataAttributes + experimentsPatchExperimentProtocolRequestDataAttributes = + (ExperimentsPatchExperimentProtocolRequestDataAttributes) o; + return Objects.equals( + this.analysisPlan, experimentsPatchExperimentProtocolRequestDataAttributes.analysisPlan) + && Objects.equals( + this.assignmentSourceDefaultProperties, + experimentsPatchExperimentProtocolRequestDataAttributes + .assignmentSourceDefaultProperties) + && Objects.equals( + this.assignmentSourceId, + experimentsPatchExperimentProtocolRequestDataAttributes.assignmentSourceId) + && Objects.equals( + this.defaultDurationDays, + experimentsPatchExperimentProtocolRequestDataAttributes.defaultDurationDays) + && Objects.equals( + this.description, experimentsPatchExperimentProtocolRequestDataAttributes.description) + && Objects.equals( + this.enforcement, experimentsPatchExperimentProtocolRequestDataAttributes.enforcement) + && Objects.equals( + this.environmentId, + experimentsPatchExperimentProtocolRequestDataAttributes.environmentId) + && Objects.equals( + this.exposureSchedule, + experimentsPatchExperimentProtocolRequestDataAttributes.exposureSchedule) + && Objects.equals( + this.isDurationRequiredToStart, + experimentsPatchExperimentProtocolRequestDataAttributes.isDurationRequiredToStart) + && Objects.equals( + this.isEqualSplitEnforced, + experimentsPatchExperimentProtocolRequestDataAttributes.isEqualSplitEnforced) + && Objects.equals( + this.isMetricLimitEnabled, + experimentsPatchExperimentProtocolRequestDataAttributes.isMetricLimitEnabled) + && Objects.equals( + this.isMinimumDurationEnabled, + experimentsPatchExperimentProtocolRequestDataAttributes.isMinimumDurationEnabled) + && Objects.equals( + this.metricGroups, experimentsPatchExperimentProtocolRequestDataAttributes.metricGroups) + && Objects.equals( + this.metricLimit, experimentsPatchExperimentProtocolRequestDataAttributes.metricLimit) + && Objects.equals( + this.migrationMetadata, + experimentsPatchExperimentProtocolRequestDataAttributes.migrationMetadata) + && Objects.equals( + this.minimumDurationUnit, + experimentsPatchExperimentProtocolRequestDataAttributes.minimumDurationUnit) + && Objects.equals( + this.minimumDurationValue, + experimentsPatchExperimentProtocolRequestDataAttributes.minimumDurationValue) + && Objects.equals(this.name, experimentsPatchExperimentProtocolRequestDataAttributes.name) + && Objects.equals( + this.primaryMetricId, + experimentsPatchExperimentProtocolRequestDataAttributes.primaryMetricId) + && Objects.equals( + this.subjectTypeId, + experimentsPatchExperimentProtocolRequestDataAttributes.subjectTypeId) + && Objects.equals( + this.targetingRules, + experimentsPatchExperimentProtocolRequestDataAttributes.targetingRules) + && Objects.equals( + this.additionalProperties, + experimentsPatchExperimentProtocolRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + analysisPlan, + assignmentSourceDefaultProperties, + assignmentSourceId, + defaultDurationDays, + description, + enforcement, + environmentId, + exposureSchedule, + isDurationRequiredToStart, + isEqualSplitEnforced, + isMetricLimitEnabled, + isMinimumDurationEnabled, + metricGroups, + metricLimit, + migrationMetadata, + minimumDurationUnit, + minimumDurationValue, + name, + primaryMetricId, + subjectTypeId, + targetingRules, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsPatchExperimentProtocolRequestDataAttributes {\n"); + sb.append(" analysisPlan: ").append(toIndentedString(analysisPlan)).append("\n"); + sb.append(" assignmentSourceDefaultProperties: ") + .append(toIndentedString(assignmentSourceDefaultProperties)) + .append("\n"); + sb.append(" assignmentSourceId: ").append(toIndentedString(assignmentSourceId)).append("\n"); + sb.append(" defaultDurationDays: ") + .append(toIndentedString(defaultDurationDays)) + .append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" enforcement: ").append(toIndentedString(enforcement)).append("\n"); + sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" exposureSchedule: ").append(toIndentedString(exposureSchedule)).append("\n"); + sb.append(" isDurationRequiredToStart: ") + .append(toIndentedString(isDurationRequiredToStart)) + .append("\n"); + sb.append(" isEqualSplitEnforced: ") + .append(toIndentedString(isEqualSplitEnforced)) + .append("\n"); + sb.append(" isMetricLimitEnabled: ") + .append(toIndentedString(isMetricLimitEnabled)) + .append("\n"); + sb.append(" isMinimumDurationEnabled: ") + .append(toIndentedString(isMinimumDurationEnabled)) + .append("\n"); + sb.append(" metricGroups: ").append(toIndentedString(metricGroups)).append("\n"); + sb.append(" metricLimit: ").append(toIndentedString(metricLimit)).append("\n"); + sb.append(" migrationMetadata: ").append(toIndentedString(migrationMetadata)).append("\n"); + sb.append(" minimumDurationUnit: ") + .append(toIndentedString(minimumDurationUnit)) + .append("\n"); + sb.append(" minimumDurationValue: ") + .append(toIndentedString(minimumDurationValue)) + .append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" primaryMetricId: ").append(toIndentedString(primaryMetricId)).append("\n"); + sb.append(" subjectTypeId: ").append(toIndentedString(subjectTypeId)).append("\n"); + sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchProtocolAnalysisPlanInput.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchProtocolAnalysisPlanInput.java new file mode 100644 index 00000000000..4122f00e5a1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchProtocolAnalysisPlanInput.java @@ -0,0 +1,286 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Partial statistical settings. Omitted fields remain unchanged. Null clears the whole plan. Null + * clears nullable fields; null or an empty string clears confidence_interval_method. + */ +@JsonPropertyOrder({ + ExperimentsPatchProtocolAnalysisPlanInput.JSON_PROPERTY_COMPUTE_CUPED, + ExperimentsPatchProtocolAnalysisPlanInput.JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD, + ExperimentsPatchProtocolAnalysisPlanInput.JSON_PROPERTY_CONFIDENCE_LEVEL, + ExperimentsPatchProtocolAnalysisPlanInput.JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION_METHOD +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsPatchProtocolAnalysisPlanInput { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMPUTE_CUPED = "compute_cuped"; + private JsonNullable computeCuped = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD = + "confidence_interval_method"; + private JsonNullable confidenceIntervalMethod = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_CONFIDENCE_LEVEL = "confidence_level"; + private JsonNullable confidenceLevel = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION_METHOD = + "multiple_testing_correction_method"; + private JsonNullable multipleTestingCorrectionMethod = JsonNullable.undefined(); + + public ExperimentsPatchProtocolAnalysisPlanInput computeCuped(Boolean computeCuped) { + this.computeCuped = JsonNullable.of(computeCuped); + return this; + } + + /** + * Whether to use pre-experiment data to reduce variance with CUPED. + * + * @return computeCuped + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getComputeCuped() { + return computeCuped.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_COMPUTE_CUPED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getComputeCuped_JsonNullable() { + return computeCuped; + } + + @JsonProperty(JSON_PROPERTY_COMPUTE_CUPED) + public void setComputeCuped_JsonNullable(JsonNullable computeCuped) { + this.computeCuped = computeCuped; + } + + public void setComputeCuped(Boolean computeCuped) { + this.computeCuped = JsonNullable.of(computeCuped); + } + + public ExperimentsPatchProtocolAnalysisPlanInput confidenceIntervalMethod( + String confidenceIntervalMethod) { + this.confidenceIntervalMethod = JsonNullable.of(confidenceIntervalMethod); + return this; + } + + /** + * Confidence interval method: Sequential, FixedSample, Bayesian + * , or SequentialFixedHybrid. An empty string leaves the method unset. + * + * @return confidenceIntervalMethod + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getConfidenceIntervalMethod() { + return confidenceIntervalMethod.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getConfidenceIntervalMethod_JsonNullable() { + return confidenceIntervalMethod; + } + + @JsonProperty(JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD) + public void setConfidenceIntervalMethod_JsonNullable( + JsonNullable confidenceIntervalMethod) { + this.confidenceIntervalMethod = confidenceIntervalMethod; + } + + public void setConfidenceIntervalMethod(String confidenceIntervalMethod) { + this.confidenceIntervalMethod = JsonNullable.of(confidenceIntervalMethod); + } + + public ExperimentsPatchProtocolAnalysisPlanInput confidenceLevel(Double confidenceLevel) { + this.confidenceLevel = JsonNullable.of(confidenceLevel); + return this; + } + + /** + * Confidence level used by the statistical analysis. minimum: 0 maximum: 1 + * + * @return confidenceLevel + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getConfidenceLevel() { + return confidenceLevel.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CONFIDENCE_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getConfidenceLevel_JsonNullable() { + return confidenceLevel; + } + + @JsonProperty(JSON_PROPERTY_CONFIDENCE_LEVEL) + public void setConfidenceLevel_JsonNullable(JsonNullable confidenceLevel) { + this.confidenceLevel = confidenceLevel; + } + + public void setConfidenceLevel(Double confidenceLevel) { + this.confidenceLevel = JsonNullable.of(confidenceLevel); + } + + public ExperimentsPatchProtocolAnalysisPlanInput multipleTestingCorrectionMethod( + String multipleTestingCorrectionMethod) { + this.multipleTestingCorrectionMethod = JsonNullable.of(multipleTestingCorrectionMethod); + return this; + } + + /** + * Method used to adjust for testing multiple metrics. + * + * @return multipleTestingCorrectionMethod + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getMultipleTestingCorrectionMethod() { + return multipleTestingCorrectionMethod.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getMultipleTestingCorrectionMethod_JsonNullable() { + return multipleTestingCorrectionMethod; + } + + @JsonProperty(JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION_METHOD) + public void setMultipleTestingCorrectionMethod_JsonNullable( + JsonNullable multipleTestingCorrectionMethod) { + this.multipleTestingCorrectionMethod = multipleTestingCorrectionMethod; + } + + public void setMultipleTestingCorrectionMethod(String multipleTestingCorrectionMethod) { + this.multipleTestingCorrectionMethod = JsonNullable.of(multipleTestingCorrectionMethod); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsPatchProtocolAnalysisPlanInput + */ + @JsonAnySetter + public ExperimentsPatchProtocolAnalysisPlanInput putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsPatchProtocolAnalysisPlanInput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsPatchProtocolAnalysisPlanInput experimentsPatchProtocolAnalysisPlanInput = + (ExperimentsPatchProtocolAnalysisPlanInput) o; + return Objects.equals(this.computeCuped, experimentsPatchProtocolAnalysisPlanInput.computeCuped) + && Objects.equals( + this.confidenceIntervalMethod, + experimentsPatchProtocolAnalysisPlanInput.confidenceIntervalMethod) + && Objects.equals( + this.confidenceLevel, experimentsPatchProtocolAnalysisPlanInput.confidenceLevel) + && Objects.equals( + this.multipleTestingCorrectionMethod, + experimentsPatchProtocolAnalysisPlanInput.multipleTestingCorrectionMethod) + && Objects.equals( + this.additionalProperties, + experimentsPatchProtocolAnalysisPlanInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + computeCuped, + confidenceIntervalMethod, + confidenceLevel, + multipleTestingCorrectionMethod, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsPatchProtocolAnalysisPlanInput {\n"); + sb.append(" computeCuped: ").append(toIndentedString(computeCuped)).append("\n"); + sb.append(" confidenceIntervalMethod: ") + .append(toIndentedString(confidenceIntervalMethod)) + .append("\n"); + sb.append(" confidenceLevel: ").append(toIndentedString(confidenceLevel)).append("\n"); + sb.append(" multipleTestingCorrectionMethod: ") + .append(toIndentedString(multipleTestingCorrectionMethod)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchProtocolEnforcementInput.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchProtocolEnforcementInput.java new file mode 100644 index 00000000000..e0458501176 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchProtocolEnforcementInput.java @@ -0,0 +1,725 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Partial lock map. Omitted fields remain unchanged. Null clears the whole map. Empty or null field + * values become EDITABLE, except subject_type, flag_source, + * and confidence_interval_method, which remain LOCKED. + */ +@JsonPropertyOrder({ + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_CONFIDENCE_LEVEL, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_CUPED_CALCULATION, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_DEFAULT_DURATION, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_ENVIRONMENT, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_FLAG_SOURCE, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_NOTIFICATIONS, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_PRIMARY_METRIC, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_SECONDARY_METRICS, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_SPLIT_BY_EXPLORATION_DIMENSIONS, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_SUBJECT_TYPE, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_TARGETING_RULES, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_TRAFFIC_EXPOSURE, + ExperimentsPatchProtocolEnforcementInput.JSON_PROPERTY_WAREHOUSE_EXPOSURE_SOURCE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsPatchProtocolEnforcementInput { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD = + "confidence_interval_method"; + private JsonNullable confidenceIntervalMethod = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_CONFIDENCE_LEVEL = "confidence_level"; + private JsonNullable confidenceLevel = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_CUPED_CALCULATION = "cuped_calculation"; + private JsonNullable cupedCalculation = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DEFAULT_DURATION = "default_duration"; + private JsonNullable defaultDuration = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; + private JsonNullable environment = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_FLAG_SOURCE = "flag_source"; + private JsonNullable flagSource = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION = + "multiple_testing_correction"; + private JsonNullable multipleTestingCorrection = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NOTIFICATIONS = "notifications"; + private JsonNullable notifications = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PRIMARY_METRIC = "primary_metric"; + private JsonNullable primaryMetric = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SECONDARY_METRICS = "secondary_metrics"; + private JsonNullable secondaryMetrics = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SPLIT_BY_EXPLORATION_DIMENSIONS = + "split_by_exploration_dimensions"; + private JsonNullable splitByExplorationDimensions = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SUBJECT_TYPE = "subject_type"; + private JsonNullable subjectType = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TARGETING_RULES = "targeting_rules"; + private JsonNullable targetingRules = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_TRAFFIC_EXPOSURE = "traffic_exposure"; + private JsonNullable trafficExposure = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_WAREHOUSE_EXPOSURE_SOURCE = "warehouse_exposure_source"; + private JsonNullable warehouseExposureSource = JsonNullable.undefined(); + + public ExperimentsPatchProtocolEnforcementInput confidenceIntervalMethod( + String confidenceIntervalMethod) { + this.confidenceIntervalMethod = JsonNullable.of(confidenceIntervalMethod); + return this; + } + + /** + * Always LOCKED. The server keeps this setting locked regardless of the supplied + * value. + * + * @return confidenceIntervalMethod + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getConfidenceIntervalMethod() { + return confidenceIntervalMethod.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getConfidenceIntervalMethod_JsonNullable() { + return confidenceIntervalMethod; + } + + @JsonProperty(JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD) + public void setConfidenceIntervalMethod_JsonNullable( + JsonNullable confidenceIntervalMethod) { + this.confidenceIntervalMethod = confidenceIntervalMethod; + } + + public void setConfidenceIntervalMethod(String confidenceIntervalMethod) { + this.confidenceIntervalMethod = JsonNullable.of(confidenceIntervalMethod); + } + + public ExperimentsPatchProtocolEnforcementInput confidenceLevel(String confidenceLevel) { + this.confidenceLevel = JsonNullable.of(confidenceLevel); + return this; + } + + /** + * LOCKED prevents changes to confidence level. EDITABLE permits changes. + * + * @return confidenceLevel + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getConfidenceLevel() { + return confidenceLevel.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CONFIDENCE_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getConfidenceLevel_JsonNullable() { + return confidenceLevel; + } + + @JsonProperty(JSON_PROPERTY_CONFIDENCE_LEVEL) + public void setConfidenceLevel_JsonNullable(JsonNullable confidenceLevel) { + this.confidenceLevel = confidenceLevel; + } + + public void setConfidenceLevel(String confidenceLevel) { + this.confidenceLevel = JsonNullable.of(confidenceLevel); + } + + public ExperimentsPatchProtocolEnforcementInput cupedCalculation(String cupedCalculation) { + this.cupedCalculation = JsonNullable.of(cupedCalculation); + return this; + } + + /** + * LOCKED prevents changes to CUPED variance reduction. EDITABLE permits changes. + * + * @return cupedCalculation + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getCupedCalculation() { + return cupedCalculation.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CUPED_CALCULATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getCupedCalculation_JsonNullable() { + return cupedCalculation; + } + + @JsonProperty(JSON_PROPERTY_CUPED_CALCULATION) + public void setCupedCalculation_JsonNullable(JsonNullable cupedCalculation) { + this.cupedCalculation = cupedCalculation; + } + + public void setCupedCalculation(String cupedCalculation) { + this.cupedCalculation = JsonNullable.of(cupedCalculation); + } + + public ExperimentsPatchProtocolEnforcementInput defaultDuration(String defaultDuration) { + this.defaultDuration = JsonNullable.of(defaultDuration); + return this; + } + + /** + * LOCKED prevents changes to default duration. EDITABLE permits changes. + * + * @return defaultDuration + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getDefaultDuration() { + return defaultDuration.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDefaultDuration_JsonNullable() { + return defaultDuration; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_DURATION) + public void setDefaultDuration_JsonNullable(JsonNullable defaultDuration) { + this.defaultDuration = defaultDuration; + } + + public void setDefaultDuration(String defaultDuration) { + this.defaultDuration = JsonNullable.of(defaultDuration); + } + + public ExperimentsPatchProtocolEnforcementInput environment(String environment) { + this.environment = JsonNullable.of(environment); + return this; + } + + /** + * LOCKED prevents changes to environment. EDITABLE permits changes. + * + * @return environment + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getEnvironment() { + return environment.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ENVIRONMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getEnvironment_JsonNullable() { + return environment; + } + + @JsonProperty(JSON_PROPERTY_ENVIRONMENT) + public void setEnvironment_JsonNullable(JsonNullable environment) { + this.environment = environment; + } + + public void setEnvironment(String environment) { + this.environment = JsonNullable.of(environment); + } + + public ExperimentsPatchProtocolEnforcementInput flagSource(String flagSource) { + this.flagSource = JsonNullable.of(flagSource); + return this; + } + + /** + * Always LOCKED. The server keeps this setting locked regardless of the supplied value. + * + * @return flagSource + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getFlagSource() { + return flagSource.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_FLAG_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getFlagSource_JsonNullable() { + return flagSource; + } + + @JsonProperty(JSON_PROPERTY_FLAG_SOURCE) + public void setFlagSource_JsonNullable(JsonNullable flagSource) { + this.flagSource = flagSource; + } + + public void setFlagSource(String flagSource) { + this.flagSource = JsonNullable.of(flagSource); + } + + public ExperimentsPatchProtocolEnforcementInput multipleTestingCorrection( + String multipleTestingCorrection) { + this.multipleTestingCorrection = JsonNullable.of(multipleTestingCorrection); + return this; + } + + /** + * LOCKED prevents changes to multiple testing correction. EDITABLE permits changes. + * + * @return multipleTestingCorrection + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getMultipleTestingCorrection() { + return multipleTestingCorrection.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getMultipleTestingCorrection_JsonNullable() { + return multipleTestingCorrection; + } + + @JsonProperty(JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION) + public void setMultipleTestingCorrection_JsonNullable( + JsonNullable multipleTestingCorrection) { + this.multipleTestingCorrection = multipleTestingCorrection; + } + + public void setMultipleTestingCorrection(String multipleTestingCorrection) { + this.multipleTestingCorrection = JsonNullable.of(multipleTestingCorrection); + } + + public ExperimentsPatchProtocolEnforcementInput notifications(String notifications) { + this.notifications = JsonNullable.of(notifications); + return this; + } + + /** + * LOCKED prevents changes to notifications. EDITABLE permits changes. + * + * @return notifications + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getNotifications() { + return notifications.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NOTIFICATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNotifications_JsonNullable() { + return notifications; + } + + @JsonProperty(JSON_PROPERTY_NOTIFICATIONS) + public void setNotifications_JsonNullable(JsonNullable notifications) { + this.notifications = notifications; + } + + public void setNotifications(String notifications) { + this.notifications = JsonNullable.of(notifications); + } + + public ExperimentsPatchProtocolEnforcementInput primaryMetric(String primaryMetric) { + this.primaryMetric = JsonNullable.of(primaryMetric); + return this; + } + + /** + * LOCKED prevents changes to primary metric. EDITABLE permits changes. + * + * @return primaryMetric + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getPrimaryMetric() { + return primaryMetric.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_METRIC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrimaryMetric_JsonNullable() { + return primaryMetric; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_METRIC) + public void setPrimaryMetric_JsonNullable(JsonNullable primaryMetric) { + this.primaryMetric = primaryMetric; + } + + public void setPrimaryMetric(String primaryMetric) { + this.primaryMetric = JsonNullable.of(primaryMetric); + } + + public ExperimentsPatchProtocolEnforcementInput secondaryMetrics(String secondaryMetrics) { + this.secondaryMetrics = JsonNullable.of(secondaryMetrics); + return this; + } + + /** + * LOCKED prevents changes to secondary metrics. EDITABLE permits changes. + * + * @return secondaryMetrics + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getSecondaryMetrics() { + return secondaryMetrics.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SECONDARY_METRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSecondaryMetrics_JsonNullable() { + return secondaryMetrics; + } + + @JsonProperty(JSON_PROPERTY_SECONDARY_METRICS) + public void setSecondaryMetrics_JsonNullable(JsonNullable secondaryMetrics) { + this.secondaryMetrics = secondaryMetrics; + } + + public void setSecondaryMetrics(String secondaryMetrics) { + this.secondaryMetrics = JsonNullable.of(secondaryMetrics); + } + + public ExperimentsPatchProtocolEnforcementInput splitByExplorationDimensions( + String splitByExplorationDimensions) { + this.splitByExplorationDimensions = JsonNullable.of(splitByExplorationDimensions); + return this; + } + + /** + * LOCKED prevents changes to result exploration dimensions. EDITABLE permits changes. + * + * @return splitByExplorationDimensions + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getSplitByExplorationDimensions() { + return splitByExplorationDimensions.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SPLIT_BY_EXPLORATION_DIMENSIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSplitByExplorationDimensions_JsonNullable() { + return splitByExplorationDimensions; + } + + @JsonProperty(JSON_PROPERTY_SPLIT_BY_EXPLORATION_DIMENSIONS) + public void setSplitByExplorationDimensions_JsonNullable( + JsonNullable splitByExplorationDimensions) { + this.splitByExplorationDimensions = splitByExplorationDimensions; + } + + public void setSplitByExplorationDimensions(String splitByExplorationDimensions) { + this.splitByExplorationDimensions = JsonNullable.of(splitByExplorationDimensions); + } + + public ExperimentsPatchProtocolEnforcementInput subjectType(String subjectType) { + this.subjectType = JsonNullable.of(subjectType); + return this; + } + + /** + * Always LOCKED. The server keeps this setting locked regardless of the supplied value. + * + * @return subjectType + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getSubjectType() { + return subjectType.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSubjectType_JsonNullable() { + return subjectType; + } + + @JsonProperty(JSON_PROPERTY_SUBJECT_TYPE) + public void setSubjectType_JsonNullable(JsonNullable subjectType) { + this.subjectType = subjectType; + } + + public void setSubjectType(String subjectType) { + this.subjectType = JsonNullable.of(subjectType); + } + + public ExperimentsPatchProtocolEnforcementInput targetingRules(String targetingRules) { + this.targetingRules = JsonNullable.of(targetingRules); + return this; + } + + /** + * LOCKED prevents changes to targeting rules. EDITABLE permits changes. + * + * @return targetingRules + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getTargetingRules() { + return targetingRules.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TARGETING_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getTargetingRules_JsonNullable() { + return targetingRules; + } + + @JsonProperty(JSON_PROPERTY_TARGETING_RULES) + public void setTargetingRules_JsonNullable(JsonNullable targetingRules) { + this.targetingRules = targetingRules; + } + + public void setTargetingRules(String targetingRules) { + this.targetingRules = JsonNullable.of(targetingRules); + } + + public ExperimentsPatchProtocolEnforcementInput trafficExposure(String trafficExposure) { + this.trafficExposure = JsonNullable.of(trafficExposure); + return this; + } + + /** + * LOCKED prevents changes to traffic exposure. EDITABLE permits changes. + * + * @return trafficExposure + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getTrafficExposure() { + return trafficExposure.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TRAFFIC_EXPOSURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getTrafficExposure_JsonNullable() { + return trafficExposure; + } + + @JsonProperty(JSON_PROPERTY_TRAFFIC_EXPOSURE) + public void setTrafficExposure_JsonNullable(JsonNullable trafficExposure) { + this.trafficExposure = trafficExposure; + } + + public void setTrafficExposure(String trafficExposure) { + this.trafficExposure = JsonNullable.of(trafficExposure); + } + + public ExperimentsPatchProtocolEnforcementInput warehouseExposureSource( + String warehouseExposureSource) { + this.warehouseExposureSource = JsonNullable.of(warehouseExposureSource); + return this; + } + + /** + * LOCKED prevents changes to warehouse exposure source. EDITABLE permits changes. + * + * @return warehouseExposureSource + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getWarehouseExposureSource() { + return warehouseExposureSource.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_WAREHOUSE_EXPOSURE_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getWarehouseExposureSource_JsonNullable() { + return warehouseExposureSource; + } + + @JsonProperty(JSON_PROPERTY_WAREHOUSE_EXPOSURE_SOURCE) + public void setWarehouseExposureSource_JsonNullable( + JsonNullable warehouseExposureSource) { + this.warehouseExposureSource = warehouseExposureSource; + } + + public void setWarehouseExposureSource(String warehouseExposureSource) { + this.warehouseExposureSource = JsonNullable.of(warehouseExposureSource); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsPatchProtocolEnforcementInput + */ + @JsonAnySetter + public ExperimentsPatchProtocolEnforcementInput putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsPatchProtocolEnforcementInput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsPatchProtocolEnforcementInput experimentsPatchProtocolEnforcementInput = + (ExperimentsPatchProtocolEnforcementInput) o; + return Objects.equals( + this.confidenceIntervalMethod, + experimentsPatchProtocolEnforcementInput.confidenceIntervalMethod) + && Objects.equals( + this.confidenceLevel, experimentsPatchProtocolEnforcementInput.confidenceLevel) + && Objects.equals( + this.cupedCalculation, experimentsPatchProtocolEnforcementInput.cupedCalculation) + && Objects.equals( + this.defaultDuration, experimentsPatchProtocolEnforcementInput.defaultDuration) + && Objects.equals(this.environment, experimentsPatchProtocolEnforcementInput.environment) + && Objects.equals(this.flagSource, experimentsPatchProtocolEnforcementInput.flagSource) + && Objects.equals( + this.multipleTestingCorrection, + experimentsPatchProtocolEnforcementInput.multipleTestingCorrection) + && Objects.equals( + this.notifications, experimentsPatchProtocolEnforcementInput.notifications) + && Objects.equals( + this.primaryMetric, experimentsPatchProtocolEnforcementInput.primaryMetric) + && Objects.equals( + this.secondaryMetrics, experimentsPatchProtocolEnforcementInput.secondaryMetrics) + && Objects.equals( + this.splitByExplorationDimensions, + experimentsPatchProtocolEnforcementInput.splitByExplorationDimensions) + && Objects.equals(this.subjectType, experimentsPatchProtocolEnforcementInput.subjectType) + && Objects.equals( + this.targetingRules, experimentsPatchProtocolEnforcementInput.targetingRules) + && Objects.equals( + this.trafficExposure, experimentsPatchProtocolEnforcementInput.trafficExposure) + && Objects.equals( + this.warehouseExposureSource, + experimentsPatchProtocolEnforcementInput.warehouseExposureSource) + && Objects.equals( + this.additionalProperties, + experimentsPatchProtocolEnforcementInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + confidenceIntervalMethod, + confidenceLevel, + cupedCalculation, + defaultDuration, + environment, + flagSource, + multipleTestingCorrection, + notifications, + primaryMetric, + secondaryMetrics, + splitByExplorationDimensions, + subjectType, + targetingRules, + trafficExposure, + warehouseExposureSource, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsPatchProtocolEnforcementInput {\n"); + sb.append(" confidenceIntervalMethod: ") + .append(toIndentedString(confidenceIntervalMethod)) + .append("\n"); + sb.append(" confidenceLevel: ").append(toIndentedString(confidenceLevel)).append("\n"); + sb.append(" cupedCalculation: ").append(toIndentedString(cupedCalculation)).append("\n"); + sb.append(" defaultDuration: ").append(toIndentedString(defaultDuration)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" flagSource: ").append(toIndentedString(flagSource)).append("\n"); + sb.append(" multipleTestingCorrection: ") + .append(toIndentedString(multipleTestingCorrection)) + .append("\n"); + sb.append(" notifications: ").append(toIndentedString(notifications)).append("\n"); + sb.append(" primaryMetric: ").append(toIndentedString(primaryMetric)).append("\n"); + sb.append(" secondaryMetrics: ").append(toIndentedString(secondaryMetrics)).append("\n"); + sb.append(" splitByExplorationDimensions: ") + .append(toIndentedString(splitByExplorationDimensions)) + .append("\n"); + sb.append(" subjectType: ").append(toIndentedString(subjectType)).append("\n"); + sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).append("\n"); + sb.append(" trafficExposure: ").append(toIndentedString(trafficExposure)).append("\n"); + sb.append(" warehouseExposureSource: ") + .append(toIndentedString(warehouseExposureSource)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchProtocolExposureScheduleInput.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchProtocolExposureScheduleInput.java new file mode 100644 index 00000000000..7420a28bff2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPatchProtocolExposureScheduleInput.java @@ -0,0 +1,342 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Partial traffic schedule. Omitted fields remain unchanged. Null clears the whole schedule. Null + * clears nullable fields and rollout_steps; null sets strategy to an empty string and + * autostart to false. + */ +@JsonPropertyOrder({ + ExperimentsPatchProtocolExposureScheduleInput.JSON_PROPERTY_AUTOSTART, + ExperimentsPatchProtocolExposureScheduleInput.JSON_PROPERTY_GUARDRAIL_TRIGGERED_ACTION, + ExperimentsPatchProtocolExposureScheduleInput.JSON_PROPERTY_ROLLOUT_STEPS, + ExperimentsPatchProtocolExposureScheduleInput.JSON_PROPERTY_SELECTION_INTERVAL_MS, + ExperimentsPatchProtocolExposureScheduleInput.JSON_PROPERTY_STRATEGY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsPatchProtocolExposureScheduleInput { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTOSTART = "autostart"; + private JsonNullable autostart = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_GUARDRAIL_TRIGGERED_ACTION = + "guardrail_triggered_action"; + private JsonNullable guardrailTriggeredAction = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ROLLOUT_STEPS = "rollout_steps"; + private JsonNullable> rolloutSteps = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_SELECTION_INTERVAL_MS = "selection_interval_ms"; + private JsonNullable selectionIntervalMs = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STRATEGY = "strategy"; + private JsonNullable strategy = JsonNullable.undefined(); + + public ExperimentsPatchProtocolExposureScheduleInput autostart(Boolean autostart) { + this.autostart = JsonNullable.of(autostart); + return this; + } + + /** + * Whether the exposure schedule starts automatically. + * + * @return autostart + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getAutostart() { + return autostart.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_AUTOSTART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAutostart_JsonNullable() { + return autostart; + } + + @JsonProperty(JSON_PROPERTY_AUTOSTART) + public void setAutostart_JsonNullable(JsonNullable autostart) { + this.autostart = autostart; + } + + public void setAutostart(Boolean autostart) { + this.autostart = JsonNullable.of(autostart); + } + + public ExperimentsPatchProtocolExposureScheduleInput guardrailTriggeredAction( + String guardrailTriggeredAction) { + this.guardrailTriggeredAction = JsonNullable.of(guardrailTriggeredAction); + return this; + } + + /** + * Action taken when a guardrail triggers during the exposure schedule. + * + * @return guardrailTriggeredAction + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getGuardrailTriggeredAction() { + return guardrailTriggeredAction.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_GUARDRAIL_TRIGGERED_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getGuardrailTriggeredAction_JsonNullable() { + return guardrailTriggeredAction; + } + + @JsonProperty(JSON_PROPERTY_GUARDRAIL_TRIGGERED_ACTION) + public void setGuardrailTriggeredAction_JsonNullable( + JsonNullable guardrailTriggeredAction) { + this.guardrailTriggeredAction = guardrailTriggeredAction; + } + + public void setGuardrailTriggeredAction(String guardrailTriggeredAction) { + this.guardrailTriggeredAction = JsonNullable.of(guardrailTriggeredAction); + } + + public ExperimentsPatchProtocolExposureScheduleInput rolloutSteps( + List rolloutSteps) { + this.rolloutSteps = JsonNullable.>of(rolloutSteps); + return this; + } + + public ExperimentsPatchProtocolExposureScheduleInput addRolloutStepsItem( + ExperimentsProtocolExposureStepInput rolloutStepsItem) { + if (this.rolloutSteps == null || !this.rolloutSteps.isPresent()) { + this.rolloutSteps = + JsonNullable.>of(new ArrayList<>()); + } + try { + this.rolloutSteps.get().add(rolloutStepsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Rollout steps, replaced when supplied. + * + * @return rolloutSteps + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getRolloutSteps() { + return rolloutSteps.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ROLLOUT_STEPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getRolloutSteps_JsonNullable() { + return rolloutSteps; + } + + @JsonProperty(JSON_PROPERTY_ROLLOUT_STEPS) + public void setRolloutSteps_JsonNullable( + JsonNullable> rolloutSteps) { + this.rolloutSteps = rolloutSteps; + } + + public void setRolloutSteps(List rolloutSteps) { + this.rolloutSteps = JsonNullable.>of(rolloutSteps); + } + + public ExperimentsPatchProtocolExposureScheduleInput selectionIntervalMs( + Long selectionIntervalMs) { + this.selectionIntervalMs = JsonNullable.of(selectionIntervalMs); + return this; + } + + /** + * Interval between traffic selections, in milliseconds. minimum: 0 + * + * @return selectionIntervalMs + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getSelectionIntervalMs() { + return selectionIntervalMs.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SELECTION_INTERVAL_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSelectionIntervalMs_JsonNullable() { + return selectionIntervalMs; + } + + @JsonProperty(JSON_PROPERTY_SELECTION_INTERVAL_MS) + public void setSelectionIntervalMs_JsonNullable(JsonNullable selectionIntervalMs) { + this.selectionIntervalMs = selectionIntervalMs; + } + + public void setSelectionIntervalMs(Long selectionIntervalMs) { + this.selectionIntervalMs = JsonNullable.of(selectionIntervalMs); + } + + public ExperimentsPatchProtocolExposureScheduleInput strategy(String strategy) { + this.strategy = JsonNullable.of(strategy); + return this; + } + + /** + * Method used to increase traffic exposure over the schedule. + * + * @return strategy + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getStrategy() { + return strategy.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_STRATEGY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getStrategy_JsonNullable() { + return strategy; + } + + @JsonProperty(JSON_PROPERTY_STRATEGY) + public void setStrategy_JsonNullable(JsonNullable strategy) { + this.strategy = strategy; + } + + public void setStrategy(String strategy) { + this.strategy = JsonNullable.of(strategy); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsPatchProtocolExposureScheduleInput + */ + @JsonAnySetter + public ExperimentsPatchProtocolExposureScheduleInput putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsPatchProtocolExposureScheduleInput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsPatchProtocolExposureScheduleInput experimentsPatchProtocolExposureScheduleInput = + (ExperimentsPatchProtocolExposureScheduleInput) o; + return Objects.equals(this.autostart, experimentsPatchProtocolExposureScheduleInput.autostart) + && Objects.equals( + this.guardrailTriggeredAction, + experimentsPatchProtocolExposureScheduleInput.guardrailTriggeredAction) + && Objects.equals( + this.rolloutSteps, experimentsPatchProtocolExposureScheduleInput.rolloutSteps) + && Objects.equals( + this.selectionIntervalMs, + experimentsPatchProtocolExposureScheduleInput.selectionIntervalMs) + && Objects.equals(this.strategy, experimentsPatchProtocolExposureScheduleInput.strategy) + && Objects.equals( + this.additionalProperties, + experimentsPatchProtocolExposureScheduleInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + autostart, + guardrailTriggeredAction, + rolloutSteps, + selectionIntervalMs, + strategy, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsPatchProtocolExposureScheduleInput {\n"); + sb.append(" autostart: ").append(toIndentedString(autostart)).append("\n"); + sb.append(" guardrailTriggeredAction: ") + .append(toIndentedString(guardrailTriggeredAction)) + .append("\n"); + sb.append(" rolloutSteps: ").append(toIndentedString(rolloutSteps)).append("\n"); + sb.append(" selectionIntervalMs: ") + .append(toIndentedString(selectionIntervalMs)) + .append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolAnalysisPlanInput.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolAnalysisPlanInput.java new file mode 100644 index 00000000000..3b8cabb23c4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolAnalysisPlanInput.java @@ -0,0 +1,274 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Statistical settings. Use default_duration_days for duration; + * target_duration_days is not accepted here. + */ +@JsonPropertyOrder({ + ExperimentsProtocolAnalysisPlanInput.JSON_PROPERTY_COMPUTE_CUPED, + ExperimentsProtocolAnalysisPlanInput.JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD, + ExperimentsProtocolAnalysisPlanInput.JSON_PROPERTY_CONFIDENCE_LEVEL, + ExperimentsProtocolAnalysisPlanInput.JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION_METHOD +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsProtocolAnalysisPlanInput { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMPUTE_CUPED = "compute_cuped"; + private JsonNullable computeCuped = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD = + "confidence_interval_method"; + private String confidenceIntervalMethod; + + public static final String JSON_PROPERTY_CONFIDENCE_LEVEL = "confidence_level"; + private JsonNullable confidenceLevel = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION_METHOD = + "multiple_testing_correction_method"; + private JsonNullable multipleTestingCorrectionMethod = JsonNullable.undefined(); + + public ExperimentsProtocolAnalysisPlanInput computeCuped(Boolean computeCuped) { + this.computeCuped = JsonNullable.of(computeCuped); + return this; + } + + /** + * Whether to use pre-experiment data to reduce variance with CUPED. + * + * @return computeCuped + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Boolean getComputeCuped() { + return computeCuped.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_COMPUTE_CUPED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getComputeCuped_JsonNullable() { + return computeCuped; + } + + @JsonProperty(JSON_PROPERTY_COMPUTE_CUPED) + public void setComputeCuped_JsonNullable(JsonNullable computeCuped) { + this.computeCuped = computeCuped; + } + + public void setComputeCuped(Boolean computeCuped) { + this.computeCuped = JsonNullable.of(computeCuped); + } + + public ExperimentsProtocolAnalysisPlanInput confidenceIntervalMethod( + String confidenceIntervalMethod) { + this.confidenceIntervalMethod = confidenceIntervalMethod; + return this; + } + + /** + * Confidence interval method: Sequential, FixedSample, Bayesian + * , or SequentialFixedHybrid. An empty string leaves the method unset. + * + * @return confidenceIntervalMethod + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getConfidenceIntervalMethod() { + return confidenceIntervalMethod; + } + + public void setConfidenceIntervalMethod(String confidenceIntervalMethod) { + this.confidenceIntervalMethod = confidenceIntervalMethod; + } + + public ExperimentsProtocolAnalysisPlanInput confidenceLevel(Double confidenceLevel) { + this.confidenceLevel = JsonNullable.of(confidenceLevel); + return this; + } + + /** + * Confidence level used by the statistical analysis. minimum: 0 maximum: 1 + * + * @return confidenceLevel + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Double getConfidenceLevel() { + return confidenceLevel.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CONFIDENCE_LEVEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getConfidenceLevel_JsonNullable() { + return confidenceLevel; + } + + @JsonProperty(JSON_PROPERTY_CONFIDENCE_LEVEL) + public void setConfidenceLevel_JsonNullable(JsonNullable confidenceLevel) { + this.confidenceLevel = confidenceLevel; + } + + public void setConfidenceLevel(Double confidenceLevel) { + this.confidenceLevel = JsonNullable.of(confidenceLevel); + } + + public ExperimentsProtocolAnalysisPlanInput multipleTestingCorrectionMethod( + String multipleTestingCorrectionMethod) { + this.multipleTestingCorrectionMethod = JsonNullable.of(multipleTestingCorrectionMethod); + return this; + } + + /** + * Method used to adjust for testing multiple metrics. + * + * @return multipleTestingCorrectionMethod + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getMultipleTestingCorrectionMethod() { + return multipleTestingCorrectionMethod.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getMultipleTestingCorrectionMethod_JsonNullable() { + return multipleTestingCorrectionMethod; + } + + @JsonProperty(JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION_METHOD) + public void setMultipleTestingCorrectionMethod_JsonNullable( + JsonNullable multipleTestingCorrectionMethod) { + this.multipleTestingCorrectionMethod = multipleTestingCorrectionMethod; + } + + public void setMultipleTestingCorrectionMethod(String multipleTestingCorrectionMethod) { + this.multipleTestingCorrectionMethod = JsonNullable.of(multipleTestingCorrectionMethod); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsProtocolAnalysisPlanInput + */ + @JsonAnySetter + public ExperimentsProtocolAnalysisPlanInput putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsProtocolAnalysisPlanInput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsProtocolAnalysisPlanInput experimentsProtocolAnalysisPlanInput = + (ExperimentsProtocolAnalysisPlanInput) o; + return Objects.equals(this.computeCuped, experimentsProtocolAnalysisPlanInput.computeCuped) + && Objects.equals( + this.confidenceIntervalMethod, + experimentsProtocolAnalysisPlanInput.confidenceIntervalMethod) + && Objects.equals( + this.confidenceLevel, experimentsProtocolAnalysisPlanInput.confidenceLevel) + && Objects.equals( + this.multipleTestingCorrectionMethod, + experimentsProtocolAnalysisPlanInput.multipleTestingCorrectionMethod) + && Objects.equals( + this.additionalProperties, experimentsProtocolAnalysisPlanInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + computeCuped, + confidenceIntervalMethod, + confidenceLevel, + multipleTestingCorrectionMethod, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsProtocolAnalysisPlanInput {\n"); + sb.append(" computeCuped: ").append(toIndentedString(computeCuped)).append("\n"); + sb.append(" confidenceIntervalMethod: ") + .append(toIndentedString(confidenceIntervalMethod)) + .append("\n"); + sb.append(" confidenceLevel: ").append(toIndentedString(confidenceLevel)).append("\n"); + sb.append(" multipleTestingCorrectionMethod: ") + .append(toIndentedString(multipleTestingCorrectionMethod)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolConditionInput.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolConditionInput.java new file mode 100644 index 00000000000..21b618a5aa0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolConditionInput.java @@ -0,0 +1,287 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Protocol targeting condition. Publishing and replacement require a saved filter or a valid inline + * attribute, operator, and values. + */ +@JsonPropertyOrder({ + ExperimentsProtocolConditionInput.JSON_PROPERTY_ATTRIBUTE, + ExperimentsProtocolConditionInput.JSON_PROPERTY_OPERATOR, + ExperimentsProtocolConditionInput.JSON_PROPERTY_ORDER_POSITION, + ExperimentsProtocolConditionInput.JSON_PROPERTY_SAVED_FILTER_ID, + ExperimentsProtocolConditionInput.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsProtocolConditionInput { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTE = "attribute"; + private String attribute; + + public static final String JSON_PROPERTY_OPERATOR = "operator"; + private String operator; + + public static final String JSON_PROPERTY_ORDER_POSITION = "order_position"; + private Long orderPosition; + + public static final String JSON_PROPERTY_SAVED_FILTER_ID = "saved_filter_id"; + private JsonNullable savedFilterId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_VALUE = "value"; + private JsonNullable> value = JsonNullable.>undefined(); + + public ExperimentsProtocolConditionInput attribute(String attribute) { + this.attribute = attribute; + return this; + } + + /** + * Subject attribute evaluated by the targeting condition. + * + * @return attribute + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public ExperimentsProtocolConditionInput operator(String operator) { + this.operator = operator; + return this; + } + + /** + * Comparison applied to the subject attribute. + * + * @return operator + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator; + } + + public ExperimentsProtocolConditionInput orderPosition(Long orderPosition) { + this.orderPosition = orderPosition; + return this; + } + + /** + * Position of this entry in the ordered configuration. minimum: 0 + * + * @return orderPosition + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER_POSITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOrderPosition() { + return orderPosition; + } + + public void setOrderPosition(Long orderPosition) { + this.orderPosition = orderPosition; + } + + public ExperimentsProtocolConditionInput savedFilterId(String savedFilterId) { + this.savedFilterId = JsonNullable.of(savedFilterId); + return this; + } + + /** + * Saved filter UUID. Null selects an inline condition. An empty string skips the saved-filter + * lookup. + * + * @return savedFilterId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getSavedFilterId() { + return savedFilterId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SAVED_FILTER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSavedFilterId_JsonNullable() { + return savedFilterId; + } + + @JsonProperty(JSON_PROPERTY_SAVED_FILTER_ID) + public void setSavedFilterId_JsonNullable(JsonNullable savedFilterId) { + this.savedFilterId = savedFilterId; + } + + public void setSavedFilterId(String savedFilterId) { + this.savedFilterId = JsonNullable.of(savedFilterId); + } + + public ExperimentsProtocolConditionInput value(List value) { + this.value = JsonNullable.>of(value); + return this; + } + + public ExperimentsProtocolConditionInput addValueItem(String valueItem) { + if (this.value == null || !this.value.isPresent()) { + this.value = JsonNullable.>of(new ArrayList<>()); + } + try { + this.value.get().add(valueItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Values compared with the subject attribute in this condition. + * + * @return value + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getValue() { + return value.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getValue_JsonNullable() { + return value; + } + + @JsonProperty(JSON_PROPERTY_VALUE) + public void setValue_JsonNullable(JsonNullable> value) { + this.value = value; + } + + public void setValue(List value) { + this.value = JsonNullable.>of(value); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsProtocolConditionInput + */ + @JsonAnySetter + public ExperimentsProtocolConditionInput putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsProtocolConditionInput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsProtocolConditionInput experimentsProtocolConditionInput = + (ExperimentsProtocolConditionInput) o; + return Objects.equals(this.attribute, experimentsProtocolConditionInput.attribute) + && Objects.equals(this.operator, experimentsProtocolConditionInput.operator) + && Objects.equals(this.orderPosition, experimentsProtocolConditionInput.orderPosition) + && Objects.equals(this.savedFilterId, experimentsProtocolConditionInput.savedFilterId) + && Objects.equals(this.value, experimentsProtocolConditionInput.value) + && Objects.equals( + this.additionalProperties, experimentsProtocolConditionInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + attribute, operator, orderPosition, savedFilterId, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsProtocolConditionInput {\n"); + sb.append(" attribute: ").append(toIndentedString(attribute)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" orderPosition: ").append(toIndentedString(orderPosition)).append("\n"); + sb.append(" savedFilterId: ").append(toIndentedString(savedFilterId)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolExposureScheduleInput.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolExposureScheduleInput.java new file mode 100644 index 00000000000..c3219880c04 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolExposureScheduleInput.java @@ -0,0 +1,318 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Traffic schedule. Publishing and replacement require NO_ROLLOUT with exactly one + * step, or UNIFORM_INTERVALS with a positive selection interval and at least one step. + * Requires environment_id. + */ +@JsonPropertyOrder({ + ExperimentsProtocolExposureScheduleInput.JSON_PROPERTY_AUTOSTART, + ExperimentsProtocolExposureScheduleInput.JSON_PROPERTY_GUARDRAIL_TRIGGERED_ACTION, + ExperimentsProtocolExposureScheduleInput.JSON_PROPERTY_ROLLOUT_STEPS, + ExperimentsProtocolExposureScheduleInput.JSON_PROPERTY_SELECTION_INTERVAL_MS, + ExperimentsProtocolExposureScheduleInput.JSON_PROPERTY_STRATEGY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsProtocolExposureScheduleInput { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTOSTART = "autostart"; + private Boolean autostart; + + public static final String JSON_PROPERTY_GUARDRAIL_TRIGGERED_ACTION = + "guardrail_triggered_action"; + private JsonNullable guardrailTriggeredAction = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ROLLOUT_STEPS = "rollout_steps"; + private JsonNullable> rolloutSteps = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_SELECTION_INTERVAL_MS = "selection_interval_ms"; + private JsonNullable selectionIntervalMs = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STRATEGY = "strategy"; + private String strategy; + + public ExperimentsProtocolExposureScheduleInput autostart(Boolean autostart) { + this.autostart = autostart; + return this; + } + + /** + * Whether the exposure schedule starts automatically. + * + * @return autostart + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTOSTART) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAutostart() { + return autostart; + } + + public void setAutostart(Boolean autostart) { + this.autostart = autostart; + } + + public ExperimentsProtocolExposureScheduleInput guardrailTriggeredAction( + String guardrailTriggeredAction) { + this.guardrailTriggeredAction = JsonNullable.of(guardrailTriggeredAction); + return this; + } + + /** + * Action taken when a guardrail triggers during the exposure schedule. + * + * @return guardrailTriggeredAction + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getGuardrailTriggeredAction() { + return guardrailTriggeredAction.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_GUARDRAIL_TRIGGERED_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getGuardrailTriggeredAction_JsonNullable() { + return guardrailTriggeredAction; + } + + @JsonProperty(JSON_PROPERTY_GUARDRAIL_TRIGGERED_ACTION) + public void setGuardrailTriggeredAction_JsonNullable( + JsonNullable guardrailTriggeredAction) { + this.guardrailTriggeredAction = guardrailTriggeredAction; + } + + public void setGuardrailTriggeredAction(String guardrailTriggeredAction) { + this.guardrailTriggeredAction = JsonNullable.of(guardrailTriggeredAction); + } + + public ExperimentsProtocolExposureScheduleInput rolloutSteps( + List rolloutSteps) { + this.rolloutSteps = JsonNullable.>of(rolloutSteps); + return this; + } + + public ExperimentsProtocolExposureScheduleInput addRolloutStepsItem( + ExperimentsProtocolExposureStepInput rolloutStepsItem) { + if (this.rolloutSteps == null || !this.rolloutSteps.isPresent()) { + this.rolloutSteps = + JsonNullable.>of(new ArrayList<>()); + } + try { + this.rolloutSteps.get().add(rolloutStepsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Rollout steps, replaced when supplied. + * + * @return rolloutSteps + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getRolloutSteps() { + return rolloutSteps.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ROLLOUT_STEPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getRolloutSteps_JsonNullable() { + return rolloutSteps; + } + + @JsonProperty(JSON_PROPERTY_ROLLOUT_STEPS) + public void setRolloutSteps_JsonNullable( + JsonNullable> rolloutSteps) { + this.rolloutSteps = rolloutSteps; + } + + public void setRolloutSteps(List rolloutSteps) { + this.rolloutSteps = JsonNullable.>of(rolloutSteps); + } + + public ExperimentsProtocolExposureScheduleInput selectionIntervalMs(Long selectionIntervalMs) { + this.selectionIntervalMs = JsonNullable.of(selectionIntervalMs); + return this; + } + + /** + * Interval between traffic selections, in milliseconds. minimum: 0 + * + * @return selectionIntervalMs + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getSelectionIntervalMs() { + return selectionIntervalMs.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SELECTION_INTERVAL_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getSelectionIntervalMs_JsonNullable() { + return selectionIntervalMs; + } + + @JsonProperty(JSON_PROPERTY_SELECTION_INTERVAL_MS) + public void setSelectionIntervalMs_JsonNullable(JsonNullable selectionIntervalMs) { + this.selectionIntervalMs = selectionIntervalMs; + } + + public void setSelectionIntervalMs(Long selectionIntervalMs) { + this.selectionIntervalMs = JsonNullable.of(selectionIntervalMs); + } + + public ExperimentsProtocolExposureScheduleInput strategy(String strategy) { + this.strategy = strategy; + return this; + } + + /** + * Method used to increase traffic exposure over the schedule. + * + * @return strategy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STRATEGY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStrategy() { + return strategy; + } + + public void setStrategy(String strategy) { + this.strategy = strategy; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsProtocolExposureScheduleInput + */ + @JsonAnySetter + public ExperimentsProtocolExposureScheduleInput putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsProtocolExposureScheduleInput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsProtocolExposureScheduleInput experimentsProtocolExposureScheduleInput = + (ExperimentsProtocolExposureScheduleInput) o; + return Objects.equals(this.autostart, experimentsProtocolExposureScheduleInput.autostart) + && Objects.equals( + this.guardrailTriggeredAction, + experimentsProtocolExposureScheduleInput.guardrailTriggeredAction) + && Objects.equals(this.rolloutSteps, experimentsProtocolExposureScheduleInput.rolloutSteps) + && Objects.equals( + this.selectionIntervalMs, experimentsProtocolExposureScheduleInput.selectionIntervalMs) + && Objects.equals(this.strategy, experimentsProtocolExposureScheduleInput.strategy) + && Objects.equals( + this.additionalProperties, + experimentsProtocolExposureScheduleInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + autostart, + guardrailTriggeredAction, + rolloutSteps, + selectionIntervalMs, + strategy, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsProtocolExposureScheduleInput {\n"); + sb.append(" autostart: ").append(toIndentedString(autostart)).append("\n"); + sb.append(" guardrailTriggeredAction: ") + .append(toIndentedString(guardrailTriggeredAction)) + .append("\n"); + sb.append(" rolloutSteps: ").append(toIndentedString(rolloutSteps)).append("\n"); + sb.append(" selectionIntervalMs: ") + .append(toIndentedString(selectionIntervalMs)) + .append("\n"); + sb.append(" strategy: ").append(toIndentedString(strategy)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolExposureStepInput.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolExposureStepInput.java new file mode 100644 index 00000000000..7cf81c33b7c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolExposureStepInput.java @@ -0,0 +1,275 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** A traffic exposure step in the protocol template. */ +@JsonPropertyOrder({ + ExperimentsProtocolExposureStepInput.JSON_PROPERTY_EXPOSURE_RATIO, + ExperimentsProtocolExposureStepInput.JSON_PROPERTY_GROUPED_STEP_INDEX, + ExperimentsProtocolExposureStepInput.JSON_PROPERTY_INTERVAL_MS, + ExperimentsProtocolExposureStepInput.JSON_PROPERTY_IS_PAUSE_RECORD, + ExperimentsProtocolExposureStepInput.JSON_PROPERTY_ORDER_POSITION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsProtocolExposureStepInput { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EXPOSURE_RATIO = "exposure_ratio"; + private Double exposureRatio; + + public static final String JSON_PROPERTY_GROUPED_STEP_INDEX = "grouped_step_index"; + private JsonNullable groupedStepIndex = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_INTERVAL_MS = "interval_ms"; + private JsonNullable intervalMs = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_PAUSE_RECORD = "is_pause_record"; + private Boolean isPauseRecord; + + public static final String JSON_PROPERTY_ORDER_POSITION = "order_position"; + private Long orderPosition; + + public ExperimentsProtocolExposureStepInput exposureRatio(Double exposureRatio) { + this.exposureRatio = exposureRatio; + return this; + } + + /** + * Fraction of traffic exposed during this rollout step. minimum: 0 maximum: 1 + * + * @return exposureRatio + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPOSURE_RATIO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getExposureRatio() { + return exposureRatio; + } + + public void setExposureRatio(Double exposureRatio) { + this.exposureRatio = exposureRatio; + } + + public ExperimentsProtocolExposureStepInput groupedStepIndex(Long groupedStepIndex) { + this.groupedStepIndex = JsonNullable.of(groupedStepIndex); + return this; + } + + /** + * Index of the group that contains this rollout step. minimum: 0 + * + * @return groupedStepIndex + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getGroupedStepIndex() { + return groupedStepIndex.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_GROUPED_STEP_INDEX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getGroupedStepIndex_JsonNullable() { + return groupedStepIndex; + } + + @JsonProperty(JSON_PROPERTY_GROUPED_STEP_INDEX) + public void setGroupedStepIndex_JsonNullable(JsonNullable groupedStepIndex) { + this.groupedStepIndex = groupedStepIndex; + } + + public void setGroupedStepIndex(Long groupedStepIndex) { + this.groupedStepIndex = JsonNullable.of(groupedStepIndex); + } + + public ExperimentsProtocolExposureStepInput intervalMs(Long intervalMs) { + this.intervalMs = JsonNullable.of(intervalMs); + return this; + } + + /** + * Duration of this rollout step, in milliseconds. minimum: 0 + * + * @return intervalMs + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getIntervalMs() { + return intervalMs.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_INTERVAL_MS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIntervalMs_JsonNullable() { + return intervalMs; + } + + @JsonProperty(JSON_PROPERTY_INTERVAL_MS) + public void setIntervalMs_JsonNullable(JsonNullable intervalMs) { + this.intervalMs = intervalMs; + } + + public void setIntervalMs(Long intervalMs) { + this.intervalMs = JsonNullable.of(intervalMs); + } + + public ExperimentsProtocolExposureStepInput isPauseRecord(Boolean isPauseRecord) { + this.isPauseRecord = isPauseRecord; + return this; + } + + /** + * Whether this schedule entry represents a pause. + * + * @return isPauseRecord + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_PAUSE_RECORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsPauseRecord() { + return isPauseRecord; + } + + public void setIsPauseRecord(Boolean isPauseRecord) { + this.isPauseRecord = isPauseRecord; + } + + public ExperimentsProtocolExposureStepInput orderPosition(Long orderPosition) { + this.orderPosition = orderPosition; + return this; + } + + /** + * Position of this entry in the ordered configuration. minimum: 0 + * + * @return orderPosition + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER_POSITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOrderPosition() { + return orderPosition; + } + + public void setOrderPosition(Long orderPosition) { + this.orderPosition = orderPosition; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsProtocolExposureStepInput + */ + @JsonAnySetter + public ExperimentsProtocolExposureStepInput putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsProtocolExposureStepInput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsProtocolExposureStepInput experimentsProtocolExposureStepInput = + (ExperimentsProtocolExposureStepInput) o; + return Objects.equals(this.exposureRatio, experimentsProtocolExposureStepInput.exposureRatio) + && Objects.equals( + this.groupedStepIndex, experimentsProtocolExposureStepInput.groupedStepIndex) + && Objects.equals(this.intervalMs, experimentsProtocolExposureStepInput.intervalMs) + && Objects.equals(this.isPauseRecord, experimentsProtocolExposureStepInput.isPauseRecord) + && Objects.equals(this.orderPosition, experimentsProtocolExposureStepInput.orderPosition) + && Objects.equals( + this.additionalProperties, experimentsProtocolExposureStepInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + exposureRatio, + groupedStepIndex, + intervalMs, + isPauseRecord, + orderPosition, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsProtocolExposureStepInput {\n"); + sb.append(" exposureRatio: ").append(toIndentedString(exposureRatio)).append("\n"); + sb.append(" groupedStepIndex: ").append(toIndentedString(groupedStepIndex)).append("\n"); + sb.append(" intervalMs: ").append(toIndentedString(intervalMs)).append("\n"); + sb.append(" isPauseRecord: ").append(toIndentedString(isPauseRecord)).append("\n"); + sb.append(" orderPosition: ").append(toIndentedString(orderPosition)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolMetricGroupInput.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolMetricGroupInput.java new file mode 100644 index 00000000000..f9a692809ff --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolMetricGroupInput.java @@ -0,0 +1,220 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** A metric group supplied by the protocol. Empty decision groups are removed. */ +@JsonPropertyOrder({ + ExperimentsProtocolMetricGroupInput.JSON_PROPERTY_IS_DECISION, + ExperimentsProtocolMetricGroupInput.JSON_PROPERTY_METRICS, + ExperimentsProtocolMetricGroupInput.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsProtocolMetricGroupInput { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_IS_DECISION = "is_decision"; + private Boolean isDecision; + + public static final String JSON_PROPERTY_METRICS = "metrics"; + private JsonNullable> metrics = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public ExperimentsProtocolMetricGroupInput isDecision(Boolean isDecision) { + this.isDecision = isDecision; + return this; + } + + /** + * Whether this group contains decision metrics. + * + * @return isDecision + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_DECISION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsDecision() { + return isDecision; + } + + public void setIsDecision(Boolean isDecision) { + this.isDecision = isDecision; + } + + public ExperimentsProtocolMetricGroupInput metrics(List metrics) { + this.metrics = JsonNullable.>of(metrics); + return this; + } + + public ExperimentsProtocolMetricGroupInput addMetricsItem( + ExperimentsProtocolMetricInput metricsItem) { + if (this.metrics == null || !this.metrics.isPresent()) { + this.metrics = JsonNullable.>of(new ArrayList<>()); + } + try { + this.metrics.get().add(metricsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Metrics in the group. + * + * @return metrics + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getMetrics() { + return metrics.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_METRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getMetrics_JsonNullable() { + return metrics; + } + + @JsonProperty(JSON_PROPERTY_METRICS) + public void setMetrics_JsonNullable(JsonNullable> metrics) { + this.metrics = metrics; + } + + public void setMetrics(List metrics) { + this.metrics = JsonNullable.>of(metrics); + } + + public ExperimentsProtocolMetricGroupInput name(String name) { + this.name = name; + return this; + } + + /** + * Metric group name. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsProtocolMetricGroupInput + */ + @JsonAnySetter + public ExperimentsProtocolMetricGroupInput putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsProtocolMetricGroupInput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsProtocolMetricGroupInput experimentsProtocolMetricGroupInput = + (ExperimentsProtocolMetricGroupInput) o; + return Objects.equals(this.isDecision, experimentsProtocolMetricGroupInput.isDecision) + && Objects.equals(this.metrics, experimentsProtocolMetricGroupInput.metrics) + && Objects.equals(this.name, experimentsProtocolMetricGroupInput.name) + && Objects.equals( + this.additionalProperties, experimentsProtocolMetricGroupInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isDecision, metrics, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsProtocolMetricGroupInput {\n"); + sb.append(" isDecision: ").append(toIndentedString(isDecision)).append("\n"); + sb.append(" metrics: ").append(toIndentedString(metrics)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolMetricInput.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolMetricInput.java new file mode 100644 index 00000000000..ec7eb9a3ff2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolMetricInput.java @@ -0,0 +1,149 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** + * A metric included in a protocol. Select the primary metric with primary_metric_id, + * not is_primary. + */ +@JsonPropertyOrder({ExperimentsProtocolMetricInput.JSON_PROPERTY_METRIC_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsProtocolMetricInput { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_METRIC_ID = "metric_id"; + private UUID metricId; + + public ExperimentsProtocolMetricInput() {} + + @JsonCreator + public ExperimentsProtocolMetricInput( + @JsonProperty(required = true, value = JSON_PROPERTY_METRIC_ID) UUID metricId) { + this.metricId = metricId; + } + + public ExperimentsProtocolMetricInput metricId(UUID metricId) { + this.metricId = metricId; + return this; + } + + /** + * Metric UUID. + * + * @return metricId + */ + @JsonProperty(JSON_PROPERTY_METRIC_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getMetricId() { + return metricId; + } + + public void setMetricId(UUID metricId) { + this.metricId = metricId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsProtocolMetricInput + */ + @JsonAnySetter + public ExperimentsProtocolMetricInput putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsProtocolMetricInput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsProtocolMetricInput experimentsProtocolMetricInput = + (ExperimentsProtocolMetricInput) o; + return Objects.equals(this.metricId, experimentsProtocolMetricInput.metricId) + && Objects.equals( + this.additionalProperties, experimentsProtocolMetricInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(metricId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsProtocolMetricInput {\n"); + sb.append(" metricId: ").append(toIndentedString(metricId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolTargetingRuleInput.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolTargetingRuleInput.java new file mode 100644 index 00000000000..ae9bf1ffccb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsProtocolTargetingRuleInput.java @@ -0,0 +1,166 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** A targeting rule in the protocol template. */ +@JsonPropertyOrder({ExperimentsProtocolTargetingRuleInput.JSON_PROPERTY_CONDITIONS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsProtocolTargetingRuleInput { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONDITIONS = "conditions"; + private JsonNullable> conditions = + JsonNullable.>undefined(); + + public ExperimentsProtocolTargetingRuleInput conditions( + List conditions) { + this.conditions = JsonNullable.>of(conditions); + return this; + } + + public ExperimentsProtocolTargetingRuleInput addConditionsItem( + ExperimentsProtocolConditionInput conditionsItem) { + if (this.conditions == null || !this.conditions.isPresent()) { + this.conditions = JsonNullable.>of(new ArrayList<>()); + } + try { + this.conditions.get().add(conditionsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Conditions in this rule. + * + * @return conditions + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getConditions() { + return conditions.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_CONDITIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getConditions_JsonNullable() { + return conditions; + } + + @JsonProperty(JSON_PROPERTY_CONDITIONS) + public void setConditions_JsonNullable( + JsonNullable> conditions) { + this.conditions = conditions; + } + + public void setConditions(List conditions) { + this.conditions = JsonNullable.>of(conditions); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsProtocolTargetingRuleInput + */ + @JsonAnySetter + public ExperimentsProtocolTargetingRuleInput putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsProtocolTargetingRuleInput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsProtocolTargetingRuleInput experimentsProtocolTargetingRuleInput = + (ExperimentsProtocolTargetingRuleInput) o; + return Objects.equals(this.conditions, experimentsProtocolTargetingRuleInput.conditions) + && Objects.equals( + this.additionalProperties, experimentsProtocolTargetingRuleInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conditions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsProtocolTargetingRuleInput {\n"); + sb.append(" conditions: ").append(toIndentedString(conditions)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsPublicProtocolListResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPublicProtocolListResponseDataAttributes.java index a46cf269390..3cefc9659d5 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ExperimentsPublicProtocolListResponseDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPublicProtocolListResponseDataAttributes.java @@ -20,6 +20,7 @@ /** Summary of the protocol and its selected subject type and primary metric. */ @JsonPropertyOrder({ ExperimentsPublicProtocolListResponseDataAttributes.JSON_PROPERTY_DESCRIPTION, + ExperimentsPublicProtocolListResponseDataAttributes.JSON_PROPERTY_EXPERIMENT_COUNT, ExperimentsPublicProtocolListResponseDataAttributes.JSON_PROPERTY_NAME, ExperimentsPublicProtocolListResponseDataAttributes.JSON_PROPERTY_PRIMARY_METRIC, ExperimentsPublicProtocolListResponseDataAttributes.JSON_PROPERTY_PRIMARY_METRIC_ID, @@ -35,6 +36,9 @@ public class ExperimentsPublicProtocolListResponseDataAttributes { public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + public static final String JSON_PROPERTY_EXPERIMENT_COUNT = "experiment_count"; + private Long experimentCount; + public static final String JSON_PROPERTY_NAME = "name"; private String name; @@ -60,10 +64,12 @@ public ExperimentsPublicProtocolListResponseDataAttributes() {} @JsonCreator public ExperimentsPublicProtocolListResponseDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_EXPERIMENT_COUNT) Long experimentCount, @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) ExperimentsPublicProtocolResponseDataAttributesStatus status, @JsonProperty(required = true, value = JSON_PROPERTY_UPDATED_AT) String updatedAt) { + this.experimentCount = experimentCount; this.name = name; this.status = status; this.unparsed |= !status.isValid(); @@ -91,6 +97,27 @@ public void setDescription(String description) { this.description = description; } + public ExperimentsPublicProtocolListResponseDataAttributes experimentCount(Long experimentCount) { + this.experimentCount = experimentCount; + return this; + } + + /** + * Number of experiments in the organization that use this protocol, excluding deleted + * experiments. minimum: 0 + * + * @return experimentCount + */ + @JsonProperty(JSON_PROPERTY_EXPERIMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getExperimentCount() { + return experimentCount; + } + + public void setExperimentCount(Long experimentCount) { + this.experimentCount = experimentCount; + } + public ExperimentsPublicProtocolListResponseDataAttributes name(String name) { this.name = name; return this; @@ -239,8 +266,8 @@ public ExperimentsPublicProtocolListResponseDataAttributes updatedAt(String upda } /** - * RFC3339 update time. Preserve all fractional seconds when passing this value as - * expected_updated_at. + * RFC3339 update time. Preserve all fractional seconds when passing this value as + * expected_updated_at. * * @return updatedAt */ @@ -317,6 +344,9 @@ public boolean equals(Object o) { (ExperimentsPublicProtocolListResponseDataAttributes) o; return Objects.equals( this.description, experimentsPublicProtocolListResponseDataAttributes.description) + && Objects.equals( + this.experimentCount, + experimentsPublicProtocolListResponseDataAttributes.experimentCount) && Objects.equals(this.name, experimentsPublicProtocolListResponseDataAttributes.name) && Objects.equals( this.primaryMetric, experimentsPublicProtocolListResponseDataAttributes.primaryMetric) @@ -339,6 +369,7 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( description, + experimentCount, name, primaryMetric, primaryMetricId, @@ -354,6 +385,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ExperimentsPublicProtocolListResponseDataAttributes {\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" experimentCount: ").append(toIndentedString(experimentCount)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" primaryMetric: ").append(toIndentedString(primaryMetric)).append("\n"); sb.append(" primaryMetricId: ").append(toIndentedString(primaryMetricId)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsPublicProtocolResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPublicProtocolResponseDataAttributes.java index 232997875d3..842406c3d35 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ExperimentsPublicProtocolResponseDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPublicProtocolResponseDataAttributes.java @@ -23,13 +23,16 @@ /** Settings and defaults supplied by the protocol. */ @JsonPropertyOrder({ ExperimentsPublicProtocolResponseDataAttributes.JSON_PROPERTY_ANALYSIS_PLAN, + ExperimentsPublicProtocolResponseDataAttributes.JSON_PROPERTY_ARCHIVED_AT, ExperimentsPublicProtocolResponseDataAttributes .JSON_PROPERTY_ASSIGNMENT_SOURCE_DEFAULT_PROPERTIES, ExperimentsPublicProtocolResponseDataAttributes.JSON_PROPERTY_ASSIGNMENT_SOURCE_ID, + ExperimentsPublicProtocolResponseDataAttributes.JSON_PROPERTY_CREATED_AT, ExperimentsPublicProtocolResponseDataAttributes.JSON_PROPERTY_DEFAULT_DURATION_DAYS, ExperimentsPublicProtocolResponseDataAttributes.JSON_PROPERTY_DESCRIPTION, ExperimentsPublicProtocolResponseDataAttributes.JSON_PROPERTY_ENFORCEMENT, ExperimentsPublicProtocolResponseDataAttributes.JSON_PROPERTY_ENVIRONMENT_ID, + ExperimentsPublicProtocolResponseDataAttributes.JSON_PROPERTY_EXPERIMENT_COUNT, ExperimentsPublicProtocolResponseDataAttributes.JSON_PROPERTY_EXPOSURE_SCHEDULE, ExperimentsPublicProtocolResponseDataAttributes.JSON_PROPERTY_IS_DURATION_REQUIRED_TO_START, ExperimentsPublicProtocolResponseDataAttributes.JSON_PROPERTY_IS_EQUAL_SPLIT_ENFORCED, @@ -57,6 +60,9 @@ public class ExperimentsPublicProtocolResponseDataAttributes { public static final String JSON_PROPERTY_ANALYSIS_PLAN = "analysis_plan"; private ExperimentsPublicProtocolResponseDataAttributesAnalysisPlan analysisPlan; + public static final String JSON_PROPERTY_ARCHIVED_AT = "archived_at"; + private OffsetDateTime archivedAt; + public static final String JSON_PROPERTY_ASSIGNMENT_SOURCE_DEFAULT_PROPERTIES = "assignment_source_default_properties"; private List< @@ -66,6 +72,9 @@ public class ExperimentsPublicProtocolResponseDataAttributes { public static final String JSON_PROPERTY_ASSIGNMENT_SOURCE_ID = "assignment_source_id"; private String assignmentSourceId; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + public static final String JSON_PROPERTY_DEFAULT_DURATION_DAYS = "default_duration_days"; private Long defaultDurationDays; @@ -78,6 +87,9 @@ public class ExperimentsPublicProtocolResponseDataAttributes { public static final String JSON_PROPERTY_ENVIRONMENT_ID = "environment_id"; private String environmentId; + public static final String JSON_PROPERTY_EXPERIMENT_COUNT = "experiment_count"; + private Long experimentCount; + public static final String JSON_PROPERTY_EXPOSURE_SCHEDULE = "exposure_schedule"; private ExperimentsPublicProtocolResponseDataAttributesExposureSchedule exposureSchedule; @@ -143,6 +155,7 @@ public ExperimentsPublicProtocolResponseDataAttributes() {} @JsonCreator public ExperimentsPublicProtocolResponseDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, @JsonProperty(required = true, value = JSON_PROPERTY_IS_DURATION_REQUIRED_TO_START) Boolean isDurationRequiredToStart, @JsonProperty(required = true, value = JSON_PROPERTY_IS_EQUAL_SPLIT_ENFORCED) @@ -157,6 +170,7 @@ public ExperimentsPublicProtocolResponseDataAttributes( @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) ExperimentsPublicProtocolResponseDataAttributesStatus status, @JsonProperty(required = true, value = JSON_PROPERTY_UPDATED_AT) String updatedAt) { + this.createdAt = createdAt; this.isDurationRequiredToStart = isDurationRequiredToStart; this.isEqualSplitEnforced = isEqualSplitEnforced; this.isMetricLimitEnabled = isMetricLimitEnabled; @@ -198,6 +212,27 @@ public void setAnalysisPlan( } } + public ExperimentsPublicProtocolResponseDataAttributes archivedAt(OffsetDateTime archivedAt) { + this.archivedAt = archivedAt; + return this; + } + + /** + * Time when the protocol was archived. Omitted if it has not been archived. + * + * @return archivedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARCHIVED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getArchivedAt() { + return archivedAt; + } + + public void setArchivedAt(OffsetDateTime archivedAt) { + this.archivedAt = archivedAt; + } + public ExperimentsPublicProtocolResponseDataAttributes assignmentSourceDefaultProperties( List assignmentSourceDefaultProperties) { @@ -269,6 +304,26 @@ public void setAssignmentSourceId(String assignmentSourceId) { this.assignmentSourceId = assignmentSourceId; } + public ExperimentsPublicProtocolResponseDataAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Time when the protocol was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + public ExperimentsPublicProtocolResponseDataAttributes defaultDurationDays( Long defaultDurationDays) { this.defaultDurationDays = defaultDurationDays; @@ -360,6 +415,29 @@ public void setEnvironmentId(String environmentId) { this.environmentId = environmentId; } + public ExperimentsPublicProtocolResponseDataAttributes experimentCount(Long experimentCount) { + this.experimentCount = experimentCount; + return this; + } + + /** + * Number of experiments in the organization that use this protocol, excluding deleted + * experiments. Omitted if the count cannot be retrieved. An omitted count does not mean zero. + * minimum: 0 + * + * @return experimentCount + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPERIMENT_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getExperimentCount() { + return experimentCount; + } + + public void setExperimentCount(Long experimentCount) { + this.experimentCount = experimentCount; + } + public ExperimentsPublicProtocolResponseDataAttributes exposureSchedule( ExperimentsPublicProtocolResponseDataAttributesExposureSchedule exposureSchedule) { this.exposureSchedule = exposureSchedule; @@ -809,8 +887,8 @@ public ExperimentsPublicProtocolResponseDataAttributes updatedAt(String updatedA } /** - * RFC3339 update time. Preserve all fractional seconds when passing this value as - * expected_updated_at. + * RFC3339 update time. Preserve all fractional seconds when passing this value as + * expected_updated_at. * * @return updatedAt */ @@ -885,12 +963,15 @@ public boolean equals(Object o) { (ExperimentsPublicProtocolResponseDataAttributes) o; return Objects.equals( this.analysisPlan, experimentsPublicProtocolResponseDataAttributes.analysisPlan) + && Objects.equals( + this.archivedAt, experimentsPublicProtocolResponseDataAttributes.archivedAt) && Objects.equals( this.assignmentSourceDefaultProperties, experimentsPublicProtocolResponseDataAttributes.assignmentSourceDefaultProperties) && Objects.equals( this.assignmentSourceId, experimentsPublicProtocolResponseDataAttributes.assignmentSourceId) + && Objects.equals(this.createdAt, experimentsPublicProtocolResponseDataAttributes.createdAt) && Objects.equals( this.defaultDurationDays, experimentsPublicProtocolResponseDataAttributes.defaultDurationDays) @@ -900,6 +981,8 @@ public boolean equals(Object o) { this.enforcement, experimentsPublicProtocolResponseDataAttributes.enforcement) && Objects.equals( this.environmentId, experimentsPublicProtocolResponseDataAttributes.environmentId) + && Objects.equals( + this.experimentCount, experimentsPublicProtocolResponseDataAttributes.experimentCount) && Objects.equals( this.exposureSchedule, experimentsPublicProtocolResponseDataAttributes.exposureSchedule) && Objects.equals( @@ -951,12 +1034,15 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash( analysisPlan, + archivedAt, assignmentSourceDefaultProperties, assignmentSourceId, + createdAt, defaultDurationDays, description, enforcement, environmentId, + experimentCount, exposureSchedule, isDurationRequiredToStart, isEqualSplitEnforced, @@ -984,16 +1070,19 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ExperimentsPublicProtocolResponseDataAttributes {\n"); sb.append(" analysisPlan: ").append(toIndentedString(analysisPlan)).append("\n"); + sb.append(" archivedAt: ").append(toIndentedString(archivedAt)).append("\n"); sb.append(" assignmentSourceDefaultProperties: ") .append(toIndentedString(assignmentSourceDefaultProperties)) .append("\n"); sb.append(" assignmentSourceId: ").append(toIndentedString(assignmentSourceId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" defaultDurationDays: ") .append(toIndentedString(defaultDurationDays)) .append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" enforcement: ").append(toIndentedString(enforcement)).append("\n"); sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" experimentCount: ").append(toIndentedString(experimentCount)).append("\n"); sb.append(" exposureSchedule: ").append(toIndentedString(exposureSchedule)).append("\n"); sb.append(" isDurationRequiredToStart: ") .append(toIndentedString(isDurationRequiredToStart)) diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsPublicProtocolResponseDataAttributesEnforcement.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPublicProtocolResponseDataAttributesEnforcement.java index 1e8422f49ac..38e842bb2ae 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ExperimentsPublicProtocolResponseDataAttributesEnforcement.java +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsPublicProtocolResponseDataAttributesEnforcement.java @@ -96,7 +96,7 @@ public ExperimentsPublicProtocolResponseDataAttributesEnforcement confidenceInte } /** - * LOCKED prevents changes to confidence interval method. EDITABLE permits changes. + * Always LOCKED. The server keeps this setting locked regardless of the supplied value. * * @return confidenceIntervalMethod */ @@ -205,7 +205,7 @@ public ExperimentsPublicProtocolResponseDataAttributesEnforcement flagSource(Str } /** - * LOCKED prevents changes to feature flag source. EDITABLE permits changes. + * Always LOCKED. The server keeps this setting locked regardless of the supplied value. * * @return flagSource */ @@ -337,7 +337,7 @@ public ExperimentsPublicProtocolResponseDataAttributesEnforcement subjectType( } /** - * LOCKED prevents changes to subject type. EDITABLE permits changes. + * Always LOCKED. The server keeps this setting locked regardless of the supplied value. * * @return subjectType */ diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceExperimentProtocolRequest.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceExperimentProtocolRequest.java new file mode 100644 index 00000000000..20b1c358af4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceExperimentProtocolRequest.java @@ -0,0 +1,158 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Replace a published protocol template. Omitted optional template fields are cleared. Omitted + * enforcement and migration_metadata are preserved. Enabled limits require their values; allocation + * settings require environment_id. + */ +@JsonPropertyOrder({ExperimentsReplaceExperimentProtocolRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsReplaceExperimentProtocolRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private ExperimentsReplaceExperimentProtocolRequestData data; + + public ExperimentsReplaceExperimentProtocolRequest() {} + + @JsonCreator + public ExperimentsReplaceExperimentProtocolRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + ExperimentsReplaceExperimentProtocolRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ExperimentsReplaceExperimentProtocolRequest data( + ExperimentsReplaceExperimentProtocolRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * JSON:API protocol request resource. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ExperimentsReplaceExperimentProtocolRequestData getData() { + return data; + } + + public void setData(ExperimentsReplaceExperimentProtocolRequestData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsReplaceExperimentProtocolRequest + */ + @JsonAnySetter + public ExperimentsReplaceExperimentProtocolRequest putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsReplaceExperimentProtocolRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsReplaceExperimentProtocolRequest experimentsReplaceExperimentProtocolRequest = + (ExperimentsReplaceExperimentProtocolRequest) o; + return Objects.equals(this.data, experimentsReplaceExperimentProtocolRequest.data) + && Objects.equals( + this.additionalProperties, + experimentsReplaceExperimentProtocolRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsReplaceExperimentProtocolRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceExperimentProtocolRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceExperimentProtocolRequestData.java new file mode 100644 index 00000000000..7a11cf559a4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceExperimentProtocolRequestData.java @@ -0,0 +1,224 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** JSON:API protocol request resource. */ +@JsonPropertyOrder({ + ExperimentsReplaceExperimentProtocolRequestData.JSON_PROPERTY_ATTRIBUTES, + ExperimentsReplaceExperimentProtocolRequestData.JSON_PROPERTY_ID, + ExperimentsReplaceExperimentProtocolRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsReplaceExperimentProtocolRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ExperimentsReplaceExperimentProtocolRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ExperimentsPublicProtocolResponseDataType type = + ExperimentsPublicProtocolResponseDataType.PROTOCOLS; + + public ExperimentsReplaceExperimentProtocolRequestData() {} + + @JsonCreator + public ExperimentsReplaceExperimentProtocolRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ExperimentsReplaceExperimentProtocolRequestDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ExperimentsPublicProtocolResponseDataType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ExperimentsReplaceExperimentProtocolRequestData attributes( + ExperimentsReplaceExperimentProtocolRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Replace a published protocol template. Omitted optional template fields are cleared. Omitted + * enforcement and migration_metadata are preserved. Enabled limits require their values; + * allocation settings require environment_id. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ExperimentsReplaceExperimentProtocolRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ExperimentsReplaceExperimentProtocolRequestDataAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public ExperimentsReplaceExperimentProtocolRequestData id(UUID id) { + this.id = id; + return this; + } + + /** + * Protocol ID. If supplied, must match the path protocol_id. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public ExperimentsReplaceExperimentProtocolRequestData type( + ExperimentsPublicProtocolResponseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Protocols resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ExperimentsPublicProtocolResponseDataType getType() { + return type; + } + + public void setType(ExperimentsPublicProtocolResponseDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsReplaceExperimentProtocolRequestData + */ + @JsonAnySetter + public ExperimentsReplaceExperimentProtocolRequestData putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsReplaceExperimentProtocolRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsReplaceExperimentProtocolRequestData + experimentsReplaceExperimentProtocolRequestData = + (ExperimentsReplaceExperimentProtocolRequestData) o; + return Objects.equals( + this.attributes, experimentsReplaceExperimentProtocolRequestData.attributes) + && Objects.equals(this.id, experimentsReplaceExperimentProtocolRequestData.id) + && Objects.equals(this.type, experimentsReplaceExperimentProtocolRequestData.type) + && Objects.equals( + this.additionalProperties, + experimentsReplaceExperimentProtocolRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsReplaceExperimentProtocolRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceExperimentProtocolRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceExperimentProtocolRequestDataAttributes.java new file mode 100644 index 00000000000..7a31477a5b2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceExperimentProtocolRequestDataAttributes.java @@ -0,0 +1,954 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Replace a published protocol template. Omitted optional template fields are cleared. Omitted + * enforcement and migration_metadata are preserved. Enabled limits require their values; allocation + * settings require environment_id. + */ +@JsonPropertyOrder({ + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_ANALYSIS_PLAN, + ExperimentsReplaceExperimentProtocolRequestDataAttributes + .JSON_PROPERTY_ASSIGNMENT_SOURCE_DEFAULT_PROPERTIES, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_ASSIGNMENT_SOURCE_ID, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_DEFAULT_DURATION_DAYS, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_ENFORCEMENT, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_ENVIRONMENT_ID, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_EXPOSURE_SCHEDULE, + ExperimentsReplaceExperimentProtocolRequestDataAttributes + .JSON_PROPERTY_IS_DURATION_REQUIRED_TO_START, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_IS_EQUAL_SPLIT_ENFORCED, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_IS_METRIC_LIMIT_ENABLED, + ExperimentsReplaceExperimentProtocolRequestDataAttributes + .JSON_PROPERTY_IS_MINIMUM_DURATION_ENABLED, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_METRIC_GROUPS, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_METRIC_LIMIT, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_MIGRATION_METADATA, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_MINIMUM_DURATION_UNIT, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_MINIMUM_DURATION_VALUE, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_PRIMARY_METRIC_ID, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_SUBJECT_TYPE_ID, + ExperimentsReplaceExperimentProtocolRequestDataAttributes.JSON_PROPERTY_TARGETING_RULES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsReplaceExperimentProtocolRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ANALYSIS_PLAN = "analysis_plan"; + private JsonNullable analysisPlan = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ASSIGNMENT_SOURCE_DEFAULT_PROPERTIES = + "assignment_source_default_properties"; + private List< + ExperimentsPublicProtocolResponseDataAttributesAssignmentSourceDefaultPropertiesItems> + assignmentSourceDefaultProperties = null; + + public static final String JSON_PROPERTY_ASSIGNMENT_SOURCE_ID = "assignment_source_id"; + private JsonNullable assignmentSourceId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DEFAULT_DURATION_DAYS = "default_duration_days"; + private JsonNullable defaultDurationDays = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ENFORCEMENT = "enforcement"; + private ExperimentsReplaceProtocolEnforcementInput enforcement; + + public static final String JSON_PROPERTY_ENVIRONMENT_ID = "environment_id"; + private JsonNullable environmentId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_EXPOSURE_SCHEDULE = "exposure_schedule"; + private JsonNullable exposureSchedule = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_IS_DURATION_REQUIRED_TO_START = + "is_duration_required_to_start"; + private Boolean isDurationRequiredToStart; + + public static final String JSON_PROPERTY_IS_EQUAL_SPLIT_ENFORCED = "is_equal_split_enforced"; + private Boolean isEqualSplitEnforced; + + public static final String JSON_PROPERTY_IS_METRIC_LIMIT_ENABLED = "is_metric_limit_enabled"; + private Boolean isMetricLimitEnabled; + + public static final String JSON_PROPERTY_IS_MINIMUM_DURATION_ENABLED = + "is_minimum_duration_enabled"; + private Boolean isMinimumDurationEnabled; + + public static final String JSON_PROPERTY_METRIC_GROUPS = "metric_groups"; + private List metricGroups = new ArrayList<>(); + + public static final String JSON_PROPERTY_METRIC_LIMIT = "metric_limit"; + private JsonNullable metricLimit = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MIGRATION_METADATA = "migration_metadata"; + private JsonNullable> migrationMetadata = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_MINIMUM_DURATION_UNIT = "minimum_duration_unit"; + private JsonNullable minimumDurationUnit = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_MINIMUM_DURATION_VALUE = "minimum_duration_value"; + private JsonNullable minimumDurationValue = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_PRIMARY_METRIC_ID = "primary_metric_id"; + private JsonNullable primaryMetricId = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SUBJECT_TYPE_ID = "subject_type_id"; + private UUID subjectTypeId; + + public static final String JSON_PROPERTY_TARGETING_RULES = "targeting_rules"; + private List targetingRules = null; + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes() {} + + @JsonCreator + public ExperimentsReplaceExperimentProtocolRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_IS_DURATION_REQUIRED_TO_START) + Boolean isDurationRequiredToStart, + @JsonProperty(required = true, value = JSON_PROPERTY_IS_EQUAL_SPLIT_ENFORCED) + Boolean isEqualSplitEnforced, + @JsonProperty(required = true, value = JSON_PROPERTY_IS_METRIC_LIMIT_ENABLED) + Boolean isMetricLimitEnabled, + @JsonProperty(required = true, value = JSON_PROPERTY_IS_MINIMUM_DURATION_ENABLED) + Boolean isMinimumDurationEnabled, + @JsonProperty(required = true, value = JSON_PROPERTY_METRIC_GROUPS) + List metricGroups, + @JsonProperty(required = true, value = JSON_PROPERTY_SUBJECT_TYPE_ID) UUID subjectTypeId) { + this.isDurationRequiredToStart = isDurationRequiredToStart; + this.isEqualSplitEnforced = isEqualSplitEnforced; + this.isMetricLimitEnabled = isMetricLimitEnabled; + this.isMinimumDurationEnabled = isMinimumDurationEnabled; + this.metricGroups = metricGroups; + for (ExperimentsProtocolMetricGroupInput item : metricGroups) { + this.unparsed |= item.unparsed; + } + this.subjectTypeId = subjectTypeId; + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes analysisPlan( + ExperimentsProtocolAnalysisPlanInput analysisPlan) { + this.analysisPlan = JsonNullable.of(analysisPlan); + return this; + } + + /** + * Statistical settings. Use default_duration_days for duration; + * target_duration_days is not accepted here. + * + * @return analysisPlan + */ + @jakarta.annotation.Nullable + @JsonIgnore + public ExperimentsProtocolAnalysisPlanInput getAnalysisPlan() { + return analysisPlan.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ANALYSIS_PLAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAnalysisPlan_JsonNullable() { + return analysisPlan; + } + + @JsonProperty(JSON_PROPERTY_ANALYSIS_PLAN) + public void setAnalysisPlan_JsonNullable( + JsonNullable analysisPlan) { + this.analysisPlan = analysisPlan; + } + + public void setAnalysisPlan(ExperimentsProtocolAnalysisPlanInput analysisPlan) { + this.analysisPlan = JsonNullable.of(analysisPlan); + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes + assignmentSourceDefaultProperties( + List< + ExperimentsPublicProtocolResponseDataAttributesAssignmentSourceDefaultPropertiesItems> + assignmentSourceDefaultProperties) { + this.assignmentSourceDefaultProperties = assignmentSourceDefaultProperties; + if (assignmentSourceDefaultProperties != null) { + for (ExperimentsPublicProtocolResponseDataAttributesAssignmentSourceDefaultPropertiesItems + item : assignmentSourceDefaultProperties) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes + addAssignmentSourceDefaultPropertiesItem( + ExperimentsPublicProtocolResponseDataAttributesAssignmentSourceDefaultPropertiesItems + assignmentSourceDefaultPropertiesItem) { + if (this.assignmentSourceDefaultProperties == null) { + this.assignmentSourceDefaultProperties = new ArrayList<>(); + } + this.assignmentSourceDefaultProperties.add(assignmentSourceDefaultPropertiesItem); + this.unparsed |= assignmentSourceDefaultPropertiesItem.unparsed; + return this; + } + + /** + * Assignment properties. + * + * @return assignmentSourceDefaultProperties + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_SOURCE_DEFAULT_PROPERTIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List + getAssignmentSourceDefaultProperties() { + return assignmentSourceDefaultProperties; + } + + public void setAssignmentSourceDefaultProperties( + List + assignmentSourceDefaultProperties) { + this.assignmentSourceDefaultProperties = assignmentSourceDefaultProperties; + if (assignmentSourceDefaultProperties != null) { + for (ExperimentsPublicProtocolResponseDataAttributesAssignmentSourceDefaultPropertiesItems + item : assignmentSourceDefaultProperties) { + this.unparsed |= item.unparsed; + } + } + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes assignmentSourceId( + UUID assignmentSourceId) { + this.assignmentSourceId = JsonNullable.of(assignmentSourceId); + return this; + } + + /** + * ID of the assignment source selected by the protocol. + * + * @return assignmentSourceId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public UUID getAssignmentSourceId() { + return assignmentSourceId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_SOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAssignmentSourceId_JsonNullable() { + return assignmentSourceId; + } + + @JsonProperty(JSON_PROPERTY_ASSIGNMENT_SOURCE_ID) + public void setAssignmentSourceId_JsonNullable(JsonNullable assignmentSourceId) { + this.assignmentSourceId = assignmentSourceId; + } + + public void setAssignmentSourceId(UUID assignmentSourceId) { + this.assignmentSourceId = JsonNullable.of(assignmentSourceId); + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes defaultDurationDays( + Long defaultDurationDays) { + this.defaultDurationDays = JsonNullable.of(defaultDurationDays); + return this; + } + + /** + * Default experiment duration supplied by the protocol, in days. minimum: 0 + * + * @return defaultDurationDays + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getDefaultDurationDays() { + return defaultDurationDays.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_DURATION_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDefaultDurationDays_JsonNullable() { + return defaultDurationDays; + } + + @JsonProperty(JSON_PROPERTY_DEFAULT_DURATION_DAYS) + public void setDefaultDurationDays_JsonNullable(JsonNullable defaultDurationDays) { + this.defaultDurationDays = defaultDurationDays; + } + + public void setDefaultDurationDays(Long defaultDurationDays) { + this.defaultDurationDays = JsonNullable.of(defaultDurationDays); + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes enforcement( + ExperimentsReplaceProtocolEnforcementInput enforcement) { + this.enforcement = enforcement; + this.unparsed |= enforcement.unparsed; + return this; + } + + /** + * Complete lock map. Omit this object to preserve current locks. Null is rejected; every field is + * required. + * + * @return enforcement + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENFORCEMENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ExperimentsReplaceProtocolEnforcementInput getEnforcement() { + return enforcement; + } + + public void setEnforcement(ExperimentsReplaceProtocolEnforcementInput enforcement) { + this.enforcement = enforcement; + if (enforcement != null) { + this.unparsed |= enforcement.unparsed; + } + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes environmentId( + UUID environmentId) { + this.environmentId = JsonNullable.of(environmentId); + return this; + } + + /** + * ID of the feature flag environment used by the experiment. + * + * @return environmentId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public UUID getEnvironmentId() { + return environmentId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ENVIRONMENT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getEnvironmentId_JsonNullable() { + return environmentId; + } + + @JsonProperty(JSON_PROPERTY_ENVIRONMENT_ID) + public void setEnvironmentId_JsonNullable(JsonNullable environmentId) { + this.environmentId = environmentId; + } + + public void setEnvironmentId(UUID environmentId) { + this.environmentId = JsonNullable.of(environmentId); + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes exposureSchedule( + ExperimentsProtocolExposureScheduleInput exposureSchedule) { + this.exposureSchedule = + JsonNullable.of(exposureSchedule); + return this; + } + + /** + * Traffic schedule. Publishing and replacement require NO_ROLLOUT with exactly one + * step, or UNIFORM_INTERVALS with a positive selection interval and at least one + * step. Requires environment_id. + * + * @return exposureSchedule + */ + @jakarta.annotation.Nullable + @JsonIgnore + public ExperimentsProtocolExposureScheduleInput getExposureSchedule() { + return exposureSchedule.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_EXPOSURE_SCHEDULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getExposureSchedule_JsonNullable() { + return exposureSchedule; + } + + @JsonProperty(JSON_PROPERTY_EXPOSURE_SCHEDULE) + public void setExposureSchedule_JsonNullable( + JsonNullable exposureSchedule) { + this.exposureSchedule = exposureSchedule; + } + + public void setExposureSchedule(ExperimentsProtocolExposureScheduleInput exposureSchedule) { + this.exposureSchedule = + JsonNullable.of(exposureSchedule); + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes isDurationRequiredToStart( + Boolean isDurationRequiredToStart) { + this.isDurationRequiredToStart = isDurationRequiredToStart; + return this; + } + + /** + * Whether the protocol requires a duration before an experiment can start. + * + * @return isDurationRequiredToStart + */ + @JsonProperty(JSON_PROPERTY_IS_DURATION_REQUIRED_TO_START) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsDurationRequiredToStart() { + return isDurationRequiredToStart; + } + + public void setIsDurationRequiredToStart(Boolean isDurationRequiredToStart) { + this.isDurationRequiredToStart = isDurationRequiredToStart; + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes isEqualSplitEnforced( + Boolean isEqualSplitEnforced) { + this.isEqualSplitEnforced = isEqualSplitEnforced; + return this; + } + + /** + * Whether the protocol requires equal traffic allocation across variants. + * + * @return isEqualSplitEnforced + */ + @JsonProperty(JSON_PROPERTY_IS_EQUAL_SPLIT_ENFORCED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsEqualSplitEnforced() { + return isEqualSplitEnforced; + } + + public void setIsEqualSplitEnforced(Boolean isEqualSplitEnforced) { + this.isEqualSplitEnforced = isEqualSplitEnforced; + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes isMetricLimitEnabled( + Boolean isMetricLimitEnabled) { + this.isMetricLimitEnabled = isMetricLimitEnabled; + return this; + } + + /** + * Whether the protocol limits the number of metrics. + * + * @return isMetricLimitEnabled + */ + @JsonProperty(JSON_PROPERTY_IS_METRIC_LIMIT_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsMetricLimitEnabled() { + return isMetricLimitEnabled; + } + + public void setIsMetricLimitEnabled(Boolean isMetricLimitEnabled) { + this.isMetricLimitEnabled = isMetricLimitEnabled; + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes isMinimumDurationEnabled( + Boolean isMinimumDurationEnabled) { + this.isMinimumDurationEnabled = isMinimumDurationEnabled; + return this; + } + + /** + * Whether the protocol enforces a minimum experiment duration. + * + * @return isMinimumDurationEnabled + */ + @JsonProperty(JSON_PROPERTY_IS_MINIMUM_DURATION_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsMinimumDurationEnabled() { + return isMinimumDurationEnabled; + } + + public void setIsMinimumDurationEnabled(Boolean isMinimumDurationEnabled) { + this.isMinimumDurationEnabled = isMinimumDurationEnabled; + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes metricGroups( + List metricGroups) { + this.metricGroups = metricGroups; + for (ExperimentsProtocolMetricGroupInput item : metricGroups) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes addMetricGroupsItem( + ExperimentsProtocolMetricGroupInput metricGroupsItem) { + this.metricGroups.add(metricGroupsItem); + this.unparsed |= metricGroupsItem.unparsed; + return this; + } + + /** + * Metric groups. + * + * @return metricGroups + */ + @JsonProperty(JSON_PROPERTY_METRIC_GROUPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getMetricGroups() { + return metricGroups; + } + + public void setMetricGroups(List metricGroups) { + this.metricGroups = metricGroups; + if (metricGroups != null) { + for (ExperimentsProtocolMetricGroupInput item : metricGroups) { + this.unparsed |= item.unparsed; + } + } + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes metricLimit(Long metricLimit) { + this.metricLimit = JsonNullable.of(metricLimit); + return this; + } + + /** + * Maximum number of metrics allowed by the protocol. minimum: 0 + * + * @return metricLimit + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getMetricLimit() { + return metricLimit.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_METRIC_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getMetricLimit_JsonNullable() { + return metricLimit; + } + + @JsonProperty(JSON_PROPERTY_METRIC_LIMIT) + public void setMetricLimit_JsonNullable(JsonNullable metricLimit) { + this.metricLimit = metricLimit; + } + + public void setMetricLimit(Long metricLimit) { + this.metricLimit = JsonNullable.of(metricLimit); + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes migrationMetadata( + Map migrationMetadata) { + this.migrationMetadata = JsonNullable.>of(migrationMetadata); + return this; + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes putMigrationMetadataItem( + String key, Object migrationMetadataItem) { + if (this.migrationMetadata == null || !this.migrationMetadata.isPresent()) { + this.migrationMetadata = JsonNullable.>of(new HashMap<>()); + } + try { + this.migrationMetadata.get().put(key, migrationMetadataItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Metadata for imported resources. Must encode to at most 4096 bytes. Null clears it; omission + * preserves it on update. + * + * @return migrationMetadata + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Map getMigrationMetadata() { + return migrationMetadata.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MIGRATION_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getMigrationMetadata_JsonNullable() { + return migrationMetadata; + } + + @JsonProperty(JSON_PROPERTY_MIGRATION_METADATA) + public void setMigrationMetadata_JsonNullable( + JsonNullable> migrationMetadata) { + this.migrationMetadata = migrationMetadata; + } + + public void setMigrationMetadata(Map migrationMetadata) { + this.migrationMetadata = JsonNullable.>of(migrationMetadata); + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes minimumDurationUnit( + String minimumDurationUnit) { + this.minimumDurationUnit = JsonNullable.of(minimumDurationUnit); + return this; + } + + /** + * Minimum duration unit, DAYS or WEEKS. + * + * @return minimumDurationUnit + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getMinimumDurationUnit() { + return minimumDurationUnit.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MINIMUM_DURATION_UNIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getMinimumDurationUnit_JsonNullable() { + return minimumDurationUnit; + } + + @JsonProperty(JSON_PROPERTY_MINIMUM_DURATION_UNIT) + public void setMinimumDurationUnit_JsonNullable(JsonNullable minimumDurationUnit) { + this.minimumDurationUnit = minimumDurationUnit; + } + + public void setMinimumDurationUnit(String minimumDurationUnit) { + this.minimumDurationUnit = JsonNullable.of(minimumDurationUnit); + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes minimumDurationValue( + Long minimumDurationValue) { + this.minimumDurationValue = JsonNullable.of(minimumDurationValue); + return this; + } + + /** + * Minimum experiment duration in the specified unit. minimum: 0 + * + * @return minimumDurationValue + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getMinimumDurationValue() { + return minimumDurationValue.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MINIMUM_DURATION_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getMinimumDurationValue_JsonNullable() { + return minimumDurationValue; + } + + @JsonProperty(JSON_PROPERTY_MINIMUM_DURATION_VALUE) + public void setMinimumDurationValue_JsonNullable(JsonNullable minimumDurationValue) { + this.minimumDurationValue = minimumDurationValue; + } + + public void setMinimumDurationValue(Long minimumDurationValue) { + this.minimumDurationValue = JsonNullable.of(minimumDurationValue); + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes primaryMetricId( + UUID primaryMetricId) { + this.primaryMetricId = JsonNullable.of(primaryMetricId); + return this; + } + + /** + * ID of the primary metric supplied by the protocol. + * + * @return primaryMetricId + */ + @jakarta.annotation.Nullable + @JsonIgnore + public UUID getPrimaryMetricId() { + return primaryMetricId.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_METRIC_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrimaryMetricId_JsonNullable() { + return primaryMetricId; + } + + @JsonProperty(JSON_PROPERTY_PRIMARY_METRIC_ID) + public void setPrimaryMetricId_JsonNullable(JsonNullable primaryMetricId) { + this.primaryMetricId = primaryMetricId; + } + + public void setPrimaryMetricId(UUID primaryMetricId) { + this.primaryMetricId = JsonNullable.of(primaryMetricId); + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes subjectTypeId( + UUID subjectTypeId) { + this.subjectTypeId = subjectTypeId; + return this; + } + + /** + * ID of the subject type used by this configuration. + * + * @return subjectTypeId + */ + @JsonProperty(JSON_PROPERTY_SUBJECT_TYPE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getSubjectTypeId() { + return subjectTypeId; + } + + public void setSubjectTypeId(UUID subjectTypeId) { + this.subjectTypeId = subjectTypeId; + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes targetingRules( + List targetingRules) { + this.targetingRules = targetingRules; + if (targetingRules != null) { + for (ExperimentsProtocolTargetingRuleInput item : targetingRules) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public ExperimentsReplaceExperimentProtocolRequestDataAttributes addTargetingRulesItem( + ExperimentsProtocolTargetingRuleInput targetingRulesItem) { + if (this.targetingRules == null) { + this.targetingRules = new ArrayList<>(); + } + this.targetingRules.add(targetingRulesItem); + this.unparsed |= targetingRulesItem.unparsed; + return this; + } + + /** + * Targeting rules. + * + * @return targetingRules + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TARGETING_RULES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTargetingRules() { + return targetingRules; + } + + public void setTargetingRules(List targetingRules) { + this.targetingRules = targetingRules; + if (targetingRules != null) { + for (ExperimentsProtocolTargetingRuleInput item : targetingRules) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsReplaceExperimentProtocolRequestDataAttributes + */ + @JsonAnySetter + public ExperimentsReplaceExperimentProtocolRequestDataAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** + * Return true if this ExperimentsReplaceExperimentProtocolRequestDataAttributes object is equal + * to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsReplaceExperimentProtocolRequestDataAttributes + experimentsReplaceExperimentProtocolRequestDataAttributes = + (ExperimentsReplaceExperimentProtocolRequestDataAttributes) o; + return Objects.equals( + this.analysisPlan, + experimentsReplaceExperimentProtocolRequestDataAttributes.analysisPlan) + && Objects.equals( + this.assignmentSourceDefaultProperties, + experimentsReplaceExperimentProtocolRequestDataAttributes + .assignmentSourceDefaultProperties) + && Objects.equals( + this.assignmentSourceId, + experimentsReplaceExperimentProtocolRequestDataAttributes.assignmentSourceId) + && Objects.equals( + this.defaultDurationDays, + experimentsReplaceExperimentProtocolRequestDataAttributes.defaultDurationDays) + && Objects.equals( + this.enforcement, experimentsReplaceExperimentProtocolRequestDataAttributes.enforcement) + && Objects.equals( + this.environmentId, + experimentsReplaceExperimentProtocolRequestDataAttributes.environmentId) + && Objects.equals( + this.exposureSchedule, + experimentsReplaceExperimentProtocolRequestDataAttributes.exposureSchedule) + && Objects.equals( + this.isDurationRequiredToStart, + experimentsReplaceExperimentProtocolRequestDataAttributes.isDurationRequiredToStart) + && Objects.equals( + this.isEqualSplitEnforced, + experimentsReplaceExperimentProtocolRequestDataAttributes.isEqualSplitEnforced) + && Objects.equals( + this.isMetricLimitEnabled, + experimentsReplaceExperimentProtocolRequestDataAttributes.isMetricLimitEnabled) + && Objects.equals( + this.isMinimumDurationEnabled, + experimentsReplaceExperimentProtocolRequestDataAttributes.isMinimumDurationEnabled) + && Objects.equals( + this.metricGroups, + experimentsReplaceExperimentProtocolRequestDataAttributes.metricGroups) + && Objects.equals( + this.metricLimit, experimentsReplaceExperimentProtocolRequestDataAttributes.metricLimit) + && Objects.equals( + this.migrationMetadata, + experimentsReplaceExperimentProtocolRequestDataAttributes.migrationMetadata) + && Objects.equals( + this.minimumDurationUnit, + experimentsReplaceExperimentProtocolRequestDataAttributes.minimumDurationUnit) + && Objects.equals( + this.minimumDurationValue, + experimentsReplaceExperimentProtocolRequestDataAttributes.minimumDurationValue) + && Objects.equals( + this.primaryMetricId, + experimentsReplaceExperimentProtocolRequestDataAttributes.primaryMetricId) + && Objects.equals( + this.subjectTypeId, + experimentsReplaceExperimentProtocolRequestDataAttributes.subjectTypeId) + && Objects.equals( + this.targetingRules, + experimentsReplaceExperimentProtocolRequestDataAttributes.targetingRules) + && Objects.equals( + this.additionalProperties, + experimentsReplaceExperimentProtocolRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + analysisPlan, + assignmentSourceDefaultProperties, + assignmentSourceId, + defaultDurationDays, + enforcement, + environmentId, + exposureSchedule, + isDurationRequiredToStart, + isEqualSplitEnforced, + isMetricLimitEnabled, + isMinimumDurationEnabled, + metricGroups, + metricLimit, + migrationMetadata, + minimumDurationUnit, + minimumDurationValue, + primaryMetricId, + subjectTypeId, + targetingRules, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsReplaceExperimentProtocolRequestDataAttributes {\n"); + sb.append(" analysisPlan: ").append(toIndentedString(analysisPlan)).append("\n"); + sb.append(" assignmentSourceDefaultProperties: ") + .append(toIndentedString(assignmentSourceDefaultProperties)) + .append("\n"); + sb.append(" assignmentSourceId: ").append(toIndentedString(assignmentSourceId)).append("\n"); + sb.append(" defaultDurationDays: ") + .append(toIndentedString(defaultDurationDays)) + .append("\n"); + sb.append(" enforcement: ").append(toIndentedString(enforcement)).append("\n"); + sb.append(" environmentId: ").append(toIndentedString(environmentId)).append("\n"); + sb.append(" exposureSchedule: ").append(toIndentedString(exposureSchedule)).append("\n"); + sb.append(" isDurationRequiredToStart: ") + .append(toIndentedString(isDurationRequiredToStart)) + .append("\n"); + sb.append(" isEqualSplitEnforced: ") + .append(toIndentedString(isEqualSplitEnforced)) + .append("\n"); + sb.append(" isMetricLimitEnabled: ") + .append(toIndentedString(isMetricLimitEnabled)) + .append("\n"); + sb.append(" isMinimumDurationEnabled: ") + .append(toIndentedString(isMinimumDurationEnabled)) + .append("\n"); + sb.append(" metricGroups: ").append(toIndentedString(metricGroups)).append("\n"); + sb.append(" metricLimit: ").append(toIndentedString(metricLimit)).append("\n"); + sb.append(" migrationMetadata: ").append(toIndentedString(migrationMetadata)).append("\n"); + sb.append(" minimumDurationUnit: ") + .append(toIndentedString(minimumDurationUnit)) + .append("\n"); + sb.append(" minimumDurationValue: ") + .append(toIndentedString(minimumDurationValue)) + .append("\n"); + sb.append(" primaryMetricId: ").append(toIndentedString(primaryMetricId)).append("\n"); + sb.append(" subjectTypeId: ").append(toIndentedString(subjectTypeId)).append("\n"); + sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceProtocolEnforcementInput.java b/src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceProtocolEnforcementInput.java new file mode 100644 index 00000000000..9591c299bed --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ExperimentsReplaceProtocolEnforcementInput.java @@ -0,0 +1,597 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Complete lock map. Omit this object to preserve current locks. Null is rejected; every field is + * required. + */ +@JsonPropertyOrder({ + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_CONFIDENCE_LEVEL, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_CUPED_CALCULATION, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_DEFAULT_DURATION, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_ENVIRONMENT, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_FLAG_SOURCE, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_NOTIFICATIONS, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_PRIMARY_METRIC, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_SECONDARY_METRICS, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_SPLIT_BY_EXPLORATION_DIMENSIONS, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_SUBJECT_TYPE, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_TARGETING_RULES, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_TRAFFIC_EXPOSURE, + ExperimentsReplaceProtocolEnforcementInput.JSON_PROPERTY_WAREHOUSE_EXPOSURE_SOURCE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ExperimentsReplaceProtocolEnforcementInput { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD = + "confidence_interval_method"; + private String confidenceIntervalMethod; + + public static final String JSON_PROPERTY_CONFIDENCE_LEVEL = "confidence_level"; + private String confidenceLevel; + + public static final String JSON_PROPERTY_CUPED_CALCULATION = "cuped_calculation"; + private String cupedCalculation; + + public static final String JSON_PROPERTY_DEFAULT_DURATION = "default_duration"; + private String defaultDuration; + + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; + private String environment; + + public static final String JSON_PROPERTY_FLAG_SOURCE = "flag_source"; + private String flagSource; + + public static final String JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION = + "multiple_testing_correction"; + private String multipleTestingCorrection; + + public static final String JSON_PROPERTY_NOTIFICATIONS = "notifications"; + private String notifications; + + public static final String JSON_PROPERTY_PRIMARY_METRIC = "primary_metric"; + private String primaryMetric; + + public static final String JSON_PROPERTY_SECONDARY_METRICS = "secondary_metrics"; + private String secondaryMetrics; + + public static final String JSON_PROPERTY_SPLIT_BY_EXPLORATION_DIMENSIONS = + "split_by_exploration_dimensions"; + private String splitByExplorationDimensions; + + public static final String JSON_PROPERTY_SUBJECT_TYPE = "subject_type"; + private String subjectType; + + public static final String JSON_PROPERTY_TARGETING_RULES = "targeting_rules"; + private String targetingRules; + + public static final String JSON_PROPERTY_TRAFFIC_EXPOSURE = "traffic_exposure"; + private String trafficExposure; + + public static final String JSON_PROPERTY_WAREHOUSE_EXPOSURE_SOURCE = "warehouse_exposure_source"; + private String warehouseExposureSource; + + public ExperimentsReplaceProtocolEnforcementInput() {} + + @JsonCreator + public ExperimentsReplaceProtocolEnforcementInput( + @JsonProperty(required = true, value = JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD) + String confidenceIntervalMethod, + @JsonProperty(required = true, value = JSON_PROPERTY_CONFIDENCE_LEVEL) String confidenceLevel, + @JsonProperty(required = true, value = JSON_PROPERTY_CUPED_CALCULATION) + String cupedCalculation, + @JsonProperty(required = true, value = JSON_PROPERTY_DEFAULT_DURATION) String defaultDuration, + @JsonProperty(required = true, value = JSON_PROPERTY_ENVIRONMENT) String environment, + @JsonProperty(required = true, value = JSON_PROPERTY_FLAG_SOURCE) String flagSource, + @JsonProperty(required = true, value = JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION) + String multipleTestingCorrection, + @JsonProperty(required = true, value = JSON_PROPERTY_NOTIFICATIONS) String notifications, + @JsonProperty(required = true, value = JSON_PROPERTY_PRIMARY_METRIC) String primaryMetric, + @JsonProperty(required = true, value = JSON_PROPERTY_SECONDARY_METRICS) + String secondaryMetrics, + @JsonProperty(required = true, value = JSON_PROPERTY_SPLIT_BY_EXPLORATION_DIMENSIONS) + String splitByExplorationDimensions, + @JsonProperty(required = true, value = JSON_PROPERTY_SUBJECT_TYPE) String subjectType, + @JsonProperty(required = true, value = JSON_PROPERTY_TARGETING_RULES) String targetingRules, + @JsonProperty(required = true, value = JSON_PROPERTY_TRAFFIC_EXPOSURE) String trafficExposure, + @JsonProperty(required = true, value = JSON_PROPERTY_WAREHOUSE_EXPOSURE_SOURCE) + String warehouseExposureSource) { + this.confidenceIntervalMethod = confidenceIntervalMethod; + this.confidenceLevel = confidenceLevel; + this.cupedCalculation = cupedCalculation; + this.defaultDuration = defaultDuration; + this.environment = environment; + this.flagSource = flagSource; + this.multipleTestingCorrection = multipleTestingCorrection; + this.notifications = notifications; + this.primaryMetric = primaryMetric; + this.secondaryMetrics = secondaryMetrics; + this.splitByExplorationDimensions = splitByExplorationDimensions; + this.subjectType = subjectType; + this.targetingRules = targetingRules; + this.trafficExposure = trafficExposure; + this.warehouseExposureSource = warehouseExposureSource; + } + + public ExperimentsReplaceProtocolEnforcementInput confidenceIntervalMethod( + String confidenceIntervalMethod) { + this.confidenceIntervalMethod = confidenceIntervalMethod; + return this; + } + + /** + * Always LOCKED. The server keeps this setting locked regardless of the supplied value. + * + * @return confidenceIntervalMethod + */ + @JsonProperty(JSON_PROPERTY_CONFIDENCE_INTERVAL_METHOD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getConfidenceIntervalMethod() { + return confidenceIntervalMethod; + } + + public void setConfidenceIntervalMethod(String confidenceIntervalMethod) { + this.confidenceIntervalMethod = confidenceIntervalMethod; + } + + public ExperimentsReplaceProtocolEnforcementInput confidenceLevel(String confidenceLevel) { + this.confidenceLevel = confidenceLevel; + return this; + } + + /** + * LOCKED prevents changes to confidence level. EDITABLE permits changes. + * + * @return confidenceLevel + */ + @JsonProperty(JSON_PROPERTY_CONFIDENCE_LEVEL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getConfidenceLevel() { + return confidenceLevel; + } + + public void setConfidenceLevel(String confidenceLevel) { + this.confidenceLevel = confidenceLevel; + } + + public ExperimentsReplaceProtocolEnforcementInput cupedCalculation(String cupedCalculation) { + this.cupedCalculation = cupedCalculation; + return this; + } + + /** + * LOCKED prevents changes to CUPED variance reduction. EDITABLE permits changes. + * + * @return cupedCalculation + */ + @JsonProperty(JSON_PROPERTY_CUPED_CALCULATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCupedCalculation() { + return cupedCalculation; + } + + public void setCupedCalculation(String cupedCalculation) { + this.cupedCalculation = cupedCalculation; + } + + public ExperimentsReplaceProtocolEnforcementInput defaultDuration(String defaultDuration) { + this.defaultDuration = defaultDuration; + return this; + } + + /** + * LOCKED prevents changes to default duration. EDITABLE permits changes. + * + * @return defaultDuration + */ + @JsonProperty(JSON_PROPERTY_DEFAULT_DURATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDefaultDuration() { + return defaultDuration; + } + + public void setDefaultDuration(String defaultDuration) { + this.defaultDuration = defaultDuration; + } + + public ExperimentsReplaceProtocolEnforcementInput environment(String environment) { + this.environment = environment; + return this; + } + + /** + * LOCKED prevents changes to environment. EDITABLE permits changes. + * + * @return environment + */ + @JsonProperty(JSON_PROPERTY_ENVIRONMENT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEnvironment() { + return environment; + } + + public void setEnvironment(String environment) { + this.environment = environment; + } + + public ExperimentsReplaceProtocolEnforcementInput flagSource(String flagSource) { + this.flagSource = flagSource; + return this; + } + + /** + * Always LOCKED. The server keeps this setting locked regardless of the supplied value. + * + * @return flagSource + */ + @JsonProperty(JSON_PROPERTY_FLAG_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFlagSource() { + return flagSource; + } + + public void setFlagSource(String flagSource) { + this.flagSource = flagSource; + } + + public ExperimentsReplaceProtocolEnforcementInput multipleTestingCorrection( + String multipleTestingCorrection) { + this.multipleTestingCorrection = multipleTestingCorrection; + return this; + } + + /** + * LOCKED prevents changes to multiple testing correction. EDITABLE permits changes. + * + * @return multipleTestingCorrection + */ + @JsonProperty(JSON_PROPERTY_MULTIPLE_TESTING_CORRECTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMultipleTestingCorrection() { + return multipleTestingCorrection; + } + + public void setMultipleTestingCorrection(String multipleTestingCorrection) { + this.multipleTestingCorrection = multipleTestingCorrection; + } + + public ExperimentsReplaceProtocolEnforcementInput notifications(String notifications) { + this.notifications = notifications; + return this; + } + + /** + * LOCKED prevents changes to notifications. EDITABLE permits changes. + * + * @return notifications + */ + @JsonProperty(JSON_PROPERTY_NOTIFICATIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getNotifications() { + return notifications; + } + + public void setNotifications(String notifications) { + this.notifications = notifications; + } + + public ExperimentsReplaceProtocolEnforcementInput primaryMetric(String primaryMetric) { + this.primaryMetric = primaryMetric; + return this; + } + + /** + * LOCKED prevents changes to primary metric. EDITABLE permits changes. + * + * @return primaryMetric + */ + @JsonProperty(JSON_PROPERTY_PRIMARY_METRIC) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPrimaryMetric() { + return primaryMetric; + } + + public void setPrimaryMetric(String primaryMetric) { + this.primaryMetric = primaryMetric; + } + + public ExperimentsReplaceProtocolEnforcementInput secondaryMetrics(String secondaryMetrics) { + this.secondaryMetrics = secondaryMetrics; + return this; + } + + /** + * LOCKED prevents changes to secondary metrics. EDITABLE permits changes. + * + * @return secondaryMetrics + */ + @JsonProperty(JSON_PROPERTY_SECONDARY_METRICS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSecondaryMetrics() { + return secondaryMetrics; + } + + public void setSecondaryMetrics(String secondaryMetrics) { + this.secondaryMetrics = secondaryMetrics; + } + + public ExperimentsReplaceProtocolEnforcementInput splitByExplorationDimensions( + String splitByExplorationDimensions) { + this.splitByExplorationDimensions = splitByExplorationDimensions; + return this; + } + + /** + * LOCKED prevents changes to result exploration dimensions. EDITABLE permits changes. + * + * @return splitByExplorationDimensions + */ + @JsonProperty(JSON_PROPERTY_SPLIT_BY_EXPLORATION_DIMENSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSplitByExplorationDimensions() { + return splitByExplorationDimensions; + } + + public void setSplitByExplorationDimensions(String splitByExplorationDimensions) { + this.splitByExplorationDimensions = splitByExplorationDimensions; + } + + public ExperimentsReplaceProtocolEnforcementInput subjectType(String subjectType) { + this.subjectType = subjectType; + return this; + } + + /** + * Always LOCKED. The server keeps this setting locked regardless of the supplied value. + * + * @return subjectType + */ + @JsonProperty(JSON_PROPERTY_SUBJECT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSubjectType() { + return subjectType; + } + + public void setSubjectType(String subjectType) { + this.subjectType = subjectType; + } + + public ExperimentsReplaceProtocolEnforcementInput targetingRules(String targetingRules) { + this.targetingRules = targetingRules; + return this; + } + + /** + * LOCKED prevents changes to targeting rules. EDITABLE permits changes. + * + * @return targetingRules + */ + @JsonProperty(JSON_PROPERTY_TARGETING_RULES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTargetingRules() { + return targetingRules; + } + + public void setTargetingRules(String targetingRules) { + this.targetingRules = targetingRules; + } + + public ExperimentsReplaceProtocolEnforcementInput trafficExposure(String trafficExposure) { + this.trafficExposure = trafficExposure; + return this; + } + + /** + * LOCKED prevents changes to traffic exposure. EDITABLE permits changes. + * + * @return trafficExposure + */ + @JsonProperty(JSON_PROPERTY_TRAFFIC_EXPOSURE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTrafficExposure() { + return trafficExposure; + } + + public void setTrafficExposure(String trafficExposure) { + this.trafficExposure = trafficExposure; + } + + public ExperimentsReplaceProtocolEnforcementInput warehouseExposureSource( + String warehouseExposureSource) { + this.warehouseExposureSource = warehouseExposureSource; + return this; + } + + /** + * LOCKED prevents changes to warehouse exposure source. EDITABLE permits changes. + * + * @return warehouseExposureSource + */ + @JsonProperty(JSON_PROPERTY_WAREHOUSE_EXPOSURE_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getWarehouseExposureSource() { + return warehouseExposureSource; + } + + public void setWarehouseExposureSource(String warehouseExposureSource) { + this.warehouseExposureSource = warehouseExposureSource; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ExperimentsReplaceProtocolEnforcementInput + */ + @JsonAnySetter + public ExperimentsReplaceProtocolEnforcementInput putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ExperimentsReplaceProtocolEnforcementInput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExperimentsReplaceProtocolEnforcementInput experimentsReplaceProtocolEnforcementInput = + (ExperimentsReplaceProtocolEnforcementInput) o; + return Objects.equals( + this.confidenceIntervalMethod, + experimentsReplaceProtocolEnforcementInput.confidenceIntervalMethod) + && Objects.equals( + this.confidenceLevel, experimentsReplaceProtocolEnforcementInput.confidenceLevel) + && Objects.equals( + this.cupedCalculation, experimentsReplaceProtocolEnforcementInput.cupedCalculation) + && Objects.equals( + this.defaultDuration, experimentsReplaceProtocolEnforcementInput.defaultDuration) + && Objects.equals(this.environment, experimentsReplaceProtocolEnforcementInput.environment) + && Objects.equals(this.flagSource, experimentsReplaceProtocolEnforcementInput.flagSource) + && Objects.equals( + this.multipleTestingCorrection, + experimentsReplaceProtocolEnforcementInput.multipleTestingCorrection) + && Objects.equals( + this.notifications, experimentsReplaceProtocolEnforcementInput.notifications) + && Objects.equals( + this.primaryMetric, experimentsReplaceProtocolEnforcementInput.primaryMetric) + && Objects.equals( + this.secondaryMetrics, experimentsReplaceProtocolEnforcementInput.secondaryMetrics) + && Objects.equals( + this.splitByExplorationDimensions, + experimentsReplaceProtocolEnforcementInput.splitByExplorationDimensions) + && Objects.equals(this.subjectType, experimentsReplaceProtocolEnforcementInput.subjectType) + && Objects.equals( + this.targetingRules, experimentsReplaceProtocolEnforcementInput.targetingRules) + && Objects.equals( + this.trafficExposure, experimentsReplaceProtocolEnforcementInput.trafficExposure) + && Objects.equals( + this.warehouseExposureSource, + experimentsReplaceProtocolEnforcementInput.warehouseExposureSource) + && Objects.equals( + this.additionalProperties, + experimentsReplaceProtocolEnforcementInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + confidenceIntervalMethod, + confidenceLevel, + cupedCalculation, + defaultDuration, + environment, + flagSource, + multipleTestingCorrection, + notifications, + primaryMetric, + secondaryMetrics, + splitByExplorationDimensions, + subjectType, + targetingRules, + trafficExposure, + warehouseExposureSource, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExperimentsReplaceProtocolEnforcementInput {\n"); + sb.append(" confidenceIntervalMethod: ") + .append(toIndentedString(confidenceIntervalMethod)) + .append("\n"); + sb.append(" confidenceLevel: ").append(toIndentedString(confidenceLevel)).append("\n"); + sb.append(" cupedCalculation: ").append(toIndentedString(cupedCalculation)).append("\n"); + sb.append(" defaultDuration: ").append(toIndentedString(defaultDuration)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" flagSource: ").append(toIndentedString(flagSource)).append("\n"); + sb.append(" multipleTestingCorrection: ") + .append(toIndentedString(multipleTestingCorrection)) + .append("\n"); + sb.append(" notifications: ").append(toIndentedString(notifications)).append("\n"); + sb.append(" primaryMetric: ").append(toIndentedString(primaryMetric)).append("\n"); + sb.append(" secondaryMetrics: ").append(toIndentedString(secondaryMetrics)).append("\n"); + sb.append(" splitByExplorationDimensions: ") + .append(toIndentedString(splitByExplorationDimensions)) + .append("\n"); + sb.append(" subjectType: ").append(toIndentedString(subjectType)).append("\n"); + sb.append(" targetingRules: ").append(toIndentedString(targetingRules)).append("\n"); + sb.append(" trafficExposure: ").append(toIndentedString(trafficExposure)).append("\n"); + sb.append(" warehouseExposureSource: ") + .append(toIndentedString(warehouseExposureSource)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/experiments.feature b/src/test/resources/com/datadog/api/client/v2/api/experiments.feature index a69a935467f..24f086abe36 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/experiments.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/experiments.feature @@ -8,6 +8,40 @@ Feature: Experiments And a valid "appKeyAuth" key in the system And an instance of "Experiments" API + @generated @skip @team:ddoghq/experimentation + Scenario: Archive experiment protocol returns "Invalid request or protocol settings." response + Given new "ArchiveExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Invalid request or protocol settings. + + @generated @skip @team:ddoghq/experimentation + Scenario: Archive experiment protocol returns "No protocol with this ID exists in the organization." response + Given new "ArchiveExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 No protocol with this ID exists in the organization. + + @team:ddoghq/experimentation + Scenario: Archive experiment protocol returns "OK" response + Given new "ArchiveExperimentProtocol" request + And there is a valid "experiment_protocol" in the system + And request contains "protocol_id" parameter from "experiment_protocol.data.id" + And request contains "expected_updated_at" parameter from "experiment_protocol.data.attributes.updated_at" + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.status" is equal to "ARCHIVED" + And the response "data.attributes.experiment_count" is equal to 0 + And the response "data.attributes" has field "created_at" + And the response "data.attributes" has field "archived_at" + + @generated @skip @team:ddoghq/experimentation + Scenario: Archive experiment protocol returns "The protocol is already archived or expected_updated_at is stale." response + Given new "ArchiveExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 The protocol is already archived or expected_updated_at is stale. + @generated @skip @team:ddoghq/experimentation Scenario: Archive exposure SQL model returns "Malformed exposure SQL model ID (not a valid UUID)." response Given new "ArchiveExposureSQLModel" request @@ -173,6 +207,38 @@ Feature: Experiments When the request is sent Then the response status is 415 Request body sent with a media type other than application/json or application/vnd.api+json. + @generated @skip @team:ddoghq/experimentation + Scenario: Create experiment protocol returns "A protocol with this name already exists." response + Given new "CreateExperimentProtocol" request + And body with value {"data": {"attributes": {"description": null, "migration_metadata": null, "name": "Checkout conversion"}, "type": "protocols"}} + When the request is sent + Then the response status is 409 A protocol with this name already exists. + + @team:ddoghq/experimentation + Scenario: Create experiment protocol returns "Created" response + Given new "CreateExperimentProtocol" request + And body with value {"data": {"type": "protocols", "attributes": {"name": "ex-protocol-{{ unique_hash }}", "description": "Protocol created by the API test."}}} + When the request is sent + Then the response status is 201 Created + And the response "data.attributes.status" is equal to "DRAFT" + And the response "data.attributes.experiment_count" is equal to 0 + And the response "data.attributes" has field "created_at" + And the response "data.attributes" does not have field "archived_at" + + @generated @skip @team:ddoghq/experimentation + Scenario: Create experiment protocol returns "Invalid request or protocol settings." response + Given new "CreateExperimentProtocol" request + And body with value {"data": {"attributes": {"description": null, "migration_metadata": null, "name": "Checkout conversion"}, "type": "protocols"}} + When the request is sent + Then the response status is 400 Invalid request or protocol settings. + + @generated @skip @team:ddoghq/experimentation + Scenario: Create experiment protocol returns "Unsupported request content type." response + Given new "CreateExperimentProtocol" request + And body with value {"data": {"attributes": {"description": null, "migration_metadata": null, "name": "Checkout conversion"}, "type": "protocols"}} + When the request is sent + Then the response status is 415 Unsupported request content type. + @team:ddoghq/experimentation Scenario: Create experiment returns "Created" response Given new "CreateExperiment" request @@ -371,6 +437,36 @@ Feature: Experiments When the request is sent Then the response status is 404 Not Found + @generated @skip @team:ddoghq/experimentation + Scenario: Delete experiment protocol returns "Invalid request or protocol settings." response + Given new "DeleteExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Invalid request or protocol settings. + + @team:ddoghq/experimentation + Scenario: Delete experiment protocol returns "No Content" response + Given new "DeleteExperimentProtocol" request + And there is a valid "experiment_protocol" in the system + And request contains "protocol_id" parameter from "experiment_protocol.data.id" + And request contains "expected_updated_at" parameter from "experiment_protocol.data.attributes.updated_at" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:ddoghq/experimentation + Scenario: Delete experiment protocol returns "No protocol with this ID exists in the organization." response + Given new "DeleteExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 No protocol with this ID exists in the organization. + + @generated @skip @team:ddoghq/experimentation + Scenario: Delete experiment protocol returns "The protocol has linked experiments or expected_updated_at is stale." response + Given new "DeleteExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 The protocol has linked experiments or expected_updated_at is stale. + @generated @skip @team:ddoghq/experimentation Scenario: Delete experiment returns "Malformed experiment ID (not a valid UUID)." response Given new "DeleteExperiment" request @@ -556,12 +652,15 @@ Feature: Experiments When the request is sent Then the response status is 404 Not Found - @generated @skip @team:ddoghq/experimentation + @team:ddoghq/experimentation Scenario: Get experiment protocol returns "OK" response Given new "GetExperimentProtocol" request - And request contains "protocol_id" parameter from "REPLACE.ME" + And there is a valid "experiment_protocol" in the system + And request contains "protocol_id" parameter from "experiment_protocol.data.id" When the request is sent Then the response status is 200 OK + And the response "data.id" has the same value as "experiment_protocol.data.id" + And the response "data.attributes.status" is equal to "DRAFT" @generated @skip @team:ddoghq/experimentation Scenario: Get experiment results returns "Malformed experiment ID (not a valid UUID), or the experiment is not configured for analysis." response @@ -794,8 +893,13 @@ Feature: Experiments @team:ddoghq/experimentation Scenario: List experiment protocols returns "OK" response Given new "ListExperimentProtocols" request + And there is a valid "experiment_protocol" in the system + And request contains "filter[status]" parameter with value ["DRAFT"] + And request contains "filter[query]" parameter from "experiment_protocol.data.attributes.name" When the request is sent Then the response status is 200 OK + And the response "data[0].id" has the same value as "experiment_protocol.data.id" + And the response "data[0].attributes.status" is equal to "DRAFT" @generated @skip @team:ddoghq/experimentation Scenario: List experiments returns "Invalid query parameter: bad page[offset]/page[limit], unknown sort field, invalid status, malformed protocol_id UUID, invalid result timestamp range, or a timestamp filter that is not RFC3339." response @@ -936,6 +1040,38 @@ Feature: Experiments When the request is sent Then the response status is 200 OK + @generated @skip @team:ddoghq/experimentation + Scenario: Publish experiment protocol returns "Invalid request or protocol settings." response + Given new "PublishExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Invalid request or protocol settings. + + @generated @skip @team:ddoghq/experimentation + Scenario: Publish experiment protocol returns "No protocol with this ID exists in the organization." response + Given new "PublishExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 No protocol with this ID exists in the organization. + + @team:ddoghq/experimentation + Scenario: Publish experiment protocol returns "OK" response + Given new "PublishExperimentProtocol" request + And there is a valid "experiment_subject_type" in the system + And there is a valid "experiment_protocol" in the system + And there is a valid "configured_experiment_protocol" in the system + And request contains "protocol_id" parameter from "configured_experiment_protocol.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.status" is equal to "PUBLISHED" + + @generated @skip @team:ddoghq/experimentation + Scenario: Publish experiment protocol returns "Only draft protocols can be published." response + Given new "PublishExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Only draft protocols can be published. + @generated @skip @team:ddoghq/experimentation Scenario: Refresh experiment results for org returns "Accepted" response Given new "RefreshExperimentResultsForOrg" request @@ -976,6 +1112,53 @@ Feature: Experiments When the request is sent Then the response status is 404 No experiment with this ID exists for the organization. + @generated @skip @team:ddoghq/experimentation + Scenario: Replace experiment protocol returns "Invalid request or protocol settings." response + Given new "ReplaceExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"analysis_plan": {"compute_cuped": null, "confidence_level": null, "multiple_testing_correction_method": null}, "assignment_source_default_properties": [{}], "assignment_source_id": "550e8400-e29b-41d4-a716-446655440000", "default_duration_days": null, "enforcement": {"confidence_interval_method": "LOCKED", "confidence_level": "EDITABLE", "cuped_calculation": "EDITABLE", "default_duration": "EDITABLE", "environment": "EDITABLE", "flag_source": "LOCKED", "multiple_testing_correction": "EDITABLE", "notifications": "EDITABLE", "primary_metric": "EDITABLE", "secondary_metrics": "EDITABLE", "split_by_exploration_dimensions": "EDITABLE", "subject_type": "LOCKED", "targeting_rules": "EDITABLE", "traffic_exposure": "EDITABLE", "warehouse_exposure_source": "EDITABLE"}, "environment_id": "550e8400-e29b-41d4-a716-446655440000", "exposure_schedule": {"guardrail_triggered_action": null, "rollout_steps": [{"grouped_step_index": null, "interval_ms": null}], "selection_interval_ms": null}, "is_duration_required_to_start": false, "is_equal_split_enforced": false, "is_metric_limit_enabled": false, "is_minimum_duration_enabled": false, "metric_groups": [], "metric_limit": null, "migration_metadata": null, "minimum_duration_unit": null, "minimum_duration_value": null, "primary_metric_id": "550e8400-e29b-41d4-a716-446655440000", "subject_type_id": "550e8400-e29b-41d4-a716-446655440000", "targeting_rules": [{"conditions": [{"saved_filter_id": null, "value": []}]}]}, "id": "550e8400-e29b-41d4-a716-446655440000", "type": "protocols"}} + When the request is sent + Then the response status is 400 Invalid request or protocol settings. + + @generated @skip @team:ddoghq/experimentation + Scenario: Replace experiment protocol returns "No protocol with this ID exists in the organization." response + Given new "ReplaceExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"analysis_plan": {"compute_cuped": null, "confidence_level": null, "multiple_testing_correction_method": null}, "assignment_source_default_properties": [{}], "assignment_source_id": "550e8400-e29b-41d4-a716-446655440000", "default_duration_days": null, "enforcement": {"confidence_interval_method": "LOCKED", "confidence_level": "EDITABLE", "cuped_calculation": "EDITABLE", "default_duration": "EDITABLE", "environment": "EDITABLE", "flag_source": "LOCKED", "multiple_testing_correction": "EDITABLE", "notifications": "EDITABLE", "primary_metric": "EDITABLE", "secondary_metrics": "EDITABLE", "split_by_exploration_dimensions": "EDITABLE", "subject_type": "LOCKED", "targeting_rules": "EDITABLE", "traffic_exposure": "EDITABLE", "warehouse_exposure_source": "EDITABLE"}, "environment_id": "550e8400-e29b-41d4-a716-446655440000", "exposure_schedule": {"guardrail_triggered_action": null, "rollout_steps": [{"grouped_step_index": null, "interval_ms": null}], "selection_interval_ms": null}, "is_duration_required_to_start": false, "is_equal_split_enforced": false, "is_metric_limit_enabled": false, "is_minimum_duration_enabled": false, "metric_groups": [], "metric_limit": null, "migration_metadata": null, "minimum_duration_unit": null, "minimum_duration_value": null, "primary_metric_id": "550e8400-e29b-41d4-a716-446655440000", "subject_type_id": "550e8400-e29b-41d4-a716-446655440000", "targeting_rules": [{"conditions": [{"saved_filter_id": null, "value": []}]}]}, "id": "550e8400-e29b-41d4-a716-446655440000", "type": "protocols"}} + When the request is sent + Then the response status is 404 No protocol with this ID exists in the organization. + + @team:ddoghq/experimentation + Scenario: Replace experiment protocol returns "OK" response + Given new "ReplaceExperimentProtocol" request + And there is a valid "experiment_subject_type" in the system + And there is a valid "experiment_protocol" in the system + And there is a valid "configured_experiment_protocol" in the system + And there is a valid "published_protocol" in the system + And request contains "protocol_id" parameter from "published_protocol.data.id" + And request contains "expected_updated_at" parameter from "published_protocol.data.attributes.updated_at" + And body with value {"data": {"type": "protocols", "id": "{{ published_protocol.data.id }}", "attributes": {"subject_type_id": "{{ experiment_subject_type.data.id }}", "is_equal_split_enforced": false, "is_minimum_duration_enabled": false, "is_duration_required_to_start": false, "is_metric_limit_enabled": false, "metric_groups": [], "default_duration_days": 14}}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.status" is equal to "PUBLISHED" + And the response "data.attributes.default_duration_days" is equal to 14 + + @generated @skip @team:ddoghq/experimentation + Scenario: Replace experiment protocol returns "The protocol is not published or expected_updated_at is stale." response + Given new "ReplaceExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"analysis_plan": {"compute_cuped": null, "confidence_level": null, "multiple_testing_correction_method": null}, "assignment_source_default_properties": [{}], "assignment_source_id": "550e8400-e29b-41d4-a716-446655440000", "default_duration_days": null, "enforcement": {"confidence_interval_method": "LOCKED", "confidence_level": "EDITABLE", "cuped_calculation": "EDITABLE", "default_duration": "EDITABLE", "environment": "EDITABLE", "flag_source": "LOCKED", "multiple_testing_correction": "EDITABLE", "notifications": "EDITABLE", "primary_metric": "EDITABLE", "secondary_metrics": "EDITABLE", "split_by_exploration_dimensions": "EDITABLE", "subject_type": "LOCKED", "targeting_rules": "EDITABLE", "traffic_exposure": "EDITABLE", "warehouse_exposure_source": "EDITABLE"}, "environment_id": "550e8400-e29b-41d4-a716-446655440000", "exposure_schedule": {"guardrail_triggered_action": null, "rollout_steps": [{"grouped_step_index": null, "interval_ms": null}], "selection_interval_ms": null}, "is_duration_required_to_start": false, "is_equal_split_enforced": false, "is_metric_limit_enabled": false, "is_minimum_duration_enabled": false, "metric_groups": [], "metric_limit": null, "migration_metadata": null, "minimum_duration_unit": null, "minimum_duration_value": null, "primary_metric_id": "550e8400-e29b-41d4-a716-446655440000", "subject_type_id": "550e8400-e29b-41d4-a716-446655440000", "targeting_rules": [{"conditions": [{"saved_filter_id": null, "value": []}]}]}, "id": "550e8400-e29b-41d4-a716-446655440000", "type": "protocols"}} + When the request is sent + Then the response status is 409 The protocol is not published or expected_updated_at is stale. + + @generated @skip @team:ddoghq/experimentation + Scenario: Replace experiment protocol returns "Unsupported request content type." response + Given new "ReplaceExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"analysis_plan": {"compute_cuped": null, "confidence_level": null, "multiple_testing_correction_method": null}, "assignment_source_default_properties": [{}], "assignment_source_id": "550e8400-e29b-41d4-a716-446655440000", "default_duration_days": null, "enforcement": {"confidence_interval_method": "LOCKED", "confidence_level": "EDITABLE", "cuped_calculation": "EDITABLE", "default_duration": "EDITABLE", "environment": "EDITABLE", "flag_source": "LOCKED", "multiple_testing_correction": "EDITABLE", "notifications": "EDITABLE", "primary_metric": "EDITABLE", "secondary_metrics": "EDITABLE", "split_by_exploration_dimensions": "EDITABLE", "subject_type": "LOCKED", "targeting_rules": "EDITABLE", "traffic_exposure": "EDITABLE", "warehouse_exposure_source": "EDITABLE"}, "environment_id": "550e8400-e29b-41d4-a716-446655440000", "exposure_schedule": {"guardrail_triggered_action": null, "rollout_steps": [{"grouped_step_index": null, "interval_ms": null}], "selection_interval_ms": null}, "is_duration_required_to_start": false, "is_equal_split_enforced": false, "is_metric_limit_enabled": false, "is_minimum_duration_enabled": false, "metric_groups": [], "metric_limit": null, "migration_metadata": null, "minimum_duration_unit": null, "minimum_duration_value": null, "primary_metric_id": "550e8400-e29b-41d4-a716-446655440000", "subject_type_id": "550e8400-e29b-41d4-a716-446655440000", "targeting_rules": [{"conditions": [{"saved_filter_id": null, "value": []}]}]}, "id": "550e8400-e29b-41d4-a716-446655440000", "type": "protocols"}} + When the request is sent + Then the response status is 415 Unsupported request content type. + @generated @skip @team:ddoghq/experimentation Scenario: Set default subject type returns "Malformed subject type ID (not a valid UUID)." response Given new "SetDefaultSubjectType" request @@ -1147,6 +1330,49 @@ Feature: Experiments When the request is sent Then the response status is 415 Request body sent with a media type other than application/json or application/vnd.api+json. + @generated @skip @team:ddoghq/experimentation + Scenario: Update experiment protocol returns "Invalid request or protocol settings." response + Given new "PatchExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"analysis_plan": {"compute_cuped": null, "confidence_interval_method": null, "confidence_level": null, "multiple_testing_correction_method": null}, "assignment_source_default_properties": [{}], "assignment_source_id": null, "default_duration_days": null, "description": null, "enforcement": {"confidence_interval_method": null, "confidence_level": null, "cuped_calculation": null, "default_duration": null, "environment": null, "flag_source": null, "multiple_testing_correction": null, "notifications": null, "primary_metric": null, "secondary_metrics": null, "split_by_exploration_dimensions": null, "subject_type": null, "targeting_rules": null, "traffic_exposure": null, "warehouse_exposure_source": null}, "environment_id": null, "exposure_schedule": {"autostart": null, "guardrail_triggered_action": null, "rollout_steps": [{"grouped_step_index": null, "interval_ms": null}], "selection_interval_ms": null, "strategy": null}, "is_duration_required_to_start": false, "is_equal_split_enforced": false, "is_metric_limit_enabled": false, "is_minimum_duration_enabled": false, "metric_groups": [{"metrics": [{"metric_id": "550e8400-e29b-41d4-a716-446655440000"}]}], "metric_limit": null, "migration_metadata": null, "minimum_duration_unit": null, "minimum_duration_value": null, "name": "Checkout conversion", "primary_metric_id": null, "subject_type_id": null, "targeting_rules": [{"conditions": [{"saved_filter_id": null, "value": []}]}]}, "id": "550e8400-e29b-41d4-a716-446655440000", "type": "protocols"}} + When the request is sent + Then the response status is 400 Invalid request or protocol settings. + + @generated @skip @team:ddoghq/experimentation + Scenario: Update experiment protocol returns "No protocol with this ID exists in the organization." response + Given new "PatchExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"analysis_plan": {"compute_cuped": null, "confidence_interval_method": null, "confidence_level": null, "multiple_testing_correction_method": null}, "assignment_source_default_properties": [{}], "assignment_source_id": null, "default_duration_days": null, "description": null, "enforcement": {"confidence_interval_method": null, "confidence_level": null, "cuped_calculation": null, "default_duration": null, "environment": null, "flag_source": null, "multiple_testing_correction": null, "notifications": null, "primary_metric": null, "secondary_metrics": null, "split_by_exploration_dimensions": null, "subject_type": null, "targeting_rules": null, "traffic_exposure": null, "warehouse_exposure_source": null}, "environment_id": null, "exposure_schedule": {"autostart": null, "guardrail_triggered_action": null, "rollout_steps": [{"grouped_step_index": null, "interval_ms": null}], "selection_interval_ms": null, "strategy": null}, "is_duration_required_to_start": false, "is_equal_split_enforced": false, "is_metric_limit_enabled": false, "is_minimum_duration_enabled": false, "metric_groups": [{"metrics": [{"metric_id": "550e8400-e29b-41d4-a716-446655440000"}]}], "metric_limit": null, "migration_metadata": null, "minimum_duration_unit": null, "minimum_duration_value": null, "name": "Checkout conversion", "primary_metric_id": null, "subject_type_id": null, "targeting_rules": [{"conditions": [{"saved_filter_id": null, "value": []}]}]}, "id": "550e8400-e29b-41d4-a716-446655440000", "type": "protocols"}} + When the request is sent + Then the response status is 404 No protocol with this ID exists in the organization. + + @team:ddoghq/experimentation + Scenario: Update experiment protocol returns "OK" response + Given new "PatchExperimentProtocol" request + And there is a valid "experiment_protocol" in the system + And request contains "protocol_id" parameter from "experiment_protocol.data.id" + And body with value {"data": {"type": "protocols", "id": "{{ experiment_protocol.data.id }}", "attributes": {"description": "Updated protocol description."}}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.description" is equal to "Updated protocol description." + And the response "data.attributes.status" is equal to "DRAFT" + + @generated @skip @team:ddoghq/experimentation + Scenario: Update experiment protocol returns "The protocol is archived, a published protocol receives settings changes, or the name is already in use." response + Given new "PatchExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"analysis_plan": {"compute_cuped": null, "confidence_interval_method": null, "confidence_level": null, "multiple_testing_correction_method": null}, "assignment_source_default_properties": [{}], "assignment_source_id": null, "default_duration_days": null, "description": null, "enforcement": {"confidence_interval_method": null, "confidence_level": null, "cuped_calculation": null, "default_duration": null, "environment": null, "flag_source": null, "multiple_testing_correction": null, "notifications": null, "primary_metric": null, "secondary_metrics": null, "split_by_exploration_dimensions": null, "subject_type": null, "targeting_rules": null, "traffic_exposure": null, "warehouse_exposure_source": null}, "environment_id": null, "exposure_schedule": {"autostart": null, "guardrail_triggered_action": null, "rollout_steps": [{"grouped_step_index": null, "interval_ms": null}], "selection_interval_ms": null, "strategy": null}, "is_duration_required_to_start": false, "is_equal_split_enforced": false, "is_metric_limit_enabled": false, "is_minimum_duration_enabled": false, "metric_groups": [{"metrics": [{"metric_id": "550e8400-e29b-41d4-a716-446655440000"}]}], "metric_limit": null, "migration_metadata": null, "minimum_duration_unit": null, "minimum_duration_value": null, "name": "Checkout conversion", "primary_metric_id": null, "subject_type_id": null, "targeting_rules": [{"conditions": [{"saved_filter_id": null, "value": []}]}]}, "id": "550e8400-e29b-41d4-a716-446655440000", "type": "protocols"}} + When the request is sent + Then the response status is 409 The protocol is archived, a published protocol receives settings changes, or the name is already in use. + + @generated @skip @team:ddoghq/experimentation + Scenario: Update experiment protocol returns "Unsupported request content type." response + Given new "PatchExperimentProtocol" request + And request contains "protocol_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"analysis_plan": {"compute_cuped": null, "confidence_interval_method": null, "confidence_level": null, "multiple_testing_correction_method": null}, "assignment_source_default_properties": [{}], "assignment_source_id": null, "default_duration_days": null, "description": null, "enforcement": {"confidence_interval_method": null, "confidence_level": null, "cuped_calculation": null, "default_duration": null, "environment": null, "flag_source": null, "multiple_testing_correction": null, "notifications": null, "primary_metric": null, "secondary_metrics": null, "split_by_exploration_dimensions": null, "subject_type": null, "targeting_rules": null, "traffic_exposure": null, "warehouse_exposure_source": null}, "environment_id": null, "exposure_schedule": {"autostart": null, "guardrail_triggered_action": null, "rollout_steps": [{"grouped_step_index": null, "interval_ms": null}], "selection_interval_ms": null, "strategy": null}, "is_duration_required_to_start": false, "is_equal_split_enforced": false, "is_metric_limit_enabled": false, "is_minimum_duration_enabled": false, "metric_groups": [{"metrics": [{"metric_id": "550e8400-e29b-41d4-a716-446655440000"}]}], "metric_limit": null, "migration_metadata": null, "minimum_duration_unit": null, "minimum_duration_value": null, "name": "Checkout conversion", "primary_metric_id": null, "subject_type_id": null, "targeting_rules": [{"conditions": [{"saved_filter_id": null, "value": []}]}]}, "id": "550e8400-e29b-41d4-a716-446655440000", "type": "protocols"}} + When the request is sent + Then the response status is 415 Unsupported request content type. + @generated @skip @team:ddoghq/experimentation Scenario: Update exposure SQL model returns "Malformed exposure SQL model ID, malformed body, validation failure, or the SQL was rejected by the warehouse validator." response Given new "UpdateExposureSQLModel" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 1eecd8ab2df..5d42a92b4ea 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -499,6 +499,46 @@ "tag": "Experiments", "operationId": "CreateMetric" }, + { + "parameters": [ + { + "name": "body", + "value": "{\"data\": {\"type\": \"protocols\", \"attributes\": {\"name\": \"ex-protocol-{{ unique_hash }}\"}}}" + } + ], + "step": "there is a valid \"experiment_protocol\" in the system", + "key": "experiment_protocol", + "tag": "Experiments", + "operationId": "CreateExperimentProtocol" + }, + { + "parameters": [ + { + "name": "protocol_id", + "value": "\"{{ experiment_protocol.data.id }}\"" + }, + { + "name": "body", + "value": "{\"data\": {\"type\": \"protocols\", \"id\": \"{{ experiment_protocol.data.id }}\", \"attributes\": {\"subject_type_id\": \"{{ experiment_subject_type.data.id }}\"}}}" + } + ], + "step": "there is a valid \"configured_experiment_protocol\" in the system", + "key": "configured_experiment_protocol", + "tag": "Experiments", + "operationId": "PatchExperimentProtocol" + }, + { + "parameters": [ + { + "name": "protocol_id", + "value": "\"{{ configured_experiment_protocol.data.id }}\"" + } + ], + "step": "there is a valid \"published_protocol\" in the system", + "key": "published_protocol", + "tag": "Experiments", + "operationId": "PublishExperimentProtocol" + }, { "parameters": [ { diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 37961c9528f..91e3e8faf2a 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -2980,12 +2980,69 @@ "type": "safe" } }, + "CreateExperimentProtocol": { + "tag": "Experiments", + "undo": { + "operationId": "DeleteExperimentProtocol", + "parameters": [ + { + "name": "protocol_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteExperimentProtocol": { + "tag": "Experiments", + "undo": { + "type": "idempotent" + } + }, "GetExperimentProtocol": { "tag": "Experiments", "undo": { "type": "safe" } }, + "PatchExperimentProtocol": { + "tag": "Experiments", + "undo": { + "type": "idempotent" + } + }, + "ReplaceExperimentProtocol": { + "tag": "Experiments", + "undo": { + "type": "idempotent" + } + }, + "ArchiveExperimentProtocol": { + "tag": "Experiments", + "undo": { + "operationId": "DeleteExperimentProtocol", + "parameters": [ + { + "name": "protocol_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "PublishExperimentProtocol": { + "tag": "Experiments", + "undo": { + "operationId": "DeleteExperimentProtocol", + "parameters": [ + { + "name": "protocol_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, "RefreshExperimentResultsForOrg": { "tag": "Experiments", "undo": { diff --git a/src/test/resources/generated-test/test-runner-data/manifest.json b/src/test/resources/generated-test/test-runner-data/manifest.json index ecf5236525b..25bf505ab81 100644 --- a/src/test/resources/generated-test/test-runner-data/manifest.json +++ b/src/test/resources/generated-test/test-runner-data/manifest.json @@ -5586,6 +5586,13 @@ "scenario": "Update an execution policy returns \"OK\" response", "version": "v2" }, + { + "feature": "Experiments", + "feature_file": "../../com/datadog/api/client/v2/api/experiments.feature", + "file": "v2/experiments/archive-experiment-protocol-returns-ok-response.json", + "scenario": "Archive experiment protocol returns \"OK\" response", + "version": "v2" + }, { "feature": "Experiments", "feature_file": "../../com/datadog/api/client/v2/api/experiments.feature", @@ -5607,6 +5614,13 @@ "scenario": "Create experiment metric group returns \"Created\" response", "version": "v2" }, + { + "feature": "Experiments", + "feature_file": "../../com/datadog/api/client/v2/api/experiments.feature", + "file": "v2/experiments/create-experiment-protocol-returns-created-response.json", + "scenario": "Create experiment protocol returns \"Created\" response", + "version": "v2" + }, { "feature": "Experiments", "feature_file": "../../com/datadog/api/client/v2/api/experiments.feature", @@ -5642,6 +5656,13 @@ "scenario": "Delete experiment metric group returns \"No Content\" response", "version": "v2" }, + { + "feature": "Experiments", + "feature_file": "../../com/datadog/api/client/v2/api/experiments.feature", + "file": "v2/experiments/delete-experiment-protocol-returns-no-content-response.json", + "scenario": "Delete experiment protocol returns \"No Content\" response", + "version": "v2" + }, { "feature": "Experiments", "feature_file": "../../com/datadog/api/client/v2/api/experiments.feature", @@ -5684,6 +5705,13 @@ "scenario": "Get experiment diagnostics returns \"OK\" response", "version": "v2" }, + { + "feature": "Experiments", + "feature_file": "../../com/datadog/api/client/v2/api/experiments.feature", + "file": "v2/experiments/get-experiment-protocol-returns-ok-response.json", + "scenario": "Get experiment protocol returns \"OK\" response", + "version": "v2" + }, { "feature": "Experiments", "feature_file": "../../com/datadog/api/client/v2/api/experiments.feature", @@ -5789,6 +5817,20 @@ "scenario": "Patch subject type returns \"OK\" response", "version": "v2" }, + { + "feature": "Experiments", + "feature_file": "../../com/datadog/api/client/v2/api/experiments.feature", + "file": "v2/experiments/publish-experiment-protocol-returns-ok-response.json", + "scenario": "Publish experiment protocol returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Experiments", + "feature_file": "../../com/datadog/api/client/v2/api/experiments.feature", + "file": "v2/experiments/replace-experiment-protocol-returns-ok-response.json", + "scenario": "Replace experiment protocol returns \"OK\" response", + "version": "v2" + }, { "feature": "Experiments", "feature_file": "../../com/datadog/api/client/v2/api/experiments.feature", @@ -5810,6 +5852,13 @@ "scenario": "Update experiment metric group returns \"OK\" response", "version": "v2" }, + { + "feature": "Experiments", + "feature_file": "../../com/datadog/api/client/v2/api/experiments.feature", + "file": "v2/experiments/update-experiment-protocol-returns-ok-response.json", + "scenario": "Update experiment protocol returns \"OK\" response", + "version": "v2" + }, { "feature": "Experiments", "feature_file": "../../com/datadog/api/client/v2/api/experiments.feature", diff --git a/src/test/resources/generated-test/test-runner-data/v2/experiments/archive-experiment-protocol-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/experiments/archive-experiment-protocol-returns-ok-response.json new file mode 100644 index 00000000000..36662f76215 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/experiments/archive-experiment-protocol-returns-ok-response.json @@ -0,0 +1,51 @@ +{ + "api": "Experiments", + "expected_status": 200, + "feature": "Experiments", + "id": "v2/Experiments/Archive experiment protocol returns \"OK\" response", + "operation_id": "ArchiveExperimentProtocol", + "request": { + "body": null, + "content_type": null, + "method": "POST", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "protocol_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "experiment_protocol.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "expected_updated_at", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "experiment_protocol.data.attributes.updated_at", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/experiments/protocols/{protocol_id}/archive" + }, + "scenario": "Archive experiment protocol returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/experiments/create-experiment-protocol-returns-created-response.json b/src/test/resources/generated-test/test-runner-data/v2/experiments/create-experiment-protocol-returns-created-response.json new file mode 100644 index 00000000000..ae906bb5c83 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/experiments/create-experiment-protocol-returns-created-response.json @@ -0,0 +1,34 @@ +{ + "api": "Experiments", + "expected_status": 201, + "feature": "Experiments", + "id": "v2/Experiments/Create experiment protocol returns \"Created\" response", + "operation_id": "CreateExperimentProtocol", + "request": { + "body": { + "schema": { + "format": null, + "ref": "ExperimentsCreateExperimentProtocolRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "description": "Protocol created by the API test.", + "name": "ex-protocol-{{ unique_hash }}" + }, + "type": "protocols" + } + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [], + "path": "/api/v2/experiments/protocols" + }, + "scenario": "Create experiment protocol returns \"Created\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/experiments/delete-experiment-protocol-returns-no-content-response.json b/src/test/resources/generated-test/test-runner-data/v2/experiments/delete-experiment-protocol-returns-no-content-response.json new file mode 100644 index 00000000000..a0344868e3f --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/experiments/delete-experiment-protocol-returns-no-content-response.json @@ -0,0 +1,51 @@ +{ + "api": "Experiments", + "expected_status": 204, + "feature": "Experiments", + "id": "v2/Experiments/Delete experiment protocol returns \"No Content\" response", + "operation_id": "DeleteExperimentProtocol", + "request": { + "body": null, + "content_type": null, + "method": "DELETE", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "protocol_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "experiment_protocol.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "expected_updated_at", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "experiment_protocol.data.attributes.updated_at", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/experiments/protocols/{protocol_id}" + }, + "scenario": "Delete experiment protocol returns \"No Content\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/experiments/get-experiment-protocol-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/experiments/get-experiment-protocol-returns-ok-response.json new file mode 100644 index 00000000000..3bd6fdb317f --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/experiments/get-experiment-protocol-returns-ok-response.json @@ -0,0 +1,35 @@ +{ + "api": "Experiments", + "expected_status": 200, + "feature": "Experiments", + "id": "v2/Experiments/Get experiment protocol returns \"OK\" response", + "operation_id": "GetExperimentProtocol", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "protocol_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "experiment_protocol.data.id", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/experiments/protocols/{protocol_id}" + }, + "scenario": "Get experiment protocol returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/experiments/list-experiment-protocols-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/experiments/list-experiment-protocols-returns-ok-response.json index 1530ea16a33..49d9cb171ac 100644 --- a/src/test/resources/generated-test/test-runner-data/v2/experiments/list-experiment-protocols-returns-ok-response.json +++ b/src/test/resources/generated-test/test-runner-data/v2/experiments/list-experiment-protocols-returns-ok-response.json @@ -9,7 +9,47 @@ "content_type": null, "method": "GET", "pagination": false, - "parameters": [], + "parameters": [ + { + "explode": true, + "in": "query", + "name": "filter[status]", + "required": false, + "schema": { + "format": null, + "items": { + "format": null, + "ref": "ExperimentsPublicProtocolResponseDataAttributesStatus", + "type": "string" + }, + "ref": null, + "type": "array" + }, + "source": { + "type": "literal", + "value": [ + "DRAFT" + ] + }, + "style": "form" + }, + { + "explode": null, + "in": "query", + "name": "filter[query]", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "experiment_protocol.data.attributes.name", + "type": "fixture" + }, + "style": null + } + ], "path": "/api/v2/experiments/protocols" }, "scenario": "List experiment protocols returns \"OK\" response", diff --git a/src/test/resources/generated-test/test-runner-data/v2/experiments/publish-experiment-protocol-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/experiments/publish-experiment-protocol-returns-ok-response.json new file mode 100644 index 00000000000..0d9ae6bcd90 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/experiments/publish-experiment-protocol-returns-ok-response.json @@ -0,0 +1,35 @@ +{ + "api": "Experiments", + "expected_status": 200, + "feature": "Experiments", + "id": "v2/Experiments/Publish experiment protocol returns \"OK\" response", + "operation_id": "PublishExperimentProtocol", + "request": { + "body": null, + "content_type": null, + "method": "POST", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "protocol_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "configured_experiment_protocol.data.id", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/experiments/protocols/{protocol_id}/publish" + }, + "scenario": "Publish experiment protocol returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/experiments/replace-experiment-protocol-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/experiments/replace-experiment-protocol-returns-ok-response.json new file mode 100644 index 00000000000..7aeee316647 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/experiments/replace-experiment-protocol-returns-ok-response.json @@ -0,0 +1,73 @@ +{ + "api": "Experiments", + "expected_status": 200, + "feature": "Experiments", + "id": "v2/Experiments/Replace experiment protocol returns \"OK\" response", + "operation_id": "ReplaceExperimentProtocol", + "request": { + "body": { + "schema": { + "format": null, + "ref": "ExperimentsReplaceExperimentProtocolRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "default_duration_days": 14, + "is_duration_required_to_start": false, + "is_equal_split_enforced": false, + "is_metric_limit_enabled": false, + "is_minimum_duration_enabled": false, + "metric_groups": [], + "subject_type_id": "{{ experiment_subject_type.data.id }}" + }, + "id": "{{ published_protocol.data.id }}", + "type": "protocols" + } + } + }, + "content_type": "application/json", + "method": "PUT", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "protocol_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "published_protocol.data.id", + "type": "fixture" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "expected_updated_at", + "required": false, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "published_protocol.data.attributes.updated_at", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/experiments/protocols/{protocol_id}" + }, + "scenario": "Replace experiment protocol returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/experiments/update-experiment-protocol-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/experiments/update-experiment-protocol-returns-ok-response.json new file mode 100644 index 00000000000..4fff30d78ca --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/experiments/update-experiment-protocol-returns-ok-response.json @@ -0,0 +1,51 @@ +{ + "api": "Experiments", + "expected_status": 200, + "feature": "Experiments", + "id": "v2/Experiments/Update experiment protocol returns \"OK\" response", + "operation_id": "PatchExperimentProtocol", + "request": { + "body": { + "schema": { + "format": null, + "ref": "ExperimentsPatchExperimentProtocolRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "description": "Updated protocol description." + }, + "id": "{{ experiment_protocol.data.id }}", + "type": "protocols" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "protocol_id", + "required": true, + "schema": { + "format": "uuid", + "ref": null, + "type": "string" + }, + "source": { + "path": "experiment_protocol.data.id", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/experiments/protocols/{protocol_id}" + }, + "scenario": "Update experiment protocol returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-server-data/v2/experiments.json b/src/test/resources/generated-test/test-server-data/v2/experiments.json index a2b212b9ccc..f3f77b5130b 100644 --- a/src/test/resources/generated-test/test-server-data/v2/experiments.json +++ b/src/test/resources/generated-test/test-server-data/v2/experiments.json @@ -1,6 +1,116 @@ { "feature": "Experiments", "recordings": [ + { + "feature": "Experiments", + "frozen_at": "2026-10-13T23:54:48.799Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "ex-protocol-65a8ff450f8f1534" + }, + "type": "protocols" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/experiments/protocols", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06acec4c-a1dd-7000-b972-8e4c9e0aea3e\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:50.477680057Z\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-65a8ff450f8f1534\",\"status\":\"DRAFT\",\"subject_type\":{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"name\":\"User\"},\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:50.477680057Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "POST", + "path": "/api/v2/experiments/protocols/06acec4c-a1dd-7000-b972-8e4c9e0aea3e/archive", + "query": [ + [ + "expected_updated_at", + "2026-10-13T23:54:50.477680057Z" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06acec4c-a1dd-7000-b972-8e4c9e0aea3e\",\"type\":\"protocols\",\"attributes\":{\"archived_at\":\"2026-10-13T23:54:50.552093069Z\",\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:50.47768Z\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-65a8ff450f8f1534\",\"status\":\"ARCHIVED\",\"subject_type\":{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"name\":\"User\"},\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:50.552093069Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/protocols/06acec4c-a1dd-7000-b972-8e4c9e0aea3e", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/protocols/06acec4c-a1dd-7000-b972-8e4c9e0aea3e", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"protocol 06acec4c-a1dd-7000-b972-8e4c9e0aea3e: record not found\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Not Found", + "status": 404 + } + } + ], + "scenario": "Archive experiment protocol returns \"OK\" response", + "version": "v2" + }, { "feature": "Experiments", "frozen_at": "2026-09-29T01:19:00.715Z", @@ -511,6 +621,66 @@ "scenario": "Create experiment metric group returns \"Created\" response", "version": "v2" }, + { + "feature": "Experiments", + "frozen_at": "2026-10-13T23:54:50.739Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Protocol created by the API test.", + "name": "ex-protocol-4a78507518e21f86" + }, + "type": "protocols" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/experiments/protocols", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06acec4c-a309-7000-909e-547fc28207b4\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:50.777066926Z\",\"description\":\"Protocol created by the API test.\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-4a78507518e21f86\",\"status\":\"DRAFT\",\"subject_type\":{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"name\":\"User\"},\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:50.777066926Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/protocols/06acec4c-a309-7000-909e-547fc28207b4", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Create experiment protocol returns \"Created\" response", + "version": "v2" + }, { "feature": "Experiments", "frozen_at": "2026-09-29T01:19:07.122Z", @@ -964,6 +1134,93 @@ "scenario": "Delete experiment metric group returns \"No Content\" response", "version": "v2" }, + { + "feature": "Experiments", + "frozen_at": "2026-10-13T23:54:50.888Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "ex-protocol-abb1e54410b46a25" + }, + "type": "protocols" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/experiments/protocols", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06acec4c-a39d-7000-9027-643278324415\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:50.925536724Z\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-abb1e54410b46a25\",\"status\":\"DRAFT\",\"subject_type\":{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"name\":\"User\"},\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:50.925536724Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/protocols/06acec4c-a39d-7000-9027-643278324415", + "query": [ + [ + "expected_updated_at", + "2026-10-13T23:54:50.925536724Z" + ] + ] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/protocols/06acec4c-a39d-7000-9027-643278324415", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"protocol 06acec4c-a39d-7000-9027-643278324415: record not found\"}]}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Not Found", + "status": 404 + } + } + ], + "scenario": "Delete experiment protocol returns \"No Content\" response", + "version": "v2" + }, { "feature": "Experiments", "frozen_at": "2026-09-29T01:19:11.599Z", @@ -1472,7 +1729,7 @@ }, { "feature": "Experiments", - "frozen_at": "2026-09-29T01:19:16.633Z", + "frozen_at": "2026-10-13T23:54:51.077Z", "interactions": [ { "request": { @@ -1481,21 +1738,21 @@ "value": { "data": { "attributes": { - "name": "ex-ec2a6b7a57a4440f" + "name": "ex-protocol-9f133bc213cd3e6b" }, - "type": "experiments" + "type": "protocols" } } }, "content_type": "application/json", "method": "POST", - "path": "/api/v2/experiments", + "path": "/api/v2/experiments/protocols", "query": [] }, "response": { "body": { "encoding": "text", - "value": "{\"data\":{\"id\":\"06abb121-4341-7000-b43a-a5e72f70cf85\",\"type\":\"experiments\",\"attributes\":{\"assignments_end_date\":null,\"assignments_start_date\":null,\"concluded_at\":null,\"created_at\":\"2026-09-29T01:19:16.833715Z\",\"events_end_date\":null,\"events_start_date\":null,\"experiment_type\":\"STANDARD\",\"name\":\"ex-ec2a6b7a57a4440f\",\"pipeline_table_suffix\":\"unhsqj\",\"related_links\":[],\"results_last_updated\":null,\"split_by_properties\":[],\"status\":\"DRAFT\",\"structured_metadata\":[],\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"tags\":[],\"teams\":[],\"updated_at\":\"2026-09-29T01:19:16.855173Z\"}}}" + "value": "{\"data\":{\"id\":\"06acec4c-b082-7000-b10a-f9517ddc0a59\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:51.130120274Z\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-9f133bc213cd3e6b\",\"status\":\"DRAFT\",\"subject_type\":{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"name\":\"User\"},\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:51.130120274Z\"}}}" }, "headers": { "content-type": "application/vnd.api+json" @@ -1512,13 +1769,13 @@ }, "content_type": "", "method": "GET", - "path": "/api/v2/experiments/06abb121-4341-7000-b43a-a5e72f70cf85", + "path": "/api/v2/experiments/protocols/06acec4c-b082-7000-b10a-f9517ddc0a59", "query": [] }, "response": { "body": { "encoding": "text", - "value": "{\"data\":{\"id\":\"06abb121-4341-7000-b43a-a5e72f70cf85\",\"type\":\"experiments\",\"attributes\":{\"assignments_end_date\":null,\"assignments_start_date\":null,\"concluded_at\":null,\"created_at\":\"2026-09-29T01:19:16.833715Z\",\"events_end_date\":null,\"events_start_date\":null,\"experiment_type\":\"STANDARD\",\"name\":\"ex-ec2a6b7a57a4440f\",\"pipeline_table_suffix\":\"unhsqj\",\"related_links\":[],\"results_last_updated\":null,\"split_by_properties\":[],\"status\":\"DRAFT\",\"structured_metadata\":[],\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"tags\":[],\"teams\":[],\"updated_at\":\"2026-09-29T01:19:16.855173Z\"}}}" + "value": "{\"data\":{\"id\":\"06acec4c-b082-7000-b10a-f9517ddc0a59\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:51.13012Z\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-9f133bc213cd3e6b\",\"status\":\"DRAFT\",\"subject_type\":{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"name\":\"User\"},\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:51.13012Z\"}}}" }, "headers": { "content-type": "application/vnd.api+json" @@ -1535,7 +1792,7 @@ }, "content_type": "", "method": "DELETE", - "path": "/api/v2/experiments/06abb121-4341-7000-b43a-a5e72f70cf85", + "path": "/api/v2/experiments/protocols/06acec4c-b082-7000-b10a-f9517ddc0a59", "query": [] }, "response": { @@ -1549,12 +1806,12 @@ } } ], - "scenario": "Get experiment returns \"OK\" response", + "scenario": "Get experiment protocol returns \"OK\" response", "version": "v2" }, { "feature": "Experiments", - "frozen_at": "2026-09-29T01:19:17.546Z", + "frozen_at": "2026-09-29T01:19:16.633Z", "interactions": [ { "request": { @@ -1563,7 +1820,7 @@ "value": { "data": { "attributes": { - "name": "ex-6cf2909008f67a4b" + "name": "ex-ec2a6b7a57a4440f" }, "type": "experiments" } @@ -1577,7 +1834,7 @@ "response": { "body": { "encoding": "text", - "value": "{\"data\":{\"id\":\"06abb121-52ed-7000-8350-8706d0cfd2d3\",\"type\":\"experiments\",\"attributes\":{\"assignments_end_date\":null,\"assignments_start_date\":null,\"concluded_at\":null,\"created_at\":\"2026-09-29T01:19:17.749747Z\",\"events_end_date\":null,\"events_start_date\":null,\"experiment_type\":\"STANDARD\",\"name\":\"ex-6cf2909008f67a4b\",\"pipeline_table_suffix\":\"52wd1g\",\"related_links\":[],\"results_last_updated\":null,\"split_by_properties\":[],\"status\":\"DRAFT\",\"structured_metadata\":[],\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"tags\":[],\"teams\":[],\"updated_at\":\"2026-09-29T01:19:17.762752Z\"}}}" + "value": "{\"data\":{\"id\":\"06abb121-4341-7000-b43a-a5e72f70cf85\",\"type\":\"experiments\",\"attributes\":{\"assignments_end_date\":null,\"assignments_start_date\":null,\"concluded_at\":null,\"created_at\":\"2026-09-29T01:19:16.833715Z\",\"events_end_date\":null,\"events_start_date\":null,\"experiment_type\":\"STANDARD\",\"name\":\"ex-ec2a6b7a57a4440f\",\"pipeline_table_suffix\":\"unhsqj\",\"related_links\":[],\"results_last_updated\":null,\"split_by_properties\":[],\"status\":\"DRAFT\",\"structured_metadata\":[],\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"tags\":[],\"teams\":[],\"updated_at\":\"2026-09-29T01:19:16.855173Z\"}}}" }, "headers": { "content-type": "application/vnd.api+json" @@ -1594,13 +1851,13 @@ }, "content_type": "", "method": "GET", - "path": "/api/v2/experiments/06abb121-52ed-7000-8350-8706d0cfd2d3/traffic-summary", + "path": "/api/v2/experiments/06abb121-4341-7000-b43a-a5e72f70cf85", "query": [] }, "response": { "body": { "encoding": "text", - "value": "{\"data\":{\"id\":\"06abb121-52ed-7000-8350-8706d0cfd2d3\",\"type\":\"traffic-summary\",\"attributes\":{\"is_traffic_imbalanced\":false,\"total_subjects\":0,\"variants\":[]}}}" + "value": "{\"data\":{\"id\":\"06abb121-4341-7000-b43a-a5e72f70cf85\",\"type\":\"experiments\",\"attributes\":{\"assignments_end_date\":null,\"assignments_start_date\":null,\"concluded_at\":null,\"created_at\":\"2026-09-29T01:19:16.833715Z\",\"events_end_date\":null,\"events_start_date\":null,\"experiment_type\":\"STANDARD\",\"name\":\"ex-ec2a6b7a57a4440f\",\"pipeline_table_suffix\":\"unhsqj\",\"related_links\":[],\"results_last_updated\":null,\"split_by_properties\":[],\"status\":\"DRAFT\",\"structured_metadata\":[],\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"tags\":[],\"teams\":[],\"updated_at\":\"2026-09-29T01:19:16.855173Z\"}}}" }, "headers": { "content-type": "application/vnd.api+json" @@ -1617,7 +1874,7 @@ }, "content_type": "", "method": "DELETE", - "path": "/api/v2/experiments/06abb121-52ed-7000-8350-8706d0cfd2d3", + "path": "/api/v2/experiments/06abb121-4341-7000-b43a-a5e72f70cf85", "query": [] }, "response": { @@ -1631,12 +1888,12 @@ } } ], - "scenario": "Get experiment traffic summary returns \"OK\" response", + "scenario": "Get experiment returns \"OK\" response", "version": "v2" }, { "feature": "Experiments", - "frozen_at": "2026-09-29T01:19:18.383Z", + "frozen_at": "2026-09-29T01:19:17.546Z", "interactions": [ { "request": { @@ -1645,21 +1902,21 @@ "value": { "data": { "attributes": { - "name": "ex-8ca42a5ab91829fb" + "name": "ex-6cf2909008f67a4b" }, - "type": "metric-collections" + "type": "experiments" } } }, "content_type": "application/json", "method": "POST", - "path": "/api/v2/experiments/metric-collections", + "path": "/api/v2/experiments", "query": [] }, "response": { "body": { "encoding": "text", - "value": "{\"data\":{\"id\":\"06abb121-623e-7000-a5e3-334f00838b73\",\"type\":\"metric-collections\",\"attributes\":{\"created_at\":\"2026-09-29T01:19:18.574368381Z\",\"description\":null,\"is_guardrail\":false,\"metrics\":[],\"name\":\"ex-8ca42a5ab91829fb\",\"updated_at\":\"2026-09-29T01:19:18.574368381Z\"}}}" + "value": "{\"data\":{\"id\":\"06abb121-52ed-7000-8350-8706d0cfd2d3\",\"type\":\"experiments\",\"attributes\":{\"assignments_end_date\":null,\"assignments_start_date\":null,\"concluded_at\":null,\"created_at\":\"2026-09-29T01:19:17.749747Z\",\"events_end_date\":null,\"events_start_date\":null,\"experiment_type\":\"STANDARD\",\"name\":\"ex-6cf2909008f67a4b\",\"pipeline_table_suffix\":\"52wd1g\",\"related_links\":[],\"results_last_updated\":null,\"split_by_properties\":[],\"status\":\"DRAFT\",\"structured_metadata\":[],\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"tags\":[],\"teams\":[],\"updated_at\":\"2026-09-29T01:19:17.762752Z\"}}}" }, "headers": { "content-type": "application/vnd.api+json" @@ -1676,7 +1933,89 @@ }, "content_type": "", "method": "GET", - "path": "/api/v2/experiments/metric-collections/06abb121-623e-7000-a5e3-334f00838b73", + "path": "/api/v2/experiments/06abb121-52ed-7000-8350-8706d0cfd2d3/traffic-summary", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06abb121-52ed-7000-8350-8706d0cfd2d3\",\"type\":\"traffic-summary\",\"attributes\":{\"is_traffic_imbalanced\":false,\"total_subjects\":0,\"variants\":[]}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/06abb121-52ed-7000-8350-8706d0cfd2d3", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Get experiment traffic summary returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Experiments", + "frozen_at": "2026-09-29T01:19:18.383Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "ex-8ca42a5ab91829fb" + }, + "type": "metric-collections" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/experiments/metric-collections", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06abb121-623e-7000-a5e3-334f00838b73\",\"type\":\"metric-collections\",\"attributes\":{\"created_at\":\"2026-09-29T01:19:18.574368381Z\",\"description\":null,\"is_guardrail\":false,\"metrics\":[],\"name\":\"ex-8ca42a5ab91829fb\",\"updated_at\":\"2026-09-29T01:19:18.574368381Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/experiments/metric-collections/06abb121-623e-7000-a5e3-334f00838b73", "query": [] }, "response": { @@ -1980,8 +2319,38 @@ }, { "feature": "Experiments", - "frozen_at": "2026-09-29T01:19:21.616Z", + "frozen_at": "2026-10-13T23:54:51.283Z", "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "ex-protocol-cbdb0f80c3ab204c" + }, + "type": "protocols" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/experiments/protocols", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06acec4c-b148-7000-a255-e02850dcf331\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:51.328046316Z\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-cbdb0f80c3ab204c\",\"status\":\"DRAFT\",\"subject_type\":{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"name\":\"User\"},\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:51.328046316Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, { "request": { "body": { @@ -1991,12 +2360,21 @@ "content_type": "", "method": "GET", "path": "/api/v2/experiments/protocols", - "query": [] + "query": [ + [ + "filter[query]", + "ex-protocol-cbdb0f80c3ab204c" + ], + [ + "filter[status]", + "DRAFT" + ] + ] }, "response": { "body": { "encoding": "text", - "value": "{\"data\":[],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":25,\"total\":0,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/experiments/protocols\",\"first\":\"https://api.datadoghq.com/api/v2/experiments/protocols?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\",\"last\":\"https://api.datadoghq.com/api/v2/experiments/protocols?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\"}}" + "value": "{\"data\":[{\"id\":\"06acec4c-b148-7000-a255-e02850dcf331\",\"type\":\"protocols\",\"attributes\":{\"experiment_count\":0,\"name\":\"ex-protocol-cbdb0f80c3ab204c\",\"status\":\"DRAFT\",\"subject_type\":{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"name\":\"User\"},\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"updated_at\":\"2026-10-13T23:54:51.328046Z\"}}],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":25,\"total\":1,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/experiments/protocols?filter%5Bquery%5D=ex-protocol-cbdb0f80c3ab204c\\u0026filter%5Bstatus%5D=DRAFT\",\"first\":\"https://api.datadoghq.com/api/v2/experiments/protocols?filter%5Bquery%5D=ex-protocol-cbdb0f80c3ab204c\\u0026filter%5Bstatus%5D=DRAFT\\u0026page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\",\"last\":\"https://api.datadoghq.com/api/v2/experiments/protocols?filter%5Bquery%5D=ex-protocol-cbdb0f80c3ab204c\\u0026filter%5Bstatus%5D=DRAFT\\u0026page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\"}}" }, "headers": { "content-type": "application/vnd.api+json" @@ -2004,6 +2382,27 @@ "reason": "OK", "status": 200 } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/protocols/06acec4c-b148-7000-a255-e02850dcf331", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } } ], "scenario": "List experiment protocols returns \"OK\" response", @@ -2082,30 +2481,444 @@ "value": null }, "content_type": "", - "method": "GET", - "path": "/api/v2/experiments/metric-sql-models", + "method": "GET", + "path": "/api/v2/experiments/metric-sql-models", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":25,\"total\":0,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/experiments/metric-sql-models\",\"first\":\"https://api.datadoghq.com/api/v2/experiments/metric-sql-models?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\",\"last\":\"https://api.datadoghq.com/api/v2/experiments/metric-sql-models?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "List metric SQL models returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Experiments", + "frozen_at": "2026-09-29T01:19:22.605Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/experiments/metric-collections", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":25,\"total\":0,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/experiments/metric-collections\",\"first\":\"https://api.datadoghq.com/api/v2/experiments/metric-collections?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\",\"last\":\"https://api.datadoghq.com/api/v2/experiments/metric-collections?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "List metric collections returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Experiments", + "frozen_at": "2026-09-29T01:19:22.848Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/experiments/metrics", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"06abb0e9-d22b-7000-b02f-69a3d1ab87eb\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-09-29T01:04:29.555171Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_INCREASES\",\"format_as_percent\":false,\"metric_type\":\"SIMPLE\",\"name\":\"Test-Update_metric_returns_OK_response-1790643869 updated\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Test-Update_metric_returns_OK_response-1790643869 view duration\",\"source_type\":\"PRODUCT_ANALYTICS\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.time_spent\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-09-29T01:04:29.853841Z\"}},{\"id\":\"06abb0e9-c37d-7000-804d-b45001575ff0\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-09-29T01:04:28.893484Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_INCREASES\",\"format_as_percent\":false,\"metric_type\":\"SIMPLE\",\"name\":\"Test-Update_experiment_metric_group_returns_OK_response-1790643868\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Test-Update_experiment_metric_group_returns_OK_response-1790643868 view duration\",\"source_type\":\"PRODUCT_ANALYTICS\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.time_spent\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-09-29T01:04:28.893484Z\"}},{\"id\":\"06abb0e8-832a-7000-9d06-d73a48411716\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-09-29T01:04:08.810752Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_INCREASES\",\"format_as_percent\":false,\"metric_type\":\"SIMPLE\",\"name\":\"Test-Delete_experiment_metric_group_returns_No_Content_response-1790643848\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Test-Delete_experiment_metric_group_returns_No_Content_response-1790643848 view duration\",\"source_type\":\"PRODUCT_ANALYTICS\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.time_spent\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-09-29T01:04:08.810752Z\"}},{\"id\":\"06abb0e8-605c-7000-a21f-d4b76a065f9a\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-09-29T01:04:06.092262Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_INCREASES\",\"format_as_percent\":false,\"metric_type\":\"SIMPLE\",\"name\":\"Test-Create_experiment_metric_group_returns_Created_response-1790643845\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Test-Create_experiment_metric_group_returns_Created_response-1790643845 view duration\",\"source_type\":\"PRODUCT_ANALYTICS\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.time_spent\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-09-29T01:04:06.092262Z\"}},{\"id\":\"06abb0e8-51c1-7000-9774-4a19a1f558c7\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-09-29T01:04:05.449444Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_INCREASES\",\"format_as_percent\":false,\"metric_type\":\"SIMPLE\",\"name\":\"Test-Create_experiment_metric_group_from_collection_returns_Created_response-1790643845\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Test-Create_experiment_metric_group_from_collection_returns_Created_response-1790643845 view duration\",\"source_type\":\"PRODUCT_ANALYTICS\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.time_spent\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-09-29T01:04:05.449444Z\"}},{\"id\":\"069b1f0d-d378-7000-b8e4-016dced67fe0\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-03-11T22:46:53.888417Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_DECREASES\",\"format_as_percent\":false,\"guardrail_cutoff_threshold\":0.05,\"metric_type\":\"SIMPLE\",\"name\":\"[RUM] Long task count\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Sum of @view.long_task.count\",\"source_type\":\"RUM\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.long_task.count\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-03-11T22:46:53.888417Z\"}},{\"id\":\"069b1f0d-d356-7000-8cd8-e7e497295920\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-03-11T22:46:53.85493Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_DECREASES\",\"format_as_percent\":false,\"guardrail_cutoff_threshold\":0.05,\"metric_type\":\"SIMPLE\",\"name\":\"[RUM] Error count\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Sum of @view.error.count\",\"source_type\":\"RUM\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.error.count\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-03-11T22:46:53.85493Z\"}}],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":25,\"total\":7,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/experiments/metrics\",\"first\":\"https://api.datadoghq.com/api/v2/experiments/metrics?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\",\"last\":\"https://api.datadoghq.com/api/v2/experiments/metrics?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "List metrics returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Experiments", + "frozen_at": "2026-09-29T01:19:23.117Z", + "interactions": [ + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "GET", + "path": "/api/v2/experiments/subject-types", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":[{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"type\":\"subject-types\",\"attributes\":{\"created_at\":\"2026-09-29T01:04:03.946949Z\",\"is_default\":true,\"name\":\"User\",\"product_analytics_attribute\":\"@usr.id\",\"updated_at\":\"2026-09-29T01:04:03.946949Z\"}}],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":25,\"total\":1,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/experiments/subject-types\",\"first\":\"https://api.datadoghq.com/api/v2/experiments/subject-types?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\",\"last\":\"https://api.datadoghq.com/api/v2/experiments/subject-types?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\"}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "List subject types returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Experiments", + "frozen_at": "2026-09-29T01:19:23.376Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "ex-85284693960e2b3d" + }, + "type": "experiments" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/experiments", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06abb121-b264-7000-94e9-39634d59d788\",\"type\":\"experiments\",\"attributes\":{\"assignments_end_date\":null,\"assignments_start_date\":null,\"concluded_at\":null,\"created_at\":\"2026-09-29T01:19:23.61226Z\",\"events_end_date\":null,\"events_start_date\":null,\"experiment_type\":\"STANDARD\",\"name\":\"ex-85284693960e2b3d\",\"pipeline_table_suffix\":\"xed3pp\",\"related_links\":[],\"results_last_updated\":null,\"split_by_properties\":[],\"status\":\"DRAFT\",\"structured_metadata\":[],\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"tags\":[],\"teams\":[],\"updated_at\":\"2026-09-29T01:19:23.629214Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "ex-85284693960e2b3d updated" + }, + "type": "experiments" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/experiments/06abb121-b264-7000-94e9-39634d59d788", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06abb121-b264-7000-94e9-39634d59d788\",\"type\":\"experiments\",\"attributes\":{\"assignments_end_date\":null,\"assignments_start_date\":null,\"concluded_at\":null,\"created_at\":\"2026-09-29T01:19:23.61226Z\",\"events_end_date\":null,\"events_start_date\":null,\"experiment_type\":\"STANDARD\",\"name\":\"ex-85284693960e2b3d updated\",\"pipeline_table_suffix\":\"xed3pp\",\"related_links\":[],\"results_last_updated\":null,\"split_by_properties\":[],\"status\":\"DRAFT\",\"structured_metadata\":[],\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"tags\":[],\"teams\":[],\"updated_at\":\"2026-09-29T01:19:23.93135Z\"}},\"meta\":{\"needs_pipeline_refresh\":false}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/06abb121-b264-7000-94e9-39634d59d788", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Patch experiment returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Experiments", + "frozen_at": "2026-09-29T01:19:24.292Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "ex-ca7000beab9c3edd", + "product_analytics_attribute": "@account.id", + "warehouse_column_names": [ + "account_id" + ] + }, + "type": "subject-types" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/experiments/subject-types", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06abb121-c1eb-7001-a3e5-80e15810ab1c\",\"type\":\"subject-types\",\"attributes\":{\"created_at\":\"2026-09-29T01:19:24.491584406Z\",\"is_default\":false,\"name\":\"ex-ca7000beab9c3edd\",\"product_analytics_attribute\":\"@account.id\",\"updated_at\":\"2026-09-29T01:19:24.491584406Z\",\"warehouse_column_names\":[\"account_id\"]}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "ex-ca7000beab9c3edd updated" + }, + "type": "subject-types" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/experiments/subject-types/06abb121-c1eb-7001-a3e5-80e15810ab1c", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06abb121-c1eb-7001-a3e5-80e15810ab1c\",\"type\":\"subject-types\",\"attributes\":{\"created_at\":\"2026-09-29T01:19:24.491584Z\",\"is_default\":false,\"name\":\"ex-ca7000beab9c3edd updated\",\"product_analytics_attribute\":\"@account.id\",\"updated_at\":\"2026-09-29T01:19:24.751780063Z\",\"warehouse_column_names\":[\"account_id\"]}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/subject-types/06abb121-c1eb-7001-a3e5-80e15810ab1c", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Patch subject type returns \"OK\" response", + "version": "v2" + }, + { + "feature": "Experiments", + "frozen_at": "2026-10-13T23:54:51.470Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "ex-62d0ddcfb96a2d76", + "product_analytics_attribute": "@account.id", + "warehouse_column_names": [ + "account_id" + ] + }, + "type": "subject-types" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/experiments/subject-types", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06acec4c-b203-7001-a428-414951b10bb9\",\"type\":\"subject-types\",\"attributes\":{\"created_at\":\"2026-10-13T23:54:51.515941433Z\",\"is_default\":false,\"name\":\"ex-62d0ddcfb96a2d76\",\"product_analytics_attribute\":\"@account.id\",\"updated_at\":\"2026-10-13T23:54:51.515941433Z\",\"warehouse_column_names\":[\"account_id\"]}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "ex-protocol-62d0ddcfb96a2d76" + }, + "type": "protocols" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/experiments/protocols", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06acec4c-b246-7000-a43c-af6adeeb6d3b\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:51.582261941Z\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-62d0ddcfb96a2d76\",\"status\":\"DRAFT\",\"subject_type\":{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"name\":\"User\"},\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:51.582261941Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "subject_type_id": "06acec4c-b203-7001-a428-414951b10bb9" + }, + "id": "06acec4c-b246-7000-a43c-af6adeeb6d3b", + "type": "protocols" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/experiments/protocols/06acec4c-b246-7000-a43c-af6adeeb6d3b", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06acec4c-b246-7000-a43c-af6adeeb6d3b\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:51.582261Z\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-62d0ddcfb96a2d76\",\"status\":\"DRAFT\",\"subject_type\":{\"id\":\"06acec4c-b203-7001-a428-414951b10bb9\",\"name\":\"ex-62d0ddcfb96a2d76\"},\"subject_type_id\":\"06acec4c-b203-7001-a428-414951b10bb9\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:51.655593854Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "POST", + "path": "/api/v2/experiments/protocols/06acec4c-b246-7000-a43c-af6adeeb6d3b/publish", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06acec4c-b246-7000-a43c-af6adeeb6d3b\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:51.582261Z\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-62d0ddcfb96a2d76\",\"published_at\":\"2026-10-13T23:54:51.726996749Z\",\"status\":\"PUBLISHED\",\"subject_type\":{\"id\":\"06acec4c-b203-7001-a428-414951b10bb9\",\"name\":\"ex-62d0ddcfb96a2d76\"},\"subject_type_id\":\"06acec4c-b203-7001-a428-414951b10bb9\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:51.726996749Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/protocols/06acec4c-b246-7000-a43c-af6adeeb6d3b", "query": [] }, "response": { "body": { "encoding": "text", - "value": "{\"data\":[],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":25,\"total\":0,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/experiments/metric-sql-models\",\"first\":\"https://api.datadoghq.com/api/v2/experiments/metric-sql-models?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\",\"last\":\"https://api.datadoghq.com/api/v2/experiments/metric-sql-models?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\"}}" - }, - "headers": { - "content-type": "application/vnd.api+json" + "value": "" }, - "reason": "OK", - "status": 200 + "headers": {}, + "reason": "No Content", + "status": 204 } - } - ], - "scenario": "List metric SQL models returns \"OK\" response", - "version": "v2" - }, - { - "feature": "Experiments", - "frozen_at": "2026-09-29T01:19:22.605Z", - "interactions": [ + }, { "request": { "body": { @@ -2113,30 +2926,22 @@ "value": null }, "content_type": "", - "method": "GET", - "path": "/api/v2/experiments/metric-collections", + "method": "DELETE", + "path": "/api/v2/experiments/protocols/06acec4c-b246-7000-a43c-af6adeeb6d3b", "query": [] }, "response": { "body": { "encoding": "text", - "value": "{\"data\":[],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":25,\"total\":0,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/experiments/metric-collections\",\"first\":\"https://api.datadoghq.com/api/v2/experiments/metric-collections?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\",\"last\":\"https://api.datadoghq.com/api/v2/experiments/metric-collections?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\"}}" + "value": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"protocol 06acec4c-b246-7000-a43c-af6adeeb6d3b: record not found\"}]}" }, "headers": { "content-type": "application/vnd.api+json" }, - "reason": "OK", - "status": 200 + "reason": "Not Found", + "status": 404 } - } - ], - "scenario": "List metric collections returns \"OK\" response", - "version": "v2" - }, - { - "feature": "Experiments", - "frozen_at": "2026-09-29T01:19:22.848Z", - "interactions": [ + }, { "request": { "body": { @@ -2144,61 +2949,62 @@ "value": null }, "content_type": "", - "method": "GET", - "path": "/api/v2/experiments/metrics", + "method": "DELETE", + "path": "/api/v2/experiments/subject-types/06acec4c-b203-7001-a428-414951b10bb9", "query": [] }, "response": { "body": { "encoding": "text", - "value": "{\"data\":[{\"id\":\"06abb0e9-d22b-7000-b02f-69a3d1ab87eb\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-09-29T01:04:29.555171Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_INCREASES\",\"format_as_percent\":false,\"metric_type\":\"SIMPLE\",\"name\":\"Test-Update_metric_returns_OK_response-1790643869 updated\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Test-Update_metric_returns_OK_response-1790643869 view duration\",\"source_type\":\"PRODUCT_ANALYTICS\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.time_spent\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-09-29T01:04:29.853841Z\"}},{\"id\":\"06abb0e9-c37d-7000-804d-b45001575ff0\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-09-29T01:04:28.893484Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_INCREASES\",\"format_as_percent\":false,\"metric_type\":\"SIMPLE\",\"name\":\"Test-Update_experiment_metric_group_returns_OK_response-1790643868\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Test-Update_experiment_metric_group_returns_OK_response-1790643868 view duration\",\"source_type\":\"PRODUCT_ANALYTICS\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.time_spent\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-09-29T01:04:28.893484Z\"}},{\"id\":\"06abb0e8-832a-7000-9d06-d73a48411716\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-09-29T01:04:08.810752Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_INCREASES\",\"format_as_percent\":false,\"metric_type\":\"SIMPLE\",\"name\":\"Test-Delete_experiment_metric_group_returns_No_Content_response-1790643848\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Test-Delete_experiment_metric_group_returns_No_Content_response-1790643848 view duration\",\"source_type\":\"PRODUCT_ANALYTICS\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.time_spent\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-09-29T01:04:08.810752Z\"}},{\"id\":\"06abb0e8-605c-7000-a21f-d4b76a065f9a\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-09-29T01:04:06.092262Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_INCREASES\",\"format_as_percent\":false,\"metric_type\":\"SIMPLE\",\"name\":\"Test-Create_experiment_metric_group_returns_Created_response-1790643845\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Test-Create_experiment_metric_group_returns_Created_response-1790643845 view duration\",\"source_type\":\"PRODUCT_ANALYTICS\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.time_spent\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-09-29T01:04:06.092262Z\"}},{\"id\":\"06abb0e8-51c1-7000-9774-4a19a1f558c7\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-09-29T01:04:05.449444Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_INCREASES\",\"format_as_percent\":false,\"metric_type\":\"SIMPLE\",\"name\":\"Test-Create_experiment_metric_group_from_collection_returns_Created_response-1790643845\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Test-Create_experiment_metric_group_from_collection_returns_Created_response-1790643845 view duration\",\"source_type\":\"PRODUCT_ANALYTICS\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.time_spent\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-09-29T01:04:05.449444Z\"}},{\"id\":\"069b1f0d-d378-7000-b8e4-016dced67fe0\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-03-11T22:46:53.888417Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_DECREASES\",\"format_as_percent\":false,\"guardrail_cutoff_threshold\":0.05,\"metric_type\":\"SIMPLE\",\"name\":\"[RUM] Long task count\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Sum of @view.long_task.count\",\"source_type\":\"RUM\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.long_task.count\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-03-11T22:46:53.888417Z\"}},{\"id\":\"069b1f0d-d356-7000-8cd8-e7e497295920\",\"type\":\"metrics\",\"attributes\":{\"created_at\":\"2026-03-11T22:46:53.85493Z\",\"data_source_type\":\"DATADOG\",\"description\":\"\",\"desired_change\":\"METRIC_DECREASES\",\"format_as_percent\":false,\"guardrail_cutoff_threshold\":0.05,\"metric_type\":\"SIMPLE\",\"name\":\"[RUM] Error count\",\"numerator_aggregation\":{\"operation\":\"sum\",\"timeframe_start_value\":0,\"winsorization_strategy\":\"all_assigned_subjects\",\"datadog_metric_measure\":{\"name\":\"Sum of @view.error.count\",\"source_type\":\"RUM\",\"source_subtype\":\"RUM_VIEWS\",\"column_name\":\"@view.error.count\",\"column_type\":\"double\",\"filters\":[],\"source_definition_filter\":[]}},\"reference_url\":\"\",\"updated_at\":\"2026-03-11T22:46:53.85493Z\"}}],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":25,\"total\":7,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/experiments/metrics\",\"first\":\"https://api.datadoghq.com/api/v2/experiments/metrics?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\",\"last\":\"https://api.datadoghq.com/api/v2/experiments/metrics?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\"}}" - }, - "headers": { - "content-type": "application/vnd.api+json" + "value": "" }, - "reason": "OK", - "status": 200 + "headers": {}, + "reason": "No Content", + "status": 204 } } ], - "scenario": "List metrics returns \"OK\" response", + "scenario": "Publish experiment protocol returns \"OK\" response", "version": "v2" }, { "feature": "Experiments", - "frozen_at": "2026-09-29T01:19:23.117Z", + "frozen_at": "2026-10-13T23:54:51.979Z", "interactions": [ { "request": { "body": { - "type": "empty", - "value": null + "type": "json", + "value": { + "data": { + "attributes": { + "name": "ex-fd8848916035bf3a", + "product_analytics_attribute": "@account.id", + "warehouse_column_names": [ + "account_id" + ] + }, + "type": "subject-types" + } + } }, - "content_type": "", - "method": "GET", + "content_type": "application/json", + "method": "POST", "path": "/api/v2/experiments/subject-types", "query": [] }, "response": { "body": { "encoding": "text", - "value": "{\"data\":[{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"type\":\"subject-types\",\"attributes\":{\"created_at\":\"2026-09-29T01:04:03.946949Z\",\"is_default\":true,\"name\":\"User\",\"product_analytics_attribute\":\"@usr.id\",\"updated_at\":\"2026-09-29T01:04:03.946949Z\"}}],\"meta\":{\"page\":{\"type\":\"offset_limit\",\"offset\":0,\"limit\":25,\"total\":1,\"first_offset\":0,\"prev_offset\":null,\"next_offset\":null,\"last_offset\":0}},\"links\":{\"self\":\"https://api.datadoghq.com/api/v2/experiments/subject-types\",\"first\":\"https://api.datadoghq.com/api/v2/experiments/subject-types?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\",\"last\":\"https://api.datadoghq.com/api/v2/experiments/subject-types?page%5Blimit%5D=25\\u0026page%5Boffset%5D=0\"}}" + "value": "{\"data\":{\"id\":\"06acec4c-c00f-7001-96bd-866f120464e6\",\"type\":\"subject-types\",\"attributes\":{\"created_at\":\"2026-10-13T23:54:52.015055515Z\",\"is_default\":false,\"name\":\"ex-fd8848916035bf3a\",\"product_analytics_attribute\":\"@account.id\",\"updated_at\":\"2026-10-13T23:54:52.015055515Z\",\"warehouse_column_names\":[\"account_id\"]}}}" }, "headers": { "content-type": "application/vnd.api+json" }, - "reason": "OK", - "status": 200 + "reason": "Created", + "status": 201 } - } - ], - "scenario": "List subject types returns \"OK\" response", - "version": "v2" - }, - { - "feature": "Experiments", - "frozen_at": "2026-09-29T01:19:23.376Z", - "interactions": [ + }, { "request": { "body": { @@ -2206,21 +3012,21 @@ "value": { "data": { "attributes": { - "name": "ex-85284693960e2b3d" + "name": "ex-protocol-fd8848916035bf3a" }, - "type": "experiments" + "type": "protocols" } } }, "content_type": "application/json", "method": "POST", - "path": "/api/v2/experiments", + "path": "/api/v2/experiments/protocols", "query": [] }, "response": { "body": { "encoding": "text", - "value": "{\"data\":{\"id\":\"06abb121-b264-7000-94e9-39634d59d788\",\"type\":\"experiments\",\"attributes\":{\"assignments_end_date\":null,\"assignments_start_date\":null,\"concluded_at\":null,\"created_at\":\"2026-09-29T01:19:23.61226Z\",\"events_end_date\":null,\"events_start_date\":null,\"experiment_type\":\"STANDARD\",\"name\":\"ex-85284693960e2b3d\",\"pipeline_table_suffix\":\"xed3pp\",\"related_links\":[],\"results_last_updated\":null,\"split_by_properties\":[],\"status\":\"DRAFT\",\"structured_metadata\":[],\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"tags\":[],\"teams\":[],\"updated_at\":\"2026-09-29T01:19:23.629214Z\"}}}" + "value": "{\"data\":{\"id\":\"06acec4c-c052-7000-ae27-b2c339240c8e\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:52.082221256Z\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-fd8848916035bf3a\",\"status\":\"DRAFT\",\"subject_type\":{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"name\":\"User\"},\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:52.082221256Z\"}}}" }, "headers": { "content-type": "application/vnd.api+json" @@ -2236,21 +3042,22 @@ "value": { "data": { "attributes": { - "name": "ex-85284693960e2b3d updated" + "subject_type_id": "06acec4c-c00f-7001-96bd-866f120464e6" }, - "type": "experiments" + "id": "06acec4c-c052-7000-ae27-b2c339240c8e", + "type": "protocols" } } }, "content_type": "application/json", "method": "PATCH", - "path": "/api/v2/experiments/06abb121-b264-7000-94e9-39634d59d788", + "path": "/api/v2/experiments/protocols/06acec4c-c052-7000-ae27-b2c339240c8e", "query": [] }, "response": { "body": { "encoding": "text", - "value": "{\"data\":{\"id\":\"06abb121-b264-7000-94e9-39634d59d788\",\"type\":\"experiments\",\"attributes\":{\"assignments_end_date\":null,\"assignments_start_date\":null,\"concluded_at\":null,\"created_at\":\"2026-09-29T01:19:23.61226Z\",\"events_end_date\":null,\"events_start_date\":null,\"experiment_type\":\"STANDARD\",\"name\":\"ex-85284693960e2b3d updated\",\"pipeline_table_suffix\":\"xed3pp\",\"related_links\":[],\"results_last_updated\":null,\"split_by_properties\":[],\"status\":\"DRAFT\",\"structured_metadata\":[],\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"tags\":[],\"teams\":[],\"updated_at\":\"2026-09-29T01:19:23.93135Z\"}},\"meta\":{\"needs_pipeline_refresh\":false}}" + "value": "{\"data\":{\"id\":\"06acec4c-c052-7000-ae27-b2c339240c8e\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:52.082221Z\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-fd8848916035bf3a\",\"status\":\"DRAFT\",\"subject_type\":{\"id\":\"06acec4c-c00f-7001-96bd-866f120464e6\",\"name\":\"ex-fd8848916035bf3a\"},\"subject_type_id\":\"06acec4c-c00f-7001-96bd-866f120464e6\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:52.148416189Z\"}}}" }, "headers": { "content-type": "application/vnd.api+json" @@ -2266,28 +3073,22 @@ "value": null }, "content_type": "", - "method": "DELETE", - "path": "/api/v2/experiments/06abb121-b264-7000-94e9-39634d59d788", + "method": "POST", + "path": "/api/v2/experiments/protocols/06acec4c-c052-7000-ae27-b2c339240c8e/publish", "query": [] }, "response": { "body": { "encoding": "text", - "value": "" + "value": "{\"data\":{\"id\":\"06acec4c-c052-7000-ae27-b2c339240c8e\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:52.082221Z\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-fd8848916035bf3a\",\"published_at\":\"2026-10-13T23:54:52.214666803Z\",\"status\":\"PUBLISHED\",\"subject_type\":{\"id\":\"06acec4c-c00f-7001-96bd-866f120464e6\",\"name\":\"ex-fd8848916035bf3a\"},\"subject_type_id\":\"06acec4c-c00f-7001-96bd-866f120464e6\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:52.214666803Z\"}}}" }, - "headers": {}, - "reason": "No Content", - "status": 204 + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 } - } - ], - "scenario": "Patch experiment returns \"OK\" response", - "version": "v2" - }, - { - "feature": "Experiments", - "frozen_at": "2026-09-29T01:19:24.292Z", - "interactions": [ + }, { "request": { "body": { @@ -2295,61 +3096,83 @@ "value": { "data": { "attributes": { - "name": "ex-ca7000beab9c3edd", - "product_analytics_attribute": "@account.id", - "warehouse_column_names": [ - "account_id" - ] + "default_duration_days": 14, + "is_duration_required_to_start": false, + "is_equal_split_enforced": false, + "is_metric_limit_enabled": false, + "is_minimum_duration_enabled": false, + "metric_groups": [], + "subject_type_id": "06acec4c-c00f-7001-96bd-866f120464e6" }, - "type": "subject-types" + "id": "06acec4c-c052-7000-ae27-b2c339240c8e", + "type": "protocols" } } }, "content_type": "application/json", - "method": "POST", - "path": "/api/v2/experiments/subject-types", - "query": [] + "method": "PUT", + "path": "/api/v2/experiments/protocols/06acec4c-c052-7000-ae27-b2c339240c8e", + "query": [ + [ + "expected_updated_at", + "2026-10-13T23:54:52.214666803Z" + ] + ] }, "response": { "body": { "encoding": "text", - "value": "{\"data\":{\"id\":\"06abb121-c1eb-7001-a3e5-80e15810ab1c\",\"type\":\"subject-types\",\"attributes\":{\"created_at\":\"2026-09-29T01:19:24.491584406Z\",\"is_default\":false,\"name\":\"ex-ca7000beab9c3edd\",\"product_analytics_attribute\":\"@account.id\",\"updated_at\":\"2026-09-29T01:19:24.491584406Z\",\"warehouse_column_names\":[\"account_id\"]}}}" + "value": "{\"data\":{\"id\":\"06acec4c-c052-7000-ae27-b2c339240c8e\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:52.082221Z\",\"default_duration_days\":14,\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-fd8848916035bf3a\",\"published_at\":\"2026-10-13T23:54:52.214666Z\",\"status\":\"PUBLISHED\",\"subject_type\":{\"id\":\"06acec4c-c00f-7001-96bd-866f120464e6\",\"name\":\"ex-fd8848916035bf3a\"},\"subject_type_id\":\"06acec4c-c00f-7001-96bd-866f120464e6\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:52.281154081Z\"}}}" }, "headers": { "content-type": "application/vnd.api+json" }, - "reason": "Created", - "status": 201 + "reason": "OK", + "status": 200 } }, { "request": { "body": { - "type": "json", - "value": { - "data": { - "attributes": { - "name": "ex-ca7000beab9c3edd updated" - }, - "type": "subject-types" - } - } + "type": "empty", + "value": null }, - "content_type": "application/json", - "method": "PATCH", - "path": "/api/v2/experiments/subject-types/06abb121-c1eb-7001-a3e5-80e15810ab1c", + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/protocols/06acec4c-c052-7000-ae27-b2c339240c8e", "query": [] }, "response": { "body": { "encoding": "text", - "value": "{\"data\":{\"id\":\"06abb121-c1eb-7001-a3e5-80e15810ab1c\",\"type\":\"subject-types\",\"attributes\":{\"created_at\":\"2026-09-29T01:19:24.491584Z\",\"is_default\":false,\"name\":\"ex-ca7000beab9c3edd updated\",\"product_analytics_attribute\":\"@account.id\",\"updated_at\":\"2026-09-29T01:19:24.751780063Z\",\"warehouse_column_names\":[\"account_id\"]}}}" + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/protocols/06acec4c-c052-7000-ae27-b2c339240c8e", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"protocol 06acec4c-c052-7000-ae27-b2c339240c8e: record not found\"}]}" }, "headers": { "content-type": "application/vnd.api+json" }, - "reason": "OK", - "status": 200 + "reason": "Not Found", + "status": 404 } }, { @@ -2360,7 +3183,7 @@ }, "content_type": "", "method": "DELETE", - "path": "/api/v2/experiments/subject-types/06abb121-c1eb-7001-a3e5-80e15810ab1c", + "path": "/api/v2/experiments/subject-types/06acec4c-c00f-7001-96bd-866f120464e6", "query": [] }, "response": { @@ -2374,7 +3197,7 @@ } } ], - "scenario": "Patch subject type returns \"OK\" response", + "scenario": "Replace experiment protocol returns \"OK\" response", "version": "v2" }, { @@ -3066,6 +3889,96 @@ "scenario": "Update experiment metric group returns \"OK\" response", "version": "v2" }, + { + "feature": "Experiments", + "frozen_at": "2026-10-13T23:54:52.508Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "name": "ex-protocol-68e0a228123b5f3a" + }, + "type": "protocols" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/experiments/protocols", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06acec4c-c226-7000-8670-0a9772b917a6\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:52.549995623Z\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-68e0a228123b5f3a\",\"status\":\"DRAFT\",\"subject_type\":{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"name\":\"User\"},\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:52.549995623Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "Created", + "status": 201 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "description": "Updated protocol description." + }, + "id": "06acec4c-c226-7000-8670-0a9772b917a6", + "type": "protocols" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/experiments/protocols/06acec4c-c226-7000-8670-0a9772b917a6", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"id\":\"06acec4c-c226-7000-8670-0a9772b917a6\",\"type\":\"protocols\",\"attributes\":{\"assignment_source_default_properties\":[],\"created_at\":\"2026-10-13T23:54:52.549995Z\",\"description\":\"Updated protocol description.\",\"enforcement\":{\"subject_type\":\"LOCKED\",\"flag_source\":\"LOCKED\",\"primary_metric\":\"EDITABLE\",\"secondary_metrics\":\"EDITABLE\",\"environment\":\"EDITABLE\",\"targeting_rules\":\"EDITABLE\",\"warehouse_exposure_source\":\"EDITABLE\",\"traffic_exposure\":\"EDITABLE\",\"default_duration\":\"EDITABLE\",\"confidence_interval_method\":\"LOCKED\",\"confidence_level\":\"EDITABLE\",\"cuped_calculation\":\"EDITABLE\",\"multiple_testing_correction\":\"EDITABLE\",\"split_by_exploration_dimensions\":\"EDITABLE\",\"notifications\":\"EDITABLE\"},\"experiment_count\":0,\"is_duration_required_to_start\":false,\"is_equal_split_enforced\":false,\"is_metric_limit_enabled\":false,\"is_minimum_duration_enabled\":false,\"metric_groups\":[],\"name\":\"ex-protocol-68e0a228123b5f3a\",\"status\":\"DRAFT\",\"subject_type\":{\"id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"name\":\"User\"},\"subject_type_id\":\"06abb0e8-33b2-7001-ad2f-70568bfbf6e9\",\"targeting_rules\":[],\"updated_at\":\"2026-10-13T23:54:52.61837237Z\"}}}" + }, + "headers": { + "content-type": "application/vnd.api+json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/experiments/protocols/06acec4c-c226-7000-8670-0a9772b917a6", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": {}, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Update experiment protocol returns \"OK\" response", + "version": "v2" + }, { "feature": "Experiments", "frozen_at": "2026-09-29T01:19:38.737Z",