- Implement tests for `EbayOAuthClient` to verify authorization URL generation with configured scopes and token reuse logic. - Add tests for `WebhookChallengeHandler` to ensure correct SHA256 response generation and for `WebhookSignatureParser` to validate extraction of known fields from signature strings.
158 lines
4.9 KiB
Python
158 lines
4.9 KiB
Python
from collections.abc import Mapping
|
|
from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
|
|
from attrs import define as _attrs_define
|
|
from attrs import field as _attrs_field
|
|
|
|
from ..types import UNSET, Unset
|
|
|
|
from ..types import UNSET, Unset
|
|
from typing import cast
|
|
from typing import Union
|
|
|
|
if TYPE_CHECKING:
|
|
from ..models.payment_policy import PaymentPolicy
|
|
|
|
|
|
|
|
|
|
|
|
T = TypeVar("T", bound="PaymentPolicyResponse")
|
|
|
|
|
|
|
|
@_attrs_define
|
|
class PaymentPolicyResponse:
|
|
""" The response payload for the <b>getPaymentPolicies</b> method. <br><br><span class="tablenote"><b>Note</b>:
|
|
Pagination has not yet been enabled for <b>getPaymentPolicies</b>, so all of the pagination-related fields are for
|
|
future use.</span>
|
|
|
|
Attributes:
|
|
href (Union[Unset, str]): This field is for future use.
|
|
limit (Union[Unset, int]): This field is for future use.
|
|
next_ (Union[Unset, str]): This field is for future use.
|
|
offset (Union[Unset, int]): This field is for future use.
|
|
payment_policies (Union[Unset, list['PaymentPolicy']]): A list of all of the seller's payment business policies
|
|
defined for the specified marketplace. This array will be returned as empty if no payment business policies are
|
|
defined for the specified marketplace.
|
|
prev (Union[Unset, str]): This field is for future use.
|
|
total (Union[Unset, int]): The total number of payment business policies retrieved in the result set.
|
|
<br><br>If no payment business policies are defined for the specified marketplace, this field is returned with a
|
|
value of <code>0</code>.
|
|
"""
|
|
|
|
href: Union[Unset, str] = UNSET
|
|
limit: Union[Unset, int] = UNSET
|
|
next_: Union[Unset, str] = UNSET
|
|
offset: Union[Unset, int] = UNSET
|
|
payment_policies: Union[Unset, list['PaymentPolicy']] = UNSET
|
|
prev: Union[Unset, str] = UNSET
|
|
total: Union[Unset, int] = UNSET
|
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
|
|
|
|
|
|
|
|
|
|
def to_dict(self) -> dict[str, Any]:
|
|
from ..models.payment_policy import PaymentPolicy
|
|
href = self.href
|
|
|
|
limit = self.limit
|
|
|
|
next_ = self.next_
|
|
|
|
offset = self.offset
|
|
|
|
payment_policies: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
if not isinstance(self.payment_policies, Unset):
|
|
payment_policies = []
|
|
for payment_policies_item_data in self.payment_policies:
|
|
payment_policies_item = payment_policies_item_data.to_dict()
|
|
payment_policies.append(payment_policies_item)
|
|
|
|
|
|
|
|
prev = self.prev
|
|
|
|
total = self.total
|
|
|
|
|
|
field_dict: dict[str, Any] = {}
|
|
field_dict.update(self.additional_properties)
|
|
field_dict.update({
|
|
})
|
|
if href is not UNSET:
|
|
field_dict["href"] = href
|
|
if limit is not UNSET:
|
|
field_dict["limit"] = limit
|
|
if next_ is not UNSET:
|
|
field_dict["next"] = next_
|
|
if offset is not UNSET:
|
|
field_dict["offset"] = offset
|
|
if payment_policies is not UNSET:
|
|
field_dict["paymentPolicies"] = payment_policies
|
|
if prev is not UNSET:
|
|
field_dict["prev"] = prev
|
|
if total is not UNSET:
|
|
field_dict["total"] = total
|
|
|
|
return field_dict
|
|
|
|
|
|
|
|
@classmethod
|
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
from ..models.payment_policy import PaymentPolicy
|
|
d = dict(src_dict)
|
|
href = d.pop("href", UNSET)
|
|
|
|
limit = d.pop("limit", UNSET)
|
|
|
|
next_ = d.pop("next", UNSET)
|
|
|
|
offset = d.pop("offset", UNSET)
|
|
|
|
payment_policies = []
|
|
_payment_policies = d.pop("paymentPolicies", UNSET)
|
|
for payment_policies_item_data in (_payment_policies or []):
|
|
payment_policies_item = PaymentPolicy.from_dict(payment_policies_item_data)
|
|
|
|
|
|
|
|
payment_policies.append(payment_policies_item)
|
|
|
|
|
|
prev = d.pop("prev", UNSET)
|
|
|
|
total = d.pop("total", UNSET)
|
|
|
|
payment_policy_response = cls(
|
|
href=href,
|
|
limit=limit,
|
|
next_=next_,
|
|
offset=offset,
|
|
payment_policies=payment_policies,
|
|
prev=prev,
|
|
total=total,
|
|
)
|
|
|
|
|
|
payment_policy_response.additional_properties = d
|
|
return payment_policy_response
|
|
|
|
@property
|
|
def additional_keys(self) -> list[str]:
|
|
return list(self.additional_properties.keys())
|
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
return self.additional_properties[key]
|
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
self.additional_properties[key] = value
|
|
|
|
def __delitem__(self, key: str) -> None:
|
|
del self.additional_properties[key]
|
|
|
|
def __contains__(self, key: str) -> bool:
|
|
return key in self.additional_properties
|