update_usage¶
Operation¶
update_usage
¶
update_usage(request: UpdateUsageInput | UpdateUsageInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[UpdateUsageInputDict]) -> UpdateUsageOutput
Grants a temporary extension to the remaining quota of a usage plan associated with a specified API key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
UpdateUsageInput | UpdateUsageInputDict | 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[UpdateUsageInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
UpdateUsageOutput
|
An instance of |
update_usage
async
¶
update_usage(request: UpdateUsageInput | UpdateUsageInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[UpdateUsageInputDict]) -> UpdateUsageOutput
Grants a temporary extension to the remaining quota of a usage plan associated with a specified API key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
UpdateUsageInput | UpdateUsageInputDict | 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[UpdateUsageInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
UpdateUsageOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
UpdateUsageInputDict
¶
Bases: TypedDict
Dictionary form of UpdateUsageInput.
Attributes¶
key_id
instance-attribute
¶
The identifier of the API key associated with the usage plan in which a temporary extension is granted to the remaining quota.
patch_operations
instance-attribute
¶
patch_operations: Sequence[PatchOperation | PatchOperationDict] | None
For more information about supported patch operations, see Patch Operations.
UpdateUsageInput
dataclass
¶
Bases: _SerdeShape
The PATCH request to grant a temporary extension to the remaining quota of a usage plan associated with a specified API key.
Attributes¶
key_id
class-attribute
instance-attribute
¶
key_id: str | None = ...
The identifier of the API key associated with the usage plan in which a temporary extension is granted to the remaining quota.
patch_operations
class-attribute
instance-attribute
¶
patch_operations: list[PatchOperation] | None = ...
For more information about supported patch operations, see Patch Operations.
Output¶
UpdateUsageOutput
dataclass
¶
Bases: _SerdeShape
Represents the usage data of a usage plan.
Attributes¶
end_date
class-attribute
instance-attribute
¶
end_date: str | None = ...
The ending date of the usage data.
items
class-attribute
instance-attribute
¶
The usage data, as daily logs of used and remaining quotas, over the
specified time interval indexed over the API keys in a usage plan. For
example,
{..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]},
where {api_key} stands for an API key value and the daily log entry is
of the format [used quota, remaining quota].
position
class-attribute
instance-attribute
¶
position: str | None = ...
The current pagination position in the paged result set.
response_metadata
class-attribute
instance-attribute
¶
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.