File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed
Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -502,7 +502,7 @@ def make_object(self, data):
502502class TierAccountsSchema (Schema ):
503503 customer = fields .Nested (TierAccountSchema )
504504 tier1 = fields .Nested (TierAccountSchema )
505- tier2 = fields .Nested (TierAccountSchema )
505+ tier2 = fields .Nested (TierAccountSchema , allow_none = True )
506506
507507 @post_load
508508 def make_object (self , data ):
Original file line number Diff line number Diff line change 33# This file is part of the Ingram Micro Cloud Blue Connect SDK.
44# Copyright (c) 2019 Ingram Micro. All Rights Reserved.
55
6+ from typing import Optional
7+
68from .base import BaseModel
79from .tier_account import TierAccount
810from .schemas import TierAccountsSchema
@@ -19,5 +21,5 @@ class TierAccounts(BaseModel):
1921 tier1 = None # type: TierAccount
2022 """ (:py:class:`.TierAccount`) Level 1 TierAccount Object. """
2123
22- tier2 = None # type: TierAccount
23- """ (:py:class:`.TierAccount`) Level 2 TierAccount Object. """
24+ tier2 = None # type: Optional[ TierAccount]
25+ """ (:py:class:`.TierAccount` | None ) Level 2 TierAccount Object. """
Original file line number Diff line number Diff line change @@ -36,6 +36,31 @@ class TierConfigAutomation(AutomationEngine):
3636 resource = 'tier/config-requests'
3737 model_class = TierConfigRequest
3838
39+ def filters (self , status = 'pending' , ** kwargs ):
40+ """ Returns the default set of filters for Tier Config request, plus any others that you
41+ might specify. The allowed filters are:
42+
43+ - type
44+ - status
45+ - id
46+ - configuration__id
47+ - configuration__tier_level
48+ - configuration__account__id
49+ - configuration__product__id
50+ - assignee__id
51+ - unassigned (bool)
52+ - configuration__account__external_uid
53+
54+ :param str status: Status of the requests. Default: ``'pending'``.
55+ :param dict[str,Any] kwargs: Additional filters to add to the default ones.
56+ :return: The set of filters for this resource.
57+ :rtype: dict[str,Any]
58+ """
59+ filters = super (TierConfigAutomation , self ).filters (status = status , ** kwargs )
60+ if self .config .products :
61+ filters ['configuration__product__id' ] = ',' .join (self .config .products )
62+ return filters
63+
3964 @function_log
4065 def dispatch (self , request ):
4166 # type: (TierConfigRequest) -> str
You can’t perform that action at this time.
0 commit comments