Python SDK Limit Tags API Reference
Overview
This document provides detailed reference information for the client.limits.tags
resource in the Pay-i Python SDK. For usage examples and best practices, see the Python SDK Limit Tags Guide.
Method Reference
Method | Description | Return Type | Access Pattern | REST API Endpoint |
---|---|---|---|---|
create() | Adds new tags to an existing limit | TagCreateResponse | response.limit_tags | Add Tags to a Limit |
update() | Replaces all tags on a limit with new ones | TagUpdateResponse | response.limit_tags | Update a Limit's Tags |
list() | Retrieves all tags for a limit | TagListResponse | response.limit_tags | Get Tags for a Limit |
delete() | Removes all tags from a limit | TagDeleteResponse | response.limit_tags | Remove All Tags from Limit |
remove() | Removes specific tags from a limit | TagRemoveResponse | response.limit_tags | Remove Tags from Limit |
Response Types
The limit tags API returns several different response types depending on the method called:
TagCreateResponse
Returned by the create()
method.
TagCreateResponse:
request_id: str # Server-generated trace identifier
message: Optional[str] # Optional status message
limit_tags: Optional[List[str]] # The updated list of all tags on the limit
TagUpdateResponse
Returned by the update()
method.
TagUpdateResponse:
request_id: str # Server-generated trace identifier
message: Optional[str] # Optional status message
limit_tags: Optional[List[str]] # The new list of tags on the limit (replacing previous tags)
TagListResponse
Returned by the list()
method.
TagListResponse:
request_id: str # Server-generated trace identifier
message: Optional[str] # Optional status message
limit_tags: Optional[List[str]] # List of all tags on the limit
TagDeleteResponse
Returned by the delete()
method.
TagDeleteResponse:
request_id: str # Server-generated trace identifier
message: Optional[str] # Optional status message
limit_tags: Optional[List[str]] # Should be empty list after deletion
TagRemoveResponse
Returned by the remove()
method.
TagRemoveResponse:
request_id: str # Server-generated trace identifier
message: Optional[str] # Optional status message
limit_tags: Optional[List[str]] # The remaining tags after removal
The request_id
is the HTTP request's trace identifier that uniquely identifies the request across the Pay-i system. This is a standard field present in all Pay-i API responses as they inherit from a common ResponseBase class. The trace ID can be used for correlating requests in logs, troubleshooting issues, and tracking request flow through the system.
Method Details
Method | Description | Return Type | Access Pattern | REST API Endpoint |
---|---|---|---|---|
create() | Adds new tags to an existing limit | TagCreateResponse | response.limit_tags | Add Tags to a Limit |
update() | Replaces all tags on a limit with new ones | TagUpdateResponse | response.limit_tags | Update a Limit's Tags |
list() | Retrieves all tags for a limit | TagListResponse | response.limit_tags | Get Tags for a Limit |
delete() | Removes all tags from a limit | TagDeleteResponse | response.limit_tags | Remove All Tags from Limit |
remove() | Removes specific tags from a limit | TagRemoveResponse | response.limit_tags | Remove Tags from Limit |
create()
client.limits.tags.create(
limit_id: str,
limit_tags: List[str]
) -> TagCreateResponse
Adds new tags to an existing limit. The tags are appended to any existing tags on the limit.
Calls: Add Tags to a Limit REST API endpoint
Parameters:
limit_id
(required): The ID of the limit to add tags tolimit_tags
(required): List of string tags to add
Returns: A TagCreateResponse
object containing:
request_id
: Server-generated trace identifiermessage
: Optional status messagelimit_tags
: The updated list of all tags on the limit (including previously existing tags)
Example:
response = client.limits.tags.create(
limit_id="lim_1234567890",
limit_tags=["marketing", "campaign_q2_2024"]
)
print(f"Updated tags: {response.limit_tags}")
update()
client.limits.tags.update(
limit_id: str,
limit_tags: List[str]
) -> TagUpdateResponse
Replaces all existing tags on the limit with the new set of tags provided.
Calls: Update a Limit's Tags REST API endpoint
Parameters:
limit_id
(required): The ID of the limit to update tags forlimit_tags
(required): List of string tags that will replace all existing tags
Returns: A TagUpdateResponse
object containing:
request_id
: Server-generated trace identifiermessage
: Optional status messagelimit_tags
: The new list of tags on the limit (replacing all previous tags)
Example:
response = client.limits.tags.update(
limit_id="lim_1234567890",
limit_tags=["sales", "enterprise_accounts"]
)
print(f"New tags: {response.limit_tags}")
list()
client.limits.tags.list(
limit_id: str
) -> TagListResponse
Retrieves all tags currently associated with a limit.
Calls: Get Tags for a Limit REST API endpoint
Parameters:
limit_id
(required): The ID of the limit to get tags for
Returns: A TagListResponse
object containing:
request_id
: Server-generated trace identifiermessage
: Optional status messagelimit_tags
: List of all tags currently on the limit
Example:
response = client.limits.tags.list(limit_id="lim_1234567890")
if response.limit_tags:
print(f"Limit has {len(response.limit_tags)} tags: {', '.join(response.limit_tags)}")
else:
print("Limit has no tags")
delete()
client.limits.tags.delete(
limit_id: str
) -> TagDeleteResponse
Removes all tags from a limit.
Calls: Remove All Tags from Limit REST API endpoint
Parameters:
limit_id
(required): The ID of the limit to remove all tags from
Returns: A TagDeleteResponse
object containing:
request_id
: Server-generated trace identifiermessage
: Optional status messagelimit_tags
: Empty list confirming all tags were removed
Example:
response = client.limits.tags.delete(limit_id="lim_1234567890")
print("All tags removed")
remove()
client.limits.tags.remove(
limit_id: str,
limit_tags: List[str]
) -> TagRemoveResponse
Removes specific tags from a limit while keeping other tags intact.
Calls: Remove Tags from Limit REST API endpoint
Parameters:
limit_id
(required): The ID of the limit to remove specific tags fromlimit_tags
(required): List of string tags to remove from the limit
Returns: A TagRemoveResponse
object containing:
request_id
: Server-generated trace identifiermessage
: Optional status messagelimit_tags
: The remaining tags after removal
Example:
response = client.limits.tags.remove(
limit_id="lim_1234567890",
limit_tags=["marketing"] # Only remove the marketing tag
)
print(f"Remaining tags after removal: {response.limit_tags}")
Updated 8 days ago