"""Source of streams models of total values for DynamoDB.""" import os from pynamodb.attributes import NumberAttribute from pynamodb.attributes import UnicodeAttribute from pynamodb.models import Model from sosmodels import totals_attributes from sosmodels import util @totals_attributes.with_overall_totals class StreamsTrackTotalsSpotify(util.AsDictModelMixin, Model): """Streams track totals model.""" class Meta: """Streams track totals meta.""" table_name = '{env}_streams_track_totals_spotify'.format( env=os.environ.get('Environment', 'dev')) max_retry_attempts = 8 vendor_track_key = UnicodeAttribute(hash_key=True) date = UnicodeAttribute(range_key=True) ttl = NumberAttribute(default=0) @totals_attributes.with_overall_totals class StreamsTrackTotalsAppleMusic(util.AsDictModelMixin, Model): """Apple Music streams track totals model.""" class Meta: """Apple Music streams track totals meta.""" table_name = '{env}_streams_track_totals_apple_music'.format( env=os.environ.get('Environment', 'dev')) max_retry_attempts = 8 vendor_track_key = UnicodeAttribute(hash_key=True) date = UnicodeAttribute(range_key=True) ttl = NumberAttribute(default=0)