Source code for worldline.connect.sdk.v1.domain.trial_period
# -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://apireference.connect.worldline-solutions.com/
#
from typing import Optional
from worldline.connect.sdk.domain.data_object import DataObject
[docs]
class TrialPeriod(DataObject):
"""
| The object containing information on the trial period duration and the interval between payments during that period.
"""
__duration: Optional[int] = None
__interval: Optional[str] = None
@property
def duration(self) -> Optional[int]:
"""
| The number of days, weeks, months, or years before the trial period ends.
Type: int
"""
return self.__duration
@duration.setter
def duration(self, value: Optional[int]) -> None:
self.__duration = value
@property
def interval(self) -> Optional[str]:
"""
| The interval for the trial period to finish specified as days, weeks, months, quarters, or years.
Type: str
"""
return self.__interval
@interval.setter
def interval(self, value: Optional[str]) -> None:
self.__interval = value
[docs]
def to_dictionary(self) -> dict:
dictionary = super(TrialPeriod, self).to_dictionary()
if self.duration is not None:
dictionary['duration'] = self.duration
if self.interval is not None:
dictionary['interval'] = self.interval
return dictionary
[docs]
def from_dictionary(self, dictionary: dict) -> 'TrialPeriod':
super(TrialPeriod, self).from_dictionary(dictionary)
if 'duration' in dictionary:
self.duration = dictionary['duration']
if 'interval' in dictionary:
self.interval = dictionary['interval']
return self