import * as Schema from "effect/Schema";
import { API } from "../../client.js";
import * as T from "../../traits.js";
import { BadRequest, Forbidden, NotFound } from "../../errors.js";
// Input Schema
export const FeatureFlagsPartialUpdateInput = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number.pipe(T.PathParam()),
    project_id: Schema.String.pipe(T.PathParam()),
    key: Schema.optional(Schema.String),
    name: Schema.optional(Schema.String),
    filters: Schema.optional(Schema.Struct({
        groups: Schema.optional(Schema.Array(Schema.Struct({
            properties: Schema.optional(Schema.Array(Schema.Unknown)),
            rollout_percentage: Schema.optional(Schema.Number),
            variant: Schema.optional(Schema.NullOr(Schema.String)),
            aggregation_group_type_index: Schema.optional(Schema.NullOr(Schema.Number)),
        }))),
        multivariate: Schema.optional(Schema.NullOr(Schema.Struct({
            variants: Schema.optional(Schema.Array(Schema.Struct({
                key: Schema.optional(Schema.String),
                name: Schema.optional(Schema.String),
                rollout_percentage: Schema.optional(Schema.Number),
            }))),
        }))),
        aggregation_group_type_index: Schema.optional(Schema.NullOr(Schema.Number)),
        payloads: Schema.optional(Schema.Record(Schema.String, Schema.String)),
        super_groups: Schema.optional(Schema.Array(Schema.Record(Schema.String, Schema.Unknown))),
        feature_enrollment: Schema.optional(Schema.NullOr(Schema.Boolean)),
    })),
    active: Schema.optional(Schema.Boolean),
    tags: Schema.optional(Schema.Array(Schema.String)),
    evaluation_contexts: Schema.optional(Schema.Array(Schema.String)),
}).pipe(T.Http({
    method: "PATCH",
    path: "/api/projects/{project_id}/feature_flags/{id}/",
}));
// Output Schema
export const FeatureFlagsPartialUpdateOutput = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Number),
    name: Schema.optional(Schema.String),
    key: Schema.optional(Schema.String),
    filters: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
    deleted: Schema.optional(Schema.Boolean),
    active: Schema.optional(Schema.Boolean),
    created_by: Schema.optional(Schema.NullOr(Schema.Struct({
        id: Schema.optional(Schema.Number),
        uuid: Schema.optional(Schema.String),
        distinct_id: Schema.optional(Schema.NullOr(Schema.String)),
        first_name: Schema.optional(Schema.String),
        last_name: Schema.optional(Schema.String),
        email: Schema.optional(Schema.String),
        is_email_verified: Schema.optional(Schema.NullOr(Schema.Boolean)),
        hedgehog_config: Schema.optional(Schema.NullOr(Schema.Record(Schema.String, Schema.Unknown))),
        role_at_organization: Schema.optional(Schema.Unknown),
    }))),
    created_at: Schema.optional(Schema.String),
    updated_at: Schema.optional(Schema.NullOr(Schema.String)),
    version: Schema.optional(Schema.Number),
    last_modified_by: Schema.optional(Schema.NullOr(Schema.Struct({
        id: Schema.optional(Schema.Number),
        uuid: Schema.optional(Schema.String),
        distinct_id: Schema.optional(Schema.NullOr(Schema.String)),
        first_name: Schema.optional(Schema.String),
        last_name: Schema.optional(Schema.String),
        email: Schema.optional(Schema.String),
        is_email_verified: Schema.optional(Schema.NullOr(Schema.Boolean)),
        hedgehog_config: Schema.optional(Schema.NullOr(Schema.Record(Schema.String, Schema.Unknown))),
        role_at_organization: Schema.optional(Schema.Unknown),
    }))),
    ensure_experience_continuity: Schema.optional(Schema.NullOr(Schema.Boolean)),
    experiment_set: Schema.optional(Schema.Array(Schema.Number)),
    experiment_set_metadata: Schema.optional(Schema.Array(Schema.Record(Schema.String, Schema.Unknown))),
    surveys: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
    features: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
    rollback_conditions: Schema.optional(Schema.NullOr(Schema.Unknown)),
    performed_rollback: Schema.optional(Schema.NullOr(Schema.Boolean)),
    can_edit: Schema.optional(Schema.Boolean),
    tags: Schema.optional(Schema.Array(Schema.Unknown)),
    evaluation_contexts: Schema.optional(Schema.Array(Schema.Unknown)),
    usage_dashboard: Schema.optional(Schema.Number),
    analytics_dashboards: Schema.optional(Schema.Array(Schema.Number)),
    has_enriched_analytics: Schema.optional(Schema.NullOr(Schema.Boolean)),
    user_access_level: Schema.optional(Schema.NullOr(Schema.String)),
    creation_context: Schema.optional(Schema.Literals([
        "feature_flags",
        "experiments",
        "surveys",
        "early_access_features",
        "web_experiments",
        "product_tours",
    ])),
    is_remote_configuration: Schema.optional(Schema.NullOr(Schema.Boolean)),
    has_encrypted_payloads: Schema.optional(Schema.NullOr(Schema.Boolean)),
    status: Schema.optional(Schema.String),
    evaluation_runtime: Schema.optional(Schema.Unknown),
    bucketing_identifier: Schema.optional(Schema.Unknown),
    last_called_at: Schema.optional(Schema.NullOr(Schema.String)),
    _create_in_folder: Schema.optional(Schema.String),
    _should_create_usage_dashboard: Schema.optional(Schema.Boolean),
    is_used_in_replay_settings: Schema.optional(Schema.Boolean),
});
// The operation
/**
 * Create, read, update and delete feature flags. [See docs](https://posthog.com/docs/feature-flags) for more information on feature flags.
 * If you're looking to use feature flags on your application, you can either use our JavaScript Library or our dedicated endpoint to check if feature flags are enabled for a given user.
 *
 * @param id - A unique integer value identifying this feature flag.
 * @param project_id - Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
 */
export const featureFlagsPartialUpdate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    inputSchema: FeatureFlagsPartialUpdateInput,
    outputSchema: FeatureFlagsPartialUpdateOutput,
    errors: [BadRequest, Forbidden, NotFound],
}));
//# sourceMappingURL=featureFlagsPartialUpdate.js.map