Skip to content

Commit 3c77f54

Browse files
author
bitbucket-pipelines
committed
Generating Python SDK.
1 parent 4e4d008 commit 3c77f54

File tree

268 files changed

+2352
-1736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

268 files changed

+2352
-1736
lines changed

cashfree_pg/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
""" # noqa: E501
1616

1717

18-
__version__ = "4.5.1"
18+
__version__ = "5.0.1"
1919

2020
# import apis into sdk package
2121
# import ApiClient

cashfree_pg/api_client.py

Lines changed: 745 additions & 653 deletions
Large diffs are not rendered by default.

cashfree_pg/api_response.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from typing import Any, Dict, Optional
55
from pydantic import Field, StrictInt, StrictStr
66

7+
# Updated imports for Pydantic v2 compatibility
8+
79
class ApiResponse:
810
"""
911
API response object

cashfree_pg/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def to_debug_report(self):
434434
"OS: {env}\n"\
435435
"Python Version: {pyversion}\n"\
436436
"Version of the API: 2023-08-01\n"\
437-
"SDK Package Version: 4.5.1".\
437+
"SDK Package Version: 5.0.1".\
438438
format(env=sys.platform, pyversion=sys.version)
439439

440440
def get_host_settings(self):

cashfree_pg/models/address_details.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ class AddressDetails(BaseModel):
3939
email: Optional[StrictStr] = Field(None, description="Cutomer Email Address.")
4040
__properties = ["name", "address_line_one", "address_line_two", "country", "country_code", "state", "state_code", "city", "pin_code", "phone", "email"]
4141

42-
class Config:
43-
"""Pydantic configuration"""
44-
allow_population_by_field_name = True
45-
validate_assignment = True
42+
# Updated to Pydantic v2
43+
"""Pydantic configuration"""
44+
model_config = {
45+
"populate_by_name": True,
46+
"validate_assignment": True
47+
}
4648

4749
def to_str(self) -> str:
4850
"""Returns the string representation of the model using alias"""

cashfree_pg/models/adjust_vendor_balance_request.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ class AdjustVendorBalanceRequest(BaseModel):
3333
tags: Optional[Dict[str, Any]] = Field(None, description="Provide additional data fields using tags.")
3434
__properties = ["transfer_from", "transfer_type", "transfer_amount", "remark", "tags"]
3535

36-
class Config:
37-
"""Pydantic configuration"""
38-
allow_population_by_field_name = True
39-
validate_assignment = True
36+
# Updated to Pydantic v2
37+
"""Pydantic configuration"""
38+
model_config = {
39+
"populate_by_name": True,
40+
"validate_assignment": True
41+
}
4042

4143
def to_str(self) -> str:
4244
"""Returns the string representation of the model using alias"""

cashfree_pg/models/adjust_vendor_balance_response.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ class AdjustVendorBalanceResponse(BaseModel):
3535
charges: Optional[ChargesDetails] = None
3636
__properties = ["settlement_id", "transfer_details", "balances", "charges"]
3737

38-
class Config:
39-
"""Pydantic configuration"""
40-
allow_population_by_field_name = True
41-
validate_assignment = True
38+
# Updated to Pydantic v2
39+
"""Pydantic configuration"""
40+
model_config = {
41+
"populate_by_name": True,
42+
"validate_assignment": True
43+
}
4244

4345
def to_str(self) -> str:
4446
"""Returns the string representation of the model using alias"""

cashfree_pg/models/api_error.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ApiError(BaseModel):
3131
type: Optional[StrictStr] = Field(None, description="api_error")
3232
__properties = ["message", "code", "type"]
3333

34-
@validator('type')
34+
@field_validator('type')
3535
def type_validate_enum(cls, value):
3636
"""Validates the enum"""
3737
if value is None:
@@ -41,10 +41,12 @@ def type_validate_enum(cls, value):
4141
raise ValueError("must be one of enum values ('api_error')")
4242
return value
4343

44-
class Config:
45-
"""Pydantic configuration"""
46-
allow_population_by_field_name = True
47-
validate_assignment = True
44+
# Updated to Pydantic v2
45+
"""Pydantic configuration"""
46+
model_config = {
47+
"populate_by_name": True,
48+
"validate_assignment": True
49+
}
4850

4951
def to_str(self) -> str:
5052
"""Returns the string representation of the model using alias"""

cashfree_pg/models/api_error404.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ApiError404(BaseModel):
3131
type: Optional[StrictStr] = Field(None, description="invalid_request_error")
3232
__properties = ["message", "code", "type"]
3333

34-
@validator('type')
34+
@field_validator('type')
3535
def type_validate_enum(cls, value):
3636
"""Validates the enum"""
3737
if value is None:
@@ -41,10 +41,12 @@ def type_validate_enum(cls, value):
4141
raise ValueError("must be one of enum values ('invalid_request_error')")
4242
return value
4343

44-
class Config:
45-
"""Pydantic configuration"""
46-
allow_population_by_field_name = True
47-
validate_assignment = True
44+
# Updated to Pydantic v2
45+
"""Pydantic configuration"""
46+
model_config = {
47+
"populate_by_name": True,
48+
"validate_assignment": True
49+
}
4850

4951
def to_str(self) -> str:
5052
"""Returns the string representation of the model using alias"""

cashfree_pg/models/api_error409.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ApiError409(BaseModel):
3131
type: Optional[StrictStr] = Field(None, description="invalid_request_error")
3232
__properties = ["message", "code", "type"]
3333

34-
@validator('type')
34+
@field_validator('type')
3535
def type_validate_enum(cls, value):
3636
"""Validates the enum"""
3737
if value is None:
@@ -41,10 +41,12 @@ def type_validate_enum(cls, value):
4141
raise ValueError("must be one of enum values ('invalid_request_error')")
4242
return value
4343

44-
class Config:
45-
"""Pydantic configuration"""
46-
allow_population_by_field_name = True
47-
validate_assignment = True
44+
# Updated to Pydantic v2
45+
"""Pydantic configuration"""
46+
model_config = {
47+
"populate_by_name": True,
48+
"validate_assignment": True
49+
}
4850

4951
def to_str(self) -> str:
5052
"""Returns the string representation of the model using alias"""

0 commit comments

Comments
 (0)