cloudflare/cloudflare-typescript

Public

mirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
dc2c35e0eaee6169f220ff4de53afa8ecffd409d

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/resources/botnet-feed/asn.ts

86lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import { APIResource } from '../../resource';
4import * as Core from '../../core';
5import * as ASNAPI from './asn';
6
7export class ASN extends APIResource {
8 /**
9 * Gets all the data the botnet tracking database has for a given ASN registered to
10 * user account for given date. If no date is given, it will return results for the
11 * previous day.
12 */
13 dayReport(
14 asnId: number,
15 params: ASNDayReportParams,
16 options?: Core.RequestOptions,
17 ): Core.APIPromise<ASNDayReportResponse> {
18 const { account_id, ...query } = params;
19 return (
20 this._client.get(`/accounts/${account_id}/botnet_feed/asn/${asnId}/day_report`, {
21 query,
22 ...options,
23 }) as Core.APIPromise<{ result: ASNDayReportResponse }>
24 )._thenUnwrap((obj) => obj.result);
25 }
26
27 /**
28 * Gets all the data the botnet threat feed tracking database has for a given ASN
29 * registered to user account.
30 */
31 fullReport(
32 asnId: number,
33 params: ASNFullReportParams,
34 options?: Core.RequestOptions,
35 ): Core.APIPromise<ASNFullReportResponse> {
36 const { account_id } = params;
37 return (
38 this._client.get(
39 `/accounts/${account_id}/botnet_feed/asn/${asnId}/full_report`,
40 options,
41 ) as Core.APIPromise<{ result: ASNFullReportResponse }>
42 )._thenUnwrap((obj) => obj.result);
43 }
44}
45
46export interface ASNDayReportResponse {
47 cidr?: string;
48
49 date?: string;
50
51 offense_count?: number;
52}
53
54export interface ASNFullReportResponse {
55 cidr?: string;
56
57 date?: string;
58
59 offense_count?: number;
60}
61
62export interface ASNDayReportParams {
63 /**
64 * Path param: Identifier
65 */
66 account_id: string;
67
68 /**
69 * Query param:
70 */
71 date?: string;
72}
73
74export interface ASNFullReportParams {
75 /**
76 * Identifier
77 */
78 account_id: string;
79}
80
81export namespace ASN {
82 export import ASNDayReportResponse = ASNAPI.ASNDayReportResponse;
83 export import ASNFullReportResponse = ASNAPI.ASNFullReportResponse;
84 export import ASNDayReportParams = ASNAPI.ASNDayReportParams;
85 export import ASNFullReportParams = ASNAPI.ASNFullReportParams;
86}
87