From 56856b1b38a11f837f918fd0677ea3ebcb74f8e2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Apr 2024 18:30:12 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#406) --- .stats.yml | 2 +- src/resources/logpush/jobs.ts | 122 +++++++++++++++++++++-- tests/api-resources/logpush/jobs.test.ts | 4 + 3 files changed, 120 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 310e06abf2..1765a1fb19 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1259 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9e7278b59ca6d3312a49ec919b139cdc626476b556f93923d70aeaf39c5c7bcf.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-66dffe82f1ae82ccb13bf0b382257be6906f416a22d1ca4ea74464cfff324775.yml diff --git a/src/resources/logpush/jobs.ts b/src/resources/logpush/jobs.ts index d638bf3d94..adb63d26cc 100644 --- a/src/resources/logpush/jobs.ts +++ b/src/resources/logpush/jobs.ts @@ -203,7 +203,8 @@ export interface LogpushJob { id?: number; /** - * Name of the dataset. + * Name of the dataset. A list of supported datasets can be found on the + * [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/). */ dataset?: string | null; @@ -228,12 +229,21 @@ export interface LogpushJob { error_message?: string | null; /** - * The frequency at which Cloudflare sends batches of logs to your destination. - * Setting frequency to high sends your logs in larger quantities of smaller files. - * Setting frequency to low sends logs in smaller quantities of larger files. + * @deprecated: This field is deprecated. Please use `max_upload_*` parameters + * instead. The frequency at which Cloudflare sends batches of logs to your + * destination. Setting frequency to high sends your logs in larger quantities of + * smaller files. Setting frequency to low sends logs in smaller quantities of + * larger files. */ frequency?: 'high' | 'low' | null; + /** + * The kind parameter (optional) is used to differentiate between Logpush and Edge + * Log Delivery jobs. Currently, Edge Log Delivery is only supported for the + * `http_requests` dataset. + */ + kind?: 'edge' | null; + /** * Records the last time for which logs have been successfully pushed. If the last * successful push was for logs range 2018-07-23T10:00:00Z to 2018-07-23T10:01:00Z @@ -258,6 +268,32 @@ export interface LogpushJob { */ logpull_options?: string | null; + /** + * The maximum uncompressed file size of a batch of logs. This setting value must + * be between `5 MB` and `1 GB`, or `0` to disable it. Note that you cannot set a + * minimum file size; this means that log files may be much smaller than this batch + * size. This parameter is not available for jobs with `edge` as its kind. + */ + max_upload_bytes?: number | null; + + /** + * The maximum interval in seconds for log batches. This setting must be between 30 + * and 300 seconds (5 minutes), or `0` to disable it. Note that you cannot specify + * a minimum interval for log batches; this means that log files may be sent in + * shorter intervals than this. This parameter is only used for jobs with `edge` as + * its kind. + */ + max_upload_interval_seconds?: number | null; + + /** + * The maximum number of log lines per batch. This setting must be between 1000 and + * 1,000,000 lines, or `0` to disable it. Note that you cannot specify a minimum + * number of log lines per batch; this means that log files may contain many fewer + * lines than this. This parameter is not available for jobs with `edge` as its + * kind. + */ + max_upload_records?: number | null; + /** * Optional human readable job name. Not unique. Cloudflare suggests that you set * this to a meaningful string, like the domain name, to make it easier to identify @@ -447,7 +483,9 @@ export interface JobCreateParams { zone_id?: string; /** - * Body param: Name of the dataset. + * Body param: Name of the dataset. A list of supported datasets can be found on + * the + * [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/). */ dataset?: string | null; @@ -457,13 +495,21 @@ export interface JobCreateParams { enabled?: boolean; /** - * Body param: The frequency at which Cloudflare sends batches of logs to your + * Body param: This field is deprecated. Please use `max_upload_*` parameters + * instead. The frequency at which Cloudflare sends batches of logs to your * destination. Setting frequency to high sends your logs in larger quantities of * smaller files. Setting frequency to low sends logs in smaller quantities of * larger files. */ frequency?: 'high' | 'low' | null; + /** + * Body param: The kind parameter (optional) is used to differentiate between + * Logpush and Edge Log Delivery jobs. Currently, Edge Log Delivery is only + * supported for the `http_requests` dataset. + */ + kind?: 'edge' | null; + /** * Body param: This field is deprecated. Use `output_options` instead. * Configuration string. It specifies things like requested fields and timestamp @@ -473,6 +519,33 @@ export interface JobCreateParams { */ logpull_options?: string | null; + /** + * Body param: The maximum uncompressed file size of a batch of logs. This setting + * value must be between `5 MB` and `1 GB`, or `0` to disable it. Note that you + * cannot set a minimum file size; this means that log files may be much smaller + * than this batch size. This parameter is not available for jobs with `edge` as + * its kind. + */ + max_upload_bytes?: number | null; + + /** + * Body param: The maximum interval in seconds for log batches. This setting must + * be between 30 and 300 seconds (5 minutes), or `0` to disable it. Note that you + * cannot specify a minimum interval for log batches; this means that log files may + * be sent in shorter intervals than this. This parameter is only used for jobs + * with `edge` as its kind. + */ + max_upload_interval_seconds?: number | null; + + /** + * Body param: The maximum number of log lines per batch. This setting must be + * between 1000 and 1,000,000 lines, or `0` to disable it. Note that you cannot + * specify a minimum number of log lines per batch; this means that log files may + * contain many fewer lines than this. This parameter is not available for jobs + * with `edge` as its kind. + */ + max_upload_records?: number | null; + /** * Body param: Optional human readable job name. Not unique. Cloudflare suggests * that you set this to a meaningful string, like the domain name, to make it @@ -518,13 +591,21 @@ export interface JobUpdateParams { enabled?: boolean; /** - * Body param: The frequency at which Cloudflare sends batches of logs to your + * Body param: This field is deprecated. Please use `max_upload_*` parameters + * instead. The frequency at which Cloudflare sends batches of logs to your * destination. Setting frequency to high sends your logs in larger quantities of * smaller files. Setting frequency to low sends logs in smaller quantities of * larger files. */ frequency?: 'high' | 'low' | null; + /** + * Body param: The kind parameter (optional) is used to differentiate between + * Logpush and Edge Log Delivery jobs. Currently, Edge Log Delivery is only + * supported for the `http_requests` dataset. + */ + kind?: 'edge' | null; + /** * Body param: This field is deprecated. Use `output_options` instead. * Configuration string. It specifies things like requested fields and timestamp @@ -534,6 +615,33 @@ export interface JobUpdateParams { */ logpull_options?: string | null; + /** + * Body param: The maximum uncompressed file size of a batch of logs. This setting + * value must be between `5 MB` and `1 GB`, or `0` to disable it. Note that you + * cannot set a minimum file size; this means that log files may be much smaller + * than this batch size. This parameter is not available for jobs with `edge` as + * its kind. + */ + max_upload_bytes?: number | null; + + /** + * Body param: The maximum interval in seconds for log batches. This setting must + * be between 30 and 300 seconds (5 minutes), or `0` to disable it. Note that you + * cannot specify a minimum interval for log batches; this means that log files may + * be sent in shorter intervals than this. This parameter is only used for jobs + * with `edge` as its kind. + */ + max_upload_interval_seconds?: number | null; + + /** + * Body param: The maximum number of log lines per batch. This setting must be + * between 1000 and 1,000,000 lines, or `0` to disable it. Note that you cannot + * specify a minimum number of log lines per batch; this means that log files may + * contain many fewer lines than this. This parameter is not available for jobs + * with `edge` as its kind. + */ + max_upload_records?: number | null; + /** * Body param: The structured replacement for `logpull_options`. When including * this field, the `logpull_option` field will be ignored. diff --git a/tests/api-resources/logpush/jobs.test.ts b/tests/api-resources/logpush/jobs.test.ts index 8cb423a2aa..fa5101a735 100644 --- a/tests/api-resources/logpush/jobs.test.ts +++ b/tests/api-resources/logpush/jobs.test.ts @@ -33,7 +33,11 @@ describe('resource jobs', () => { dataset: 'http_requests', enabled: false, frequency: 'high', + kind: 'edge', logpull_options: 'fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339', + max_upload_bytes: 5000000, + max_upload_interval_seconds: 30, + max_upload_records: 1000, name: 'example.com', output_options: { 'CVE-2021-4428': true,