"""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 StreamsVendorTotalsSpotify(util.AsDictModelMixin, Model): """Streams vendor totals model.""" class Meta: """Meta data for StreamsVendorTotals model.""" table_name = '{env}_streams_vendor_totals_spotify'.format( env=os.environ.get('Environment', 'dev')) max_retry_attempts = 8 vendor_key = UnicodeAttribute(hash_key=True) date = UnicodeAttribute(range_key=True) ttl = NumberAttribute(default=0) @totals_attributes.with_overall_totals class StreamsVendorTotalsAppleMusic(util.AsDictModelMixin, Model): """Apple Music streams vendor totals model.""" class Meta: """Apple Music streams vendor totals meta.""" table_name = '{env}_streams_vendor_totals_apple_music'.format( env=os.environ.get('Environment', 'dev')) max_retry_attempts = 8 vendor_key = UnicodeAttribute(hash_key=True) date = UnicodeAttribute(range_key=True) ttl = NumberAttribute(default=0)