How to use param_defaults method in localstack

Best Python code snippet using localstack_python

models.py

Source:models.py Github

copy

Full Screen

1import json2class ContentAnalyticsModel(object):3 def __init__(self):4 self.param_defaults = {}5 def __str__(self):6 return json.dumps(self.as_dict(), sort_keys=True)7 def __repr__(self):8 return json.dumps(self.as_dict(), sort_keys=True)9 def as_dict(self):10 data = {}11 for key, value in self.param_defaults.items():12 if getattr(self, key, None):13 data[key] = getattr(self, key, None)14 return data15class Product(ContentAnalyticsModel):16 def __init__(self, *args, **kwargs):17 super().__init__()18 self.param_defaults = {19 'crawl': None,20 'crawl_frequency': None,21 'created_at': None,22 'id': None,23 'ignore_variant_data': None,24 'is_custom_filter': None,25 'is_public': None,26 'name': None,27 'type': None,28 'urgent': None,29 'user_id': None,30 'with_price': None,31 }32 for param, default in self.param_defaults.items():33 setattr(self, param, kwargs.get(param, default))34class SearchTermGroup(ContentAnalyticsModel):35 def __init__(self, *args, **kwargs):36 super().__init__()37 self.param_defaults = {38 'created_at': None,39 'enabled': None,40 'id': None,41 'name': None,42 }43 for param, default in self.param_defaults.items():44 setattr(self, param, kwargs.get(param, default))45class SearchTerm(ContentAnalyticsModel):46 def __init__(self, *args, **kwargs):47 super().__init__()48 self.param_defaults = {49 'group_id': None,50 'id': None,51 'title': None52 }53 for param, default in self.param_defaults.items():54 setattr(self, param, kwargs.get(param, default))55class Sites(ContentAnalyticsModel):56 def __init__(self, *args, **kwargs):57 super().__init__()58 self.param_defaults = {59 'crawler_name': None,60 'id': None,61 'image_url': None,62 'location': None,63 'name': None,64 'results_per_page': None,65 'site_type': None,66 'traffic_upload': None,67 'url': None,68 'user_agent': None,69 'zip_code': None,70 }71 for param, default in self.param_defaults.items():72 setattr(self, param, kwargs.get(param, default))73class Brand(ContentAnalyticsModel):74 def __init__(self, *args, **kwargs):75 super().__init__()76 self.param_defaults = {77 'brand_type': None,78 'company_id': None,79 'created': None,80 'id': None,81 'name': None,82 'parent_id': None,83 }84 for param, default in self.param_defaults.items():85 setattr(self, param, kwargs.get(param, default))86class Date(ContentAnalyticsModel):87 pass88class PriceData(ContentAnalyticsModel):89 def __init__(self, *args, **kwargs):90 super().__init__()91 self.param_defaults = {92 'url': None,93 'title': None,94 'currency': None,95 'price': None,96 }97 for param, default in self.param_defaults.items():98 setattr(self, param, kwargs.get(param, default))99class RankingData(ContentAnalyticsModel):100 def __init__(self, *args, **kwargs):101 super().__init__()102 self.param_defaults = {103 'search_term': None,104 'site_id': None,105 'title': None,106 'url': None,107 'ranking': None,108 }109 for param, default in self.param_defaults.items():110 setattr(self, param, kwargs.get(param, default))111class OutOfStockData(ContentAnalyticsModel):112 def __init__(self, *args, **kwargs):113 super().__init__()114 self.param_defaults = {115 'search_term': None,116 'site_id': None,117 'title': None,118 'url': None,119 'is_out_of_stock': None,120 'no_longer_available': None,121 }122 for param, default in self.param_defaults.items():123 setattr(self, param, kwargs.get(param, default))124class BuyBoxData(ContentAnalyticsModel):125 def __init__(self, *args, **kwargs):126 super().__init__()127 self.param_defaults = {128 'search_term': None,129 'site_id': None,130 'title': None,131 'marketplace': None,132 'url': None,133 'is_out_of_stock': None,134 'no_longer_available': None,135 'first_party_owned': None,136 }137 for param, default in self.param_defaults.items():138 setattr(self, param, kwargs.get(param, default))139class ReviewsData(ContentAnalyticsModel):140 def __init__(self, *args, **kwargs):141 super().__init__()142 self.param_defaults = {143 'search_term': None,144 'site_id': None,145 'title': None,146 'total_count': None,147 'average_num': None,148 'one_star': None,149 'two_star': None,150 'three_star': None,151 'four_star': None,152 'five_star': None,153 }154 for param, default in self.param_defaults.items():...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful