1 # Copyright (C) 2010-2011 Richard Lincoln
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to
5 # deal in the Software without restriction, including without limitation the
6 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 # sell copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 from CIM15
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
23 class ServiceCategory(IdentifiedObject
):
24 """Category of service provided to the customer.Category of service provided to the customer.
27 def __init__(self
, kind
="other", PricingStructures
=None, ServiceDeliveryPoints
=None, *args
, **kw_args
):
28 """Initialises a new 'ServiceCategory' instance.
30 @param kind: Kind of service. Values are: "other", "refuse", "sewerage", "electricity", "heat", "internet", "rates", "time", "water", "gas", "tvLicence"
31 @param PricingStructures: All pricing structures applicable to this service category.
32 @param ServiceDeliveryPoints: All service delivery points that deliver this category of service.
34 #: Kind of service. Values are: "other", "refuse", "sewerage", "electricity", "heat", "internet", "rates", "time", "water", "gas", "tvLicence"
37 self
._PricingStructures
= []
38 self
.PricingStructures
= [] if PricingStructures
is None else PricingStructures
40 self
._ServiceDeliveryPoints
= []
41 self
.ServiceDeliveryPoints
= [] if ServiceDeliveryPoints
is None else ServiceDeliveryPoints
43 super(ServiceCategory
, self
).__init
__(*args
, **kw_args
)
46 _attr_types
= {"kind": str}
47 _defaults
= {"kind": "other"}
48 _enums
= {"kind": "ServiceKind"}
49 _refs
= ["PricingStructures", "ServiceDeliveryPoints"]
50 _many_refs
= ["PricingStructures", "ServiceDeliveryPoints"]
52 def getPricingStructures(self
):
53 """All pricing structures applicable to this service category.
55 return self
._PricingStructures
57 def setPricingStructures(self
, value
):
58 for x
in self
._PricingStructures
:
59 x
.ServiceCategory
= None
61 y
._ServiceCategory
= self
62 self
._PricingStructures
= value
64 PricingStructures
= property(getPricingStructures
, setPricingStructures
)
66 def addPricingStructures(self
, *PricingStructures
):
67 for obj
in PricingStructures
:
68 obj
.ServiceCategory
= self
70 def removePricingStructures(self
, *PricingStructures
):
71 for obj
in PricingStructures
:
72 obj
.ServiceCategory
= None
74 def getServiceDeliveryPoints(self
):
75 """All service delivery points that deliver this category of service.
77 return self
._ServiceDeliveryPoints
79 def setServiceDeliveryPoints(self
, value
):
80 for x
in self
._ServiceDeliveryPoints
:
81 x
.ServiceCategory
= None
83 y
._ServiceCategory
= self
84 self
._ServiceDeliveryPoints
= value
86 ServiceDeliveryPoints
= property(getServiceDeliveryPoints
, setServiceDeliveryPoints
)
88 def addServiceDeliveryPoints(self
, *ServiceDeliveryPoints
):
89 for obj
in ServiceDeliveryPoints
:
90 obj
.ServiceCategory
= self
92 def removeServiceDeliveryPoints(self
, *ServiceDeliveryPoints
):
93 for obj
in ServiceDeliveryPoints
:
94 obj
.ServiceCategory
= None