-
Notifications
You must be signed in to change notification settings - Fork 0
/
Types.hs
96 lines (85 loc) · 2.94 KB
/
Types.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DuplicateRecordFields #-}
module Azure.ManagedApp.Notifications.Types.Types where
import "base" GHC.Generics (Generic)
import "base" Data.Data (Data)
import "base" Data.Typeable (Typeable)
import "text" Data.Text (Text)
import "time" Data.Time (UTCTime)
data Notification
-- https://docs.microsoft.com/en-us/azure/azure-resource-manager/managed-applications/publish-notifications#service-catalog-application-notification-schema
= ServiceCatalogNotification
{ _eventType :: !EventType
, _applicationId :: !ApplicationId
, _eventTime :: !UTCTime
, _provisioningState :: !ProvisioningState
, _applicationDefinitionId :: !ApplicationDefinitionId
, _error :: !(Maybe Error)
}
-- https://docs.microsoft.com/en-us/azure/azure-resource-manager/managed-applications/publish-notifications#azure-marketplace-application-notification-schema
| AzureMarketplaceNotification
{ _eventType :: !EventType
, _applicationId :: !ApplicationId
, _eventTime :: !UTCTime
, _provisioningState :: !ProvisioningState
, _billingDetails :: !BillingDetails
, _plan :: !Plan
, _error :: !(Maybe Error)
}
deriving (Show, Read, Eq, Ord, Data, Typeable, Generic)
-- https://docs.microsoft.com/en-us/azure/azure-resource-manager/managed-applications/publish-notifications#event-triggers
data EventType
= PUT
| PATCH
| DELETE
deriving (Show, Read, Eq, Ord, Enum, Bounded, Data, Typeable, Generic)
data ProvisioningState
= Accepted
| Succeeded
| Failed
| Deleting
| Deleted
deriving (Show, Read, Eq, Ord, Enum, Bounded, Data, Typeable, Generic)
data ApplicationId
= ApplicationId
{ _subId :: !Text
, _rgName :: !Text
, _applicationName :: !Text
}
deriving (Show, Read, Eq, Ord, Data, Typeable, Generic)
data ApplicationDefinitionId
= ApplicationDefinitionId
{ _subId :: !Text
, _rgName :: !Text
, _appDefName :: !Text
}
deriving (Show, Read, Eq, Ord, Data, Typeable, Generic)
data BillingDetails
= BillingDetails
{ _resourceUsageId :: !Text
}
deriving (Show, Read, Eq, Ord, Data, Typeable, Generic)
data Plan
= Plan
{ _publisher :: !Text
, _product :: !Text
, _name :: !Text
, _version :: !Text
}
deriving (Show, Read, Eq, Ord, Data, Typeable, Generic)
data ErrorDetail
= ErrorDetail
{ _code :: !Text
, _message :: !Text
}
deriving (Show, Read, Eq, Ord, Data, Typeable, Generic)
data Error
= Error
{ _code :: !Text
, _message :: !Text
, _details :: ![ErrorDetail]
}
deriving (Show, Read, Eq, Ord, Data, Typeable, Generic)