deletefeatureflag.ts•2.23 kB
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type DeleteFeatureFlagRequest = {
/**
* The project key
*/
projectKey: string;
/**
* The feature flag key. The key identifies the flag in your code.
*/
featureFlagKey: string;
};
/** @internal */
export const DeleteFeatureFlagRequest$inboundSchema: z.ZodType<
DeleteFeatureFlagRequest,
z.ZodTypeDef,
unknown
> = z.object({
projectKey: z.string(),
featureFlagKey: z.string(),
});
/** @internal */
export type DeleteFeatureFlagRequest$Outbound = {
projectKey: string;
featureFlagKey: string;
};
/** @internal */
export const DeleteFeatureFlagRequest$outboundSchema: z.ZodType<
DeleteFeatureFlagRequest$Outbound,
z.ZodTypeDef,
DeleteFeatureFlagRequest
> = z.object({
projectKey: z.string(),
featureFlagKey: z.string(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace DeleteFeatureFlagRequest$ {
/** @deprecated use `DeleteFeatureFlagRequest$inboundSchema` instead. */
export const inboundSchema = DeleteFeatureFlagRequest$inboundSchema;
/** @deprecated use `DeleteFeatureFlagRequest$outboundSchema` instead. */
export const outboundSchema = DeleteFeatureFlagRequest$outboundSchema;
/** @deprecated use `DeleteFeatureFlagRequest$Outbound` instead. */
export type Outbound = DeleteFeatureFlagRequest$Outbound;
}
export function deleteFeatureFlagRequestToJSON(
deleteFeatureFlagRequest: DeleteFeatureFlagRequest,
): string {
return JSON.stringify(
DeleteFeatureFlagRequest$outboundSchema.parse(deleteFeatureFlagRequest),
);
}
export function deleteFeatureFlagRequestFromJSON(
jsonString: string,
): SafeParseResult<DeleteFeatureFlagRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) => DeleteFeatureFlagRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'DeleteFeatureFlagRequest' from JSON`,
);
}