/**
 * Cloudflare BRAND-PROTECTION API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service brand-protection
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
import { UploadableSchema } from "../schemas.js";
export const SubmitBrandProtectionRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/brand-protection/submit",
}));
export const SubmitBrandProtectionResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    skippedUrls: Schema.optional(Schema.Union([
        Schema.Array(Schema.Record(Schema.String, Schema.Unknown)),
        Schema.Null,
    ])),
    submittedUrls: Schema.optional(Schema.Union([
        Schema.Array(Schema.Record(Schema.String, Schema.Unknown)),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({
    skippedUrls: "skipped_urls",
    submittedUrls: "submitted_urls",
}));
export const submitBrandProtection = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: SubmitBrandProtectionRequest,
    output: SubmitBrandProtectionResponse,
    errors: [],
}));
export const UrlInfoBrandProtectionRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/brand-protection/url-info",
}));
export const UrlInfoBrandProtectionResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Record(Schema.String, Schema.Unknown)),
});
export const urlInfoBrandProtection = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: UrlInfoBrandProtectionRequest,
    output: UrlInfoBrandProtectionResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const CreateLogoRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    matchType: Schema.optional(Schema.String).pipe(T.HttpQuery("match_type")),
    tag: Schema.optional(Schema.String).pipe(T.HttpQuery("tag")),
    threshold: Schema.optional(Schema.Number).pipe(T.HttpQuery("threshold")),
    image: Schema.optional(UploadableSchema.pipe(T.HttpFormDataFile())),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/brand-protection/logos",
    contentType: "multipart",
}));
export const CreateLogoResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    tag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    uploadPath: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(Schema.encodeKeys({ id: "id", tag: "tag", uploadPath: "upload_path" }));
export const createLogo = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateLogoRequest,
    output: CreateLogoResponse,
    errors: [],
}));
export const DeleteLogoRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    logoId: Schema.String.pipe(T.HttpPath("logoId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/brand-protection/logos/{logoId}",
}));
export const DeleteLogoResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const deleteLogo = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteLogoRequest,
    output: DeleteLogoResponse,
    errors: [],
}));
export const GetLogoMatchRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    limit: Schema.optional(Schema.String).pipe(T.HttpQuery("limit")),
    logoId: Schema.optional(Schema.Array(Schema.String)).pipe(T.HttpQuery("logo_id")),
    offset: Schema.optional(Schema.String).pipe(T.HttpQuery("offset")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/brand-protection/logo-matches",
}));
export const GetLogoMatchResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    matches: Schema.optional(Schema.Union([
        Schema.Array(Schema.Record(Schema.String, Schema.Unknown)),
        Schema.Null,
    ])),
    total: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
});
export const getLogoMatch = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetLogoMatchRequest,
    output: GetLogoMatchResponse,
    errors: [],
}));
export const DownloadLogoMatchRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    limit: Schema.optional(Schema.String).pipe(T.HttpQuery("limit")),
    logoId: Schema.optional(Schema.Array(Schema.String)).pipe(T.HttpQuery("logo_id")),
    offset: Schema.optional(Schema.String).pipe(T.HttpQuery("offset")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/brand-protection/logo-matches/download",
}));
export const DownloadLogoMatchResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    matches: Schema.optional(Schema.Union([
        Schema.Array(Schema.Record(Schema.String, Schema.Unknown)),
        Schema.Null,
    ])),
    total: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
});
export const downloadLogoMatch = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DownloadLogoMatchRequest,
    output: DownloadLogoMatchResponse,
    errors: [],
}));
export const GetMatchRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    id: Schema.optional(Schema.String).pipe(T.HttpQuery("id")),
    includeDomainId: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("include_domain_id")),
    limit: Schema.optional(Schema.Number).pipe(T.HttpQuery("limit")),
    offset: Schema.optional(Schema.Number).pipe(T.HttpQuery("offset")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/brand-protection/matches",
}));
export const GetMatchResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    matches: Schema.optional(Schema.Union([
        Schema.Array(Schema.Record(Schema.String, Schema.Unknown)),
        Schema.Null,
    ])),
    total: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
});
export const getMatch = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetMatchRequest,
    output: GetMatchResponse,
    errors: [],
}));
export const DownloadMatchRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    id: Schema.optional(Schema.String).pipe(T.HttpQuery("id")),
    includeDomainId: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("include_domain_id")),
    limit: Schema.optional(Schema.Number).pipe(T.HttpQuery("limit")),
    offset: Schema.optional(Schema.Number).pipe(T.HttpQuery("offset")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/brand-protection/matches/download",
}));
export const DownloadMatchResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    matches: Schema.optional(Schema.Union([
        Schema.Array(Schema.Record(Schema.String, Schema.Unknown)),
        Schema.Null,
    ])),
    total: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
});
export const downloadMatch = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DownloadMatchRequest,
    output: DownloadMatchResponse,
    errors: [],
}));
export const CreateQueryRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    id: Schema.optional(Schema.String).pipe(T.HttpQuery("id")),
    queryScan: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("query_scan")),
    queryTag: Schema.optional(Schema.String).pipe(T.HttpQuery("query_tag")),
    maxTime: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    minTime: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    bodyScan: Schema.optional(Schema.Boolean),
    stringMatches: Schema.optional(Schema.Unknown),
    bodyTag: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    maxTime: "max_time",
    minTime: "min_time",
    bodyScan: "body_scan",
    stringMatches: "string_matches",
    bodyTag: "body_tag",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/brand-protection/queries",
}));
export const CreateQueryResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const createQuery = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateQueryRequest,
    output: CreateQueryResponse,
    errors: [],
}));
export const DeleteQueryRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    id: Schema.optional(Schema.String).pipe(T.HttpQuery("id")),
    scan: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("scan")),
    tag: Schema.optional(Schema.String).pipe(T.HttpQuery("tag")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/brand-protection/queries",
}));
export const DeleteQueryResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const deleteQuery = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteQueryRequest,
    output: DeleteQueryResponse,
    errors: [],
}));
export const BulkQueryRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    queries: Schema.optional(Schema.Array(Schema.Record(Schema.String, Schema.Unknown))),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/brand-protection/queries/bulk",
}));
export const BulkQueryResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown;
export const bulkQuery = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: BulkQueryRequest,
    output: BulkQueryResponse,
    errors: [],
}));
export const GetV2LogoRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    id: Schema.optional(Schema.String).pipe(T.HttpQuery("id")),
    download: Schema.optional(Schema.String).pipe(T.HttpQuery("download")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries",
}));
export const GetV2LogoResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(Schema.Struct({
    id: Schema.Number,
    r2Path: Schema.String,
    similarityThreshold: Schema.Number,
    tag: Schema.String,
    uploadedAt: Schema.Union([Schema.String, Schema.Null]),
    contentType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    imageData: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(Schema.encodeKeys({
    id: "id",
    r2Path: "r2_path",
    similarityThreshold: "similarity_threshold",
    tag: "tag",
    uploadedAt: "uploaded_at",
    contentType: "content_type",
    imageData: "image_data",
})));
export const getV2Logo = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetV2LogoRequest,
    output: GetV2LogoResponse,
    errors: [],
}));
export const CreateV2LogoRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    imageData: Schema.String,
    similarityThreshold: Schema.Number,
    tag: Schema.String,
    searchLookback: Schema.optional(Schema.Boolean),
}).pipe(Schema.encodeKeys({
    imageData: "image_data",
    similarityThreshold: "similarity_threshold",
    tag: "tag",
    searchLookback: "search_lookback",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries",
}));
export const CreateV2LogoResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    message: Schema.String,
    success: Schema.Boolean,
    queryId: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
}).pipe(Schema.encodeKeys({
    message: "message",
    success: "success",
    queryId: "query_id",
}));
export const createV2Logo = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateV2LogoRequest,
    output: CreateV2LogoResponse,
    errors: [],
}));
export const DeleteV2LogoRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    queryId: Schema.String.pipe(T.HttpPath("queryId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/queries/{queryId}",
}));
export const DeleteV2LogoResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    message: Schema.String,
    success: Schema.Boolean,
});
export const deleteV2Logo = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteV2LogoRequest,
    output: DeleteV2LogoResponse,
    errors: [],
}));
export const GetV2LogoMatchRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    queryId: Schema.String.pipe(T.HttpQuery("query_id")),
    download: Schema.optional(Schema.String).pipe(T.HttpQuery("download")),
    limit: Schema.optional(Schema.String).pipe(T.HttpQuery("limit")),
    offset: Schema.optional(Schema.String).pipe(T.HttpQuery("offset")),
    order: Schema.optional(Schema.Union([Schema.Literals(["asc", "desc"]), Schema.String])).pipe(T.HttpQuery("order")),
    orderBy: Schema.optional(Schema.Union([
        Schema.Literals(["matchedAt", "domain", "similarityScore", "registrar"]),
        Schema.String,
    ])).pipe(T.HttpQuery("orderBy")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/cloudforce-one/v2/brand-protection/logo/matches",
}));
export const GetV2LogoMatchResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    matches: Schema.Array(Schema.Struct({
        id: Schema.Number,
        domain: Schema.Union([Schema.String, Schema.Null]),
        matchedAt: Schema.Union([Schema.String, Schema.Null]),
        queryId: Schema.Number,
        registrar: Schema.Union([Schema.String, Schema.Null]),
        similarityScore: Schema.Number,
        urlScanId: Schema.Union([Schema.String, Schema.Null]),
        contentType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        imageData: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        domain: "domain",
        matchedAt: "matched_at",
        queryId: "query_id",
        registrar: "registrar",
        similarityScore: "similarity_score",
        urlScanId: "url_scan_id",
        contentType: "content_type",
        imageData: "image_data",
    }))),
    total: Schema.Number,
});
export const getV2LogoMatch = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetV2LogoMatchRequest,
    output: GetV2LogoMatchResponse,
    errors: [],
}));
export const GetV2MatchRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    queryId: Schema.Array(Schema.String).pipe(T.HttpQuery("query_id")),
    domainSearch: Schema.optional(Schema.String).pipe(T.HttpQuery("domain_search")),
    includeDismissed: Schema.optional(Schema.String).pipe(T.HttpQuery("include_dismissed")),
    includeDomainId: Schema.optional(Schema.String).pipe(T.HttpQuery("include_domain_id")),
    limit: Schema.optional(Schema.String).pipe(T.HttpQuery("limit")),
    offset: Schema.optional(Schema.String).pipe(T.HttpQuery("offset")),
    order: Schema.optional(Schema.Union([Schema.Literals(["asc", "desc"]), Schema.String])).pipe(T.HttpQuery("order")),
    orderBy: Schema.optional(Schema.Union([
        Schema.Literals(["domain", "first_seen", "registrar"]),
        Schema.String,
    ])).pipe(T.HttpQuery("orderBy")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/cloudforce-one/v2/brand-protection/domain/matches",
}));
export const GetV2MatchResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    matches: Schema.Array(Schema.Struct({
        domain: Schema.String,
        firstSeen: Schema.String,
        publicScans: Schema.Union([
            Schema.Struct({
                submissionId: Schema.String,
            }).pipe(Schema.encodeKeys({ submissionId: "submission_id" })),
            Schema.Null,
        ]),
        registrar: Schema.Union([Schema.String, Schema.Null]),
        scanStatus: Schema.String,
        scanSubmissionId: Schema.Union([Schema.Number, Schema.Null]),
        source: Schema.Union([Schema.String, Schema.Null]),
        dismissed: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        matchDetails: Schema.optional(Schema.Union([
            Schema.Array(Schema.Struct({
                dismissed: Schema.Boolean,
                matchId: Schema.Number,
                queryId: Schema.Number,
                queryTag: Schema.Union([Schema.String, Schema.Null]),
            }).pipe(Schema.encodeKeys({
                dismissed: "dismissed",
                matchId: "match_id",
                queryId: "query_id",
                queryTag: "query_tag",
            }))),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        domain: "domain",
        firstSeen: "first_seen",
        publicScans: "public_scans",
        registrar: "registrar",
        scanStatus: "scan_status",
        scanSubmissionId: "scan_submission_id",
        source: "source",
        dismissed: "dismissed",
        matchDetails: "match_details",
    }))),
    total: Schema.Number,
});
export const getV2Match = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetV2MatchRequest,
    output: GetV2MatchResponse,
    errors: [],
}));
export const GetV2QueryRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    id: Schema.optional(Schema.String).pipe(T.HttpQuery("id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/cloudforce-one/v2/brand-protection/domain/queries",
}));
export const GetV2QueryResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(Schema.Struct({
    created: Schema.String,
    parameters: Schema.Union([
        Schema.Struct({
            stringMatches: Schema.Array(Schema.Struct({
                maxEditDistance: Schema.Number,
                pattern: Schema.String,
            }).pipe(Schema.encodeKeys({
                maxEditDistance: "max_edit_distance",
                pattern: "pattern",
            }))),
            maxTime: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            minTime: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            stringMatches: "string_matches",
            maxTime: "max_time",
            minTime: "min_time",
        })),
        Schema.Null,
    ]),
    queryId: Schema.Number,
    queryTag: Schema.String,
    scan: Schema.Boolean,
    updated: Schema.String,
}).pipe(Schema.encodeKeys({
    created: "created",
    parameters: "parameters",
    queryId: "query_id",
    queryTag: "query_tag",
    scan: "scan",
    updated: "updated",
})));
export const getV2Query = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetV2QueryRequest,
    output: GetV2QueryResponse,
    errors: [],
}));
//# sourceMappingURL=brand-protection.js.map