Skip to content

create_gateway_rate_limit

Operation

create_gateway_rate_limit

create_gateway_rate_limit(request: CreateGatewayRateLimitInput | CreateGatewayRateLimitInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateGatewayRateLimitInputDict]) -> CreateGatewayRateLimitOutput

Creates a rate limit for a gateway. Rate limits define throttling rules for each dimension that control request rates, token consumption rates, and concurrent connections through the gateway.

Parameters:

Name Type Description Default
request CreateGatewayRateLimitInput | CreateGatewayRateLimitInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[CreateGatewayRateLimitInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateGatewayRateLimitOutput

An instance of CreateGatewayRateLimitOutput.

create_gateway_rate_limit async

create_gateway_rate_limit(request: CreateGatewayRateLimitInput | CreateGatewayRateLimitInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateGatewayRateLimitInputDict]) -> CreateGatewayRateLimitOutput

Creates a rate limit for a gateway. Rate limits define throttling rules for each dimension that control request rates, token consumption rates, and concurrent connections through the gateway.

Parameters:

Name Type Description Default
request CreateGatewayRateLimitInput | CreateGatewayRateLimitInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[CreateGatewayRateLimitInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateGatewayRateLimitOutput

An instance of CreateGatewayRateLimitOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

CreateGatewayRateLimitInputDict

Bases: TypedDict

Dictionary form of CreateGatewayRateLimitInput.

Attributes

client_token instance-attribute
client_token: str | None

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see Ensuring idempotency.

This field is autopopulated if not provided.

description instance-attribute
description: str | None

An optional human-readable description for this rate limit. If not provided, the rate limit is created without a description.

dimension_keys instance-attribute
dimension_keys: Required[Sequence[str]]

The ordered list of dimension key names that define the scope of this rate limit. Must be unique per gateway---no two rate limits can share the same dimension keys.

entries instance-attribute

The rule entries that map dimension values to rate configurations.

gateway_identifier instance-attribute
gateway_identifier: Required[str]

The unique identifier of the gateway to create the rate limit for.

rate_limit_id instance-attribute
rate_limit_id: str | None

An optional customer-defined identifier for the rate limit. If not provided, the system generates one.

CreateGatewayRateLimitInput dataclass

Bases: _SerdeShape

Dataclass for CreateGatewayRateLimitInput structure.

Attributes

client_token class-attribute instance-attribute
client_token: str | None = ...

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If you don't specify this field, a value is randomly generated for you. If this token matches a previous request, the service ignores the request, but doesn't return an error. For more information, see Ensuring idempotency.

This field is autopopulated if not provided.

description class-attribute instance-attribute
description: str | None = ...

An optional human-readable description for this rate limit. If not provided, the rate limit is created without a description.

dimension_keys class-attribute instance-attribute
dimension_keys: list[str] | None = ...

The ordered list of dimension key names that define the scope of this rate limit. Must be unique per gateway---no two rate limits can share the same dimension keys.

entries class-attribute instance-attribute
entries: list[LimitEntry] | None = ...

The rule entries that map dimension values to rate configurations.

gateway_identifier class-attribute instance-attribute
gateway_identifier: str | None = ...

The unique identifier of the gateway to create the rate limit for.

rate_limit_id class-attribute instance-attribute
rate_limit_id: str | None = ...

An optional customer-defined identifier for the rate limit. If not provided, the system generates one.

Output

CreateGatewayRateLimitOutput dataclass

Bases: _SerdeShape

Shared fields for GatewayRateLimit responses.

Attributes

created_at instance-attribute
created_at: datetime

The timestamp when the rate limit was created.

description class-attribute instance-attribute
description: str | None = ...

The human-readable description of the rate limit.

dimension_keys instance-attribute
dimension_keys: list[str]

The ordered list of dimension key names that define the scope of this rate limit.

entries instance-attribute
entries: list[LimitEntry]

The list of rule entries that map dimension values to rate configurations.

gateway_identifier instance-attribute
gateway_identifier: str

The unique identifier of the gateway.

rate_limit_id instance-attribute
rate_limit_id: str

The unique identifier of the created rate limit.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

status instance-attribute
status: str

The current status of the rate limit.

updated_at instance-attribute
updated_at: datetime

The timestamp when the rate limit was last updated.