class Meta(AppResource.Meta): resource_name = 'search' allowed_methods = [] detail_allowed_methods = [] list_allowed_methods = ['get'] authorization = ReadOnlyAuthorization() authentication = OptionalOAuthAuthentication() slug_lookup = None
class Meta(MarketplaceResource.Meta): resource_name = 'global' authentication = OptionalOAuthAuthentication() authorization = Authorization() detail_allowed_methods = ['get'] list_allowed_methods = [] object_class = GenericObject validation = CleanedDataFormValidation(form_class=GlobalStatsForm)
class Meta(SearchResource.Meta): authorization = ReadOnlyAuthorization() authentication = OptionalOAuthAuthentication() detail_allowed_methods = [] fields = SearchResource.Meta.fields + ['id', 'cat'] list_allowed_methods = ['get'] resource_name = 'search/featured' slug_lookup = None
class Meta(MarketplaceResource.Meta): always_return_data = True authentication = OptionalOAuthAuthentication() authorization = Authorization() detail_allowed_methods = [] list_allowed_methods = ['post'] object_class = dict resource_name = 'test' validation = CleanedDataFormValidation(form_class=TestInstall)
class Meta(MarketplaceResource.Meta): always_return_data = True authentication = (SharedSecretAuthentication(), OptionalOAuthAuthentication()) authorization = Authorization() detail_allowed_methods = [] list_allowed_methods = ['post'] object_class = dict resource_name = 'install'
class Meta(MarketplaceModelResource.Meta): queryset = ReviewFlag.objects.all() resource_name = 'rating_flag' list_allowed_methods = ['post'] detail_allowed_methods = [] authentication = (SharedSecretAuthentication(), OptionalOAuthAuthentication()) authorization = Authorization() fields = ['review', 'flag', 'note', 'user']
class Meta(MarketplaceResource.Meta): resource_name = 'feedback' always_return_data = True list_allowed_methods = ['post'] detail_allowed_methods = [] authentication = OptionalOAuthAuthentication() authorization = Authorization() object_class = GenericObject include_resource_uri = False throttle = CacheThrottle(throttle_at=30)
class Meta(AppResource.Meta): resource_name = 'search' allowed_methods = [] detail_allowed_methods = [] list_allowed_methods = ['get'] authorization = ReadOnlyAuthorization() authentication = OptionalOAuthAuthentication() slug_lookup = None # Override CacheThrottle with a no-op. throttle = BaseThrottle()
class Meta(MarketplaceModelResource.Meta): queryset = FileUpload.objects.all() fields = ['valid', 'validation'] list_allowed_methods = ['post'] detail_allowed_methods = ['get'] always_return_data = True authentication = OptionalOAuthAuthentication() authorization = Authorization() resource_name = 'validation' serializer = Serializer(formats=['json'])
class Meta(MarketplaceResource.Meta): api_name = 'apps' queryset = Webapp.objects.all() # Gets overriden in dispatch. fields = ['privacy_policy'] detail_allowed_methods = ['get', 'put'] always_return_data = True authentication = OptionalOAuthAuthentication() authorization = AppOwnerAuthorization() resource_name = 'privacy' serializer = Serializer(formats=['json']) slug_lookup = 'app_slug' # Throttle users without Apps:APIUnthrottled at 10 POST requests/day. throttle = CacheThrottle(throttle_at=10, timeframe=60 * 60 * 24)
class Meta(MarketplaceResource.Meta): always_return_data = True list_allowed_methods = ['post'] detail_allowed_methods = [] authentication = OptionalOAuthAuthentication() authorization = Authorization() object_class = GenericObject include_resource_uri = False validation_form = None rename_field_map = [ ('text', 'message'), ] throttle = CacheThrottle(throttle_at=30)
class Meta(MarketplaceResource.Meta): authentication = OptionalOAuthAuthentication() authorization = AnonymousReadOnlyAuthorization( authorizer=PermissionAuthorization('ProductIcon', 'Create')) detail_allowed_methods = ['get'] fields = ['ext_url', 'ext_size', 'size'] filtering = { 'ext_url': 'exact', 'ext_size': 'exact', 'size': 'exact', } list_allowed_methods = ['get', 'post'] queryset = ProductIcon.objects.filter() resource_name = 'product/icon' validation = CleanedDataFormValidation(form_class=ProductIconForm)
class Meta: resource_name = 'search' allowed_methods = [] detail_allowed_methods = [] list_allowed_methods = ['get'] authorization = ReadOnlyAuthorization() authentication = (SharedSecretAuthentication(), OptionalOAuthAuthentication()) slug_lookup = None queryset = Webapp.objects.all() # Gets overriden in dispatch. fields = ['categories', 'description', 'device_types', 'homepage', 'id', 'name', 'payment_account', 'premium_type', 'status', 'support_email', 'support_url'] always_return_data = True serializer = Serializer(formats=['json'])
class Meta(MarketplaceModelResource.Meta): queryset = Webapp.objects.all() # Gets overriden in dispatch. fields = ['categories', 'description', 'device_types', 'homepage', 'id', 'name', 'payment_account', 'premium_type', 'status', 'support_email', 'support_url'] list_allowed_methods = ['get', 'post'] detail_allowed_methods = ['get', 'put', 'delete'] always_return_data = True authentication = (SharedSecretAuthentication(), OptionalOAuthAuthentication()) authorization = AppOwnerAuthorization() resource_name = 'app' serializer = Serializer(formats=['json']) slug_lookup = 'app_slug' # Throttle users without Apps:APIUnthrottled at 10 POST requests/day. throttle = CacheThrottle(throttle_at=10, timeframe=60 * 60 * 24)
class Meta(MarketplaceModelResource.Meta): queryset = Addon.objects.filter(type=amo.ADDON_WEBAPP) fields = [ 'categories', 'description', 'device_types', 'homepage', 'id', 'name', 'privacy_policy', 'status', 'summary', 'support_email', 'support_url' ] list_allowed_methods = ['get', 'post'] allowed_methods = ['get', 'put'] always_return_data = True authentication = OptionalOAuthAuthentication() authorization = AppOwnerAuthorization() resource_name = 'app' serializer = Serializer(formats=['json']) slug_lookup = 'app_slug' # Throttle users without Apps:APIUnthrottled at 10 POST requests/day. throttle = CacheThrottle(throttle_at=10, timeframe=60 * 60 * 24)
class Meta: # Unfortunately, the model class name for ratings is "Review". queryset = Review.objects.valid() resource_name = 'rating' list_allowed_methods = ['get', 'post'] detail_allowed_methods = ['get', 'put', 'delete'] always_return_data = True authentication = (SharedSecretAuthentication(), OptionalOAuthAuthentication()) authorization = AnonymousReadOnlyAuthorization() fields = ['rating', 'body'] filtering = { 'app': ('exact', ), 'user': ('exact', ), 'pk': ('exact', ), } ordering = ['created']