Skip to content

Commit

Permalink
feat(pagerules): rename namespace to page_rules (#2237)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and meorphis committed Jan 13, 2025
1 parent 2ec75e4 commit 7d758f7
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 95 deletions.
22 changes: 11 additions & 11 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1796,23 +1796,23 @@ Methods:
- <code title="put /zones/{zone_id}/origin_tls_client_auth/settings">client.originTLSClientAuth.settings.<a href="./src/resources/origin-tls-client-auth/settings.ts">update</a>({ ...params }) -> SettingUpdateResponse</code>
- <code title="get /zones/{zone_id}/origin_tls_client_auth/settings">client.originTLSClientAuth.settings.<a href="./src/resources/origin-tls-client-auth/settings.ts">get</a>({ ...params }) -> SettingGetResponse</code>

# Pagerules
# PageRules

Types:

- <code><a href="./src/resources/pagerules.ts">PageRule</a></code>
- <code><a href="./src/resources/pagerules.ts">Target</a></code>
- <code><a href="./src/resources/pagerules.ts">PageruleListResponse</a></code>
- <code><a href="./src/resources/pagerules.ts">PageruleDeleteResponse</a></code>
- <code><a href="./src/resources/page-rules.ts">PageRule</a></code>
- <code><a href="./src/resources/page-rules.ts">Target</a></code>
- <code><a href="./src/resources/page-rules.ts">PageRuleListResponse</a></code>
- <code><a href="./src/resources/page-rules.ts">PageRuleDeleteResponse</a></code>

Methods:

- <code title="post /zones/{zone_id}/pagerules">client.pagerules.<a href="./src/resources/pagerules.ts">create</a>({ ...params }) -> PageRule</code>
- <code title="put /zones/{zone_id}/pagerules/{pagerule_id}">client.pagerules.<a href="./src/resources/pagerules.ts">update</a>(pageruleId, { ...params }) -> PageRule</code>
- <code title="get /zones/{zone_id}/pagerules">client.pagerules.<a href="./src/resources/pagerules.ts">list</a>({ ...params }) -> PageruleListResponse</code>
- <code title="delete /zones/{zone_id}/pagerules/{pagerule_id}">client.pagerules.<a href="./src/resources/pagerules.ts">delete</a>(pageruleId, { ...params }) -> PageruleDeleteResponse | null</code>
- <code title="patch /zones/{zone_id}/pagerules/{pagerule_id}">client.pagerules.<a href="./src/resources/pagerules.ts">edit</a>(pageruleId, { ...params }) -> PageRule</code>
- <code title="get /zones/{zone_id}/pagerules/{pagerule_id}">client.pagerules.<a href="./src/resources/pagerules.ts">get</a>(pageruleId, { ...params }) -> PageRule</code>
- <code title="post /zones/{zone_id}/pagerules">client.pageRules.<a href="./src/resources/page-rules.ts">create</a>({ ...params }) -> PageRule</code>
- <code title="put /zones/{zone_id}/pagerules/{pagerule_id}">client.pageRules.<a href="./src/resources/page-rules.ts">update</a>(pageruleId, { ...params }) -> PageRule</code>
- <code title="get /zones/{zone_id}/pagerules">client.pageRules.<a href="./src/resources/page-rules.ts">list</a>({ ...params }) -> PageRuleListResponse</code>
- <code title="delete /zones/{zone_id}/pagerules/{pagerule_id}">client.pageRules.<a href="./src/resources/page-rules.ts">delete</a>(pageruleId, { ...params }) -> PageRuleDeleteResponse | null</code>
- <code title="patch /zones/{zone_id}/pagerules/{pagerule_id}">client.pageRules.<a href="./src/resources/page-rules.ts">edit</a>(pageruleId, { ...params }) -> PageRule</code>
- <code title="get /zones/{zone_id}/pagerules/{pagerule_id}">client.pageRules.<a href="./src/resources/page-rules.ts">get</a>(pageruleId, { ...params }) -> PageRule</code>

# RateLimits

Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { ManagedTransforms } from './resources/managed-transforms';
import { Memberships } from './resources/memberships';
import { OriginCACertificates } from './resources/origin-ca-certificates';
import { OriginPostQuantumEncryption } from './resources/origin-post-quantum-encryption';
import { Pagerules } from './resources/pagerules';
import { PageRules } from './resources/page-rules';
import { RateLimits } from './resources/rate-limits';
import { SecurityTXT } from './resources/security-txt';
import { URLNormalization } from './resources/url-normalization';
Expand Down Expand Up @@ -267,7 +267,7 @@ export class Cloudflare extends Core.APIClient {
logpush: API.Logpush = new API.Logpush(this);
logs: API.Logs = new API.Logs(this);
originTLSClientAuth: API.OriginTLSClientAuth = new API.OriginTLSClientAuth(this);
pagerules: API.Pagerules = new API.Pagerules(this);
pageRules: API.PageRules = new API.PageRules(this);
rateLimits: API.RateLimits = new API.RateLimits(this);
waitingRooms: API.WaitingRooms = new API.WaitingRooms(this);
web3: API.Web3 = new API.Web3(this);
Expand Down Expand Up @@ -477,7 +477,7 @@ Cloudflare.KeylessCertificates = KeylessCertificates;
Cloudflare.Logpush = Logpush;
Cloudflare.Logs = Logs;
Cloudflare.OriginTLSClientAuth = OriginTLSClientAuth;
Cloudflare.Pagerules = Pagerules;
Cloudflare.PageRules = PageRules;
Cloudflare.RateLimits = RateLimits;
Cloudflare.WaitingRooms = WaitingRooms;
Cloudflare.Web3 = Web3;
Expand Down Expand Up @@ -618,7 +618,7 @@ export declare namespace Cloudflare {

export { OriginTLSClientAuth as OriginTLSClientAuth };

export { Pagerules as Pagerules };
export { PageRules as PageRules };

export { RateLimits as RateLimits };

Expand Down
2 changes: 1 addition & 1 deletion src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export { Memberships } from './memberships';
export { OriginCACertificates } from './origin-ca-certificates';
export { OriginPostQuantumEncryption } from './origin-post-quantum-encryption';
export { OriginTLSClientAuth } from './origin-tls-client-auth/origin-tls-client-auth';
export { PageRules } from './page-rules';
export { PageShield } from './page-shield/page-shield';
export { Pagerules } from './pagerules';
export { Pages } from './pages/pages';
export { Queues } from './queues/queues';
export { R2 } from './r2/r2';
Expand Down
132 changes: 66 additions & 66 deletions src/resources/pagerules.ts → src/resources/page-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { APIResource } from '../resource';
import * as Core from '../core';
import * as SettingsAPI from './zones/settings';

export class Pagerules extends APIResource {
export class PageRules extends APIResource {
/**
* Creates a new Page Rule.
*/
create(params: PageruleCreateParams, options?: Core.RequestOptions): Core.APIPromise<PageRule> {
create(params: PageRuleCreateParams, options?: Core.RequestOptions): Core.APIPromise<PageRule> {
const { zone_id, ...body } = params;
return (
this._client.post(`/zones/${zone_id}/pagerules`, { body, ...options }) as Core.APIPromise<{
Expand All @@ -23,7 +23,7 @@ export class Pagerules extends APIResource {
*/
update(
pageruleId: string,
params: PageruleUpdateParams,
params: PageRuleUpdateParams,
options?: Core.RequestOptions,
): Core.APIPromise<PageRule> {
const { zone_id, ...body } = params;
Expand All @@ -37,11 +37,11 @@ export class Pagerules extends APIResource {
/**
* Fetches Page Rules in a zone.
*/
list(params: PageruleListParams, options?: Core.RequestOptions): Core.APIPromise<PageruleListResponse> {
list(params: PageRuleListParams, options?: Core.RequestOptions): Core.APIPromise<PageRuleListResponse> {
const { zone_id, ...query } = params;
return (
this._client.get(`/zones/${zone_id}/pagerules`, { query, ...options }) as Core.APIPromise<{
result: PageruleListResponse;
result: PageRuleListResponse;
}>
)._thenUnwrap((obj) => obj.result);
}
Expand All @@ -51,13 +51,13 @@ export class Pagerules extends APIResource {
*/
delete(
pageruleId: string,
params: PageruleDeleteParams,
params: PageRuleDeleteParams,
options?: Core.RequestOptions,
): Core.APIPromise<PageruleDeleteResponse | null> {
): Core.APIPromise<PageRuleDeleteResponse | null> {
const { zone_id } = params;
return (
this._client.delete(`/zones/${zone_id}/pagerules/${pageruleId}`, options) as Core.APIPromise<{
result: PageruleDeleteResponse | null;
result: PageRuleDeleteResponse | null;
}>
)._thenUnwrap((obj) => obj.result);
}
Expand All @@ -67,7 +67,7 @@ export class Pagerules extends APIResource {
*/
edit(
pageruleId: string,
params: PageruleEditParams,
params: PageRuleEditParams,
options?: Core.RequestOptions,
): Core.APIPromise<PageRule> {
const { zone_id, ...body } = params;
Expand All @@ -84,7 +84,7 @@ export class Pagerules extends APIResource {
*/
get(
pageruleId: string,
params: PageruleGetParams,
params: PageRuleGetParams,
options?: Core.RequestOptions,
): Core.APIPromise<PageRule> {
const { zone_id } = params;
Expand Down Expand Up @@ -549,16 +549,16 @@ export namespace TargetParam {
}
}

export type PageruleListResponse = Array<PageRule>;
export type PageRuleListResponse = Array<PageRule>;

export interface PageruleDeleteResponse {
export interface PageRuleDeleteResponse {
/**
* Identifier
*/
id: string;
}

export interface PageruleCreateParams {
export interface PageRuleCreateParams {
/**
* Path param: Identifier
*/
Expand All @@ -573,28 +573,28 @@ export interface PageruleCreateParams {
| SettingsAPI.AutomaticHTTPSRewritesParam
| SettingsAPI.BrowserCacheTTLParam
| SettingsAPI.BrowserCheckParam
| PageruleCreateParams.BypassCacheOnCookie
| PageruleCreateParams.CacheByDeviceType
| PageruleCreateParams.CacheDeceptionArmor
| PageruleCreateParams.CacheKey
| PageRuleCreateParams.BypassCacheOnCookie
| PageRuleCreateParams.CacheByDeviceType
| PageRuleCreateParams.CacheDeceptionArmor
| PageRuleCreateParams.CacheKey
| SettingsAPI.CacheLevelParam
| PageruleCreateParams.CacheOnCookie
| PageruleCreateParams.DisableApps
| PageruleCreateParams.DisablePerformance
| PageruleCreateParams.DisableSecurity
| PageruleCreateParams.DisableZaraz
| PageruleCreateParams.EdgeCacheTTL
| PageRuleCreateParams.CacheOnCookie
| PageRuleCreateParams.DisableApps
| PageRuleCreateParams.DisablePerformance
| PageRuleCreateParams.DisableSecurity
| PageRuleCreateParams.DisableZaraz
| PageRuleCreateParams.EdgeCacheTTL
| SettingsAPI.EmailObfuscationParam
| PageruleCreateParams.ExplicitCacheControl
| PageruleCreateParams.ForwardingURL
| PageruleCreateParams.HostHeaderOverride
| PageRuleCreateParams.ExplicitCacheControl
| PageRuleCreateParams.ForwardingURL
| PageRuleCreateParams.HostHeaderOverride
| SettingsAPI.IPGeolocationParam
| SettingsAPI.MirageParam
| SettingsAPI.OpportunisticEncryptionParam
| SettingsAPI.OriginErrorPagePassThruParam
| SettingsAPI.PolishParam
| PageruleCreateParams.ResolveOverride
| PageruleCreateParams.RespectStrongEtag
| PageRuleCreateParams.ResolveOverride
| PageRuleCreateParams.RespectStrongEtag
| SettingsAPI.ResponseBufferingParam
| SettingsAPI.RocketLoaderParam
| SettingsAPI.SecurityLevelParam
Expand Down Expand Up @@ -624,7 +624,7 @@ export interface PageruleCreateParams {
status?: 'active' | 'disabled';
}

export namespace PageruleCreateParams {
export namespace PageRuleCreateParams {
export interface BypassCacheOnCookie {
/**
* Bypass cache and fetch resources from the origin server if a regular expression
Expand Down Expand Up @@ -935,7 +935,7 @@ export namespace PageruleCreateParams {
}
}

export interface PageruleUpdateParams {
export interface PageRuleUpdateParams {
/**
* Path param: Identifier
*/
Expand All @@ -950,28 +950,28 @@ export interface PageruleUpdateParams {
| SettingsAPI.AutomaticHTTPSRewritesParam
| SettingsAPI.BrowserCacheTTLParam
| SettingsAPI.BrowserCheckParam
| PageruleUpdateParams.BypassCacheOnCookie
| PageruleUpdateParams.CacheByDeviceType
| PageruleUpdateParams.CacheDeceptionArmor
| PageruleUpdateParams.CacheKey
| PageRuleUpdateParams.BypassCacheOnCookie
| PageRuleUpdateParams.CacheByDeviceType
| PageRuleUpdateParams.CacheDeceptionArmor
| PageRuleUpdateParams.CacheKey
| SettingsAPI.CacheLevelParam
| PageruleUpdateParams.CacheOnCookie
| PageruleUpdateParams.DisableApps
| PageruleUpdateParams.DisablePerformance
| PageruleUpdateParams.DisableSecurity
| PageruleUpdateParams.DisableZaraz
| PageruleUpdateParams.EdgeCacheTTL
| PageRuleUpdateParams.CacheOnCookie
| PageRuleUpdateParams.DisableApps
| PageRuleUpdateParams.DisablePerformance
| PageRuleUpdateParams.DisableSecurity
| PageRuleUpdateParams.DisableZaraz
| PageRuleUpdateParams.EdgeCacheTTL
| SettingsAPI.EmailObfuscationParam
| PageruleUpdateParams.ExplicitCacheControl
| PageruleUpdateParams.ForwardingURL
| PageruleUpdateParams.HostHeaderOverride
| PageRuleUpdateParams.ExplicitCacheControl
| PageRuleUpdateParams.ForwardingURL
| PageRuleUpdateParams.HostHeaderOverride
| SettingsAPI.IPGeolocationParam
| SettingsAPI.MirageParam
| SettingsAPI.OpportunisticEncryptionParam
| SettingsAPI.OriginErrorPagePassThruParam
| SettingsAPI.PolishParam
| PageruleUpdateParams.ResolveOverride
| PageruleUpdateParams.RespectStrongEtag
| PageRuleUpdateParams.ResolveOverride
| PageRuleUpdateParams.RespectStrongEtag
| SettingsAPI.ResponseBufferingParam
| SettingsAPI.RocketLoaderParam
| SettingsAPI.SecurityLevelParam
Expand Down Expand Up @@ -1001,7 +1001,7 @@ export interface PageruleUpdateParams {
status?: 'active' | 'disabled';
}

export namespace PageruleUpdateParams {
export namespace PageRuleUpdateParams {
export interface BypassCacheOnCookie {
/**
* Bypass cache and fetch resources from the origin server if a regular expression
Expand Down Expand Up @@ -1312,7 +1312,7 @@ export namespace PageruleUpdateParams {
}
}

export interface PageruleListParams {
export interface PageRuleListParams {
/**
* Path param: Identifier
*/
Expand Down Expand Up @@ -1340,14 +1340,14 @@ export interface PageruleListParams {
status?: 'active' | 'disabled';
}

export interface PageruleDeleteParams {
export interface PageRuleDeleteParams {
/**
* Identifier
*/
zone_id: string;
}

export interface PageruleEditParams {
export interface PageRuleEditParams {
/**
* Path param: Identifier
*/
Expand All @@ -1362,28 +1362,28 @@ export interface PageruleEditParams {
| SettingsAPI.AutomaticHTTPSRewritesParam
| SettingsAPI.BrowserCacheTTLParam
| SettingsAPI.BrowserCheckParam
| PageruleEditParams.BypassCacheOnCookie
| PageruleEditParams.CacheByDeviceType
| PageruleEditParams.CacheDeceptionArmor
| PageruleEditParams.CacheKey
| PageRuleEditParams.BypassCacheOnCookie
| PageRuleEditParams.CacheByDeviceType
| PageRuleEditParams.CacheDeceptionArmor
| PageRuleEditParams.CacheKey
| SettingsAPI.CacheLevelParam
| PageruleEditParams.CacheOnCookie
| PageruleEditParams.DisableApps
| PageruleEditParams.DisablePerformance
| PageruleEditParams.DisableSecurity
| PageruleEditParams.DisableZaraz
| PageruleEditParams.EdgeCacheTTL
| PageRuleEditParams.CacheOnCookie
| PageRuleEditParams.DisableApps
| PageRuleEditParams.DisablePerformance
| PageRuleEditParams.DisableSecurity
| PageRuleEditParams.DisableZaraz
| PageRuleEditParams.EdgeCacheTTL
| SettingsAPI.EmailObfuscationParam
| PageruleEditParams.ExplicitCacheControl
| PageruleEditParams.ForwardingURL
| PageruleEditParams.HostHeaderOverride
| PageRuleEditParams.ExplicitCacheControl
| PageRuleEditParams.ForwardingURL
| PageRuleEditParams.HostHeaderOverride
| SettingsAPI.IPGeolocationParam
| SettingsAPI.MirageParam
| SettingsAPI.OpportunisticEncryptionParam
| SettingsAPI.OriginErrorPagePassThruParam
| SettingsAPI.PolishParam
| PageruleEditParams.ResolveOverride
| PageruleEditParams.RespectStrongEtag
| PageRuleEditParams.ResolveOverride
| PageRuleEditParams.RespectStrongEtag
| SettingsAPI.ResponseBufferingParam
| SettingsAPI.RocketLoaderParam
| SettingsAPI.SecurityLevelParam
Expand Down Expand Up @@ -1413,7 +1413,7 @@ export interface PageruleEditParams {
targets?: Array<TargetParam>;
}

export namespace PageruleEditParams {
export namespace PageRuleEditParams {
export interface BypassCacheOnCookie {
/**
* Bypass cache and fetch resources from the origin server if a regular expression
Expand Down Expand Up @@ -1724,7 +1724,7 @@ export namespace PageruleEditParams {
}
}

export interface PageruleGetParams {
export interface PageRuleGetParams {
/**
* Identifier
*/
Expand Down
Loading

0 comments on commit 7d758f7

Please sign in to comment.