Skip to content

Commit 2760733

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

File tree

268 files changed

+2608
-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

+2608
-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-beta"
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-beta".\
438438
format(env=sys.platform, pyversion=sys.version)
439439

440440
def get_host_settings(self):

cashfree_pg/models/address_details.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from typing import Optional
2323
from pydantic import BaseModel, Field, StrictStr
24+
from pydantic import field_validator
2425

2526
class AddressDetails(BaseModel):
2627
"""
@@ -39,10 +40,12 @@ class AddressDetails(BaseModel):
3940
email: Optional[StrictStr] = Field(None, description="Cutomer Email Address.")
4041
__properties = ["name", "address_line_one", "address_line_two", "country", "country_code", "state", "state_code", "city", "pin_code", "phone", "email"]
4142

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

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

cashfree_pg/models/adjust_vendor_balance_request.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from typing import Any, Dict, Optional, Union
2323
from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr
24+
from pydantic import field_validator
2425

2526
class AdjustVendorBalanceRequest(BaseModel):
2627
"""
@@ -33,10 +34,12 @@ class AdjustVendorBalanceRequest(BaseModel):
3334
tags: Optional[Dict[str, Any]] = Field(None, description="Provide additional data fields using tags.")
3435
__properties = ["transfer_from", "transfer_type", "transfer_amount", "remark", "tags"]
3536

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

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

cashfree_pg/models/adjust_vendor_balance_response.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from cashfree_pg.models.balance_details import BalanceDetails
2525
from cashfree_pg.models.charges_details import ChargesDetails
2626
from cashfree_pg.models.transfer_details import TransferDetails
27+
from pydantic import field_validator
2728

2829
class AdjustVendorBalanceResponse(BaseModel):
2930
"""
@@ -35,10 +36,12 @@ class AdjustVendorBalanceResponse(BaseModel):
3536
charges: Optional[ChargesDetails] = None
3637
__properties = ["settlement_id", "transfer_details", "balances", "charges"]
3738

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

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

cashfree_pg/models/api_error.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from typing import Optional
2323
from pydantic import BaseModel, Field, StrictStr, validator
24+
from pydantic import field_validator
2425

2526
class ApiError(BaseModel):
2627
"""
@@ -31,7 +32,7 @@ class ApiError(BaseModel):
3132
type: Optional[StrictStr] = Field(None, description="api_error")
3233
__properties = ["message", "code", "type"]
3334

34-
@validator('type')
35+
@field_validator('type')
3536
def type_validate_enum(cls, value):
3637
"""Validates the enum"""
3738
if value is None:
@@ -41,10 +42,12 @@ def type_validate_enum(cls, value):
4142
raise ValueError("must be one of enum values ('api_error')")
4243
return value
4344

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

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

cashfree_pg/models/api_error404.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from typing import Optional
2323
from pydantic import BaseModel, Field, StrictStr, validator
24+
from pydantic import field_validator
2425

2526
class ApiError404(BaseModel):
2627
"""
@@ -31,7 +32,7 @@ class ApiError404(BaseModel):
3132
type: Optional[StrictStr] = Field(None, description="invalid_request_error")
3233
__properties = ["message", "code", "type"]
3334

34-
@validator('type')
35+
@field_validator('type')
3536
def type_validate_enum(cls, value):
3637
"""Validates the enum"""
3738
if value is None:
@@ -41,10 +42,12 @@ def type_validate_enum(cls, value):
4142
raise ValueError("must be one of enum values ('invalid_request_error')")
4243
return value
4344

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

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

cashfree_pg/models/api_error409.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from typing import Optional
2323
from pydantic import BaseModel, Field, StrictStr, validator
24+
from pydantic import field_validator
2425

2526
class ApiError409(BaseModel):
2627
"""
@@ -31,7 +32,7 @@ class ApiError409(BaseModel):
3132
type: Optional[StrictStr] = Field(None, description="invalid_request_error")
3233
__properties = ["message", "code", "type"]
3334

34-
@validator('type')
35+
@field_validator('type')
3536
def type_validate_enum(cls, value):
3637
"""Validates the enum"""
3738
if value is None:
@@ -41,10 +42,12 @@ def type_validate_enum(cls, value):
4142
raise ValueError("must be one of enum values ('invalid_request_error')")
4243
return value
4344

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

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

0 commit comments

Comments
 (0)