Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 7, 2024
1 parent c8d13ee commit f5861eb
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -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
122 changes: 115 additions & 7 deletions src/resources/logpush/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions tests/api-resources/logpush/jobs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ describe('resource jobs', () => {
dataset: 'http_requests',
enabled: false,
frequency: 'high',
kind: 'edge',
logpull_options: 'fields=RayID,ClientIP,EdgeStartTimestamp&timestamps=rfc3339',
max_upload_bytes: 5000000,
max_upload_interval_seconds: 30,
max_upload_records: 1000,
name: 'example.com',
output_options: {
'CVE-2021-4428': true,
Expand Down

0 comments on commit f5861eb

Please sign in to comment.