9
9
PeriodTypeYear string = "YEAR"
10
10
)
11
11
12
+ const (
13
+ SortTypeName string = "NAME"
14
+ SortTypeLastEdit string = "LAST_EDIT"
15
+ )
16
+
17
+ const (
18
+ SortOrderAsc string = "ASCENDING"
19
+ SortOrderDesc string = "DESCENDING"
20
+ )
21
+
12
22
// CEView represents a basic ccm response.
13
23
// The `data` field contains the response data.
14
24
type CCMBaseResponse struct {
@@ -56,8 +66,12 @@ type CCMReference struct {
56
66
Type string `json:"type,omitempty"`
57
67
}
58
68
69
+ // ***************************
70
+ // Cost Category (name) List
71
+ // ***************************
72
+
59
73
// CcmCostCategoriesOptions represents options for listing cost categories
60
- type CcmListCostCategoriesOptions struct {
74
+ type CCMListCostCategoriesOptions struct {
61
75
AccountIdentifier string `json:"accountIdentifier,omitempty"`
62
76
CostCategory string `json:"costCategory,omitempty"`
63
77
SearchTerm string `json:"search,omitempty"`
@@ -68,3 +82,113 @@ type CCMCostCategoryList struct {
68
82
CCMBaseResponse
69
83
Data []string `json:"data,omitempty"`
70
84
}
85
+
86
+ // ***************************
87
+ // Cost Category Details List
88
+ // ***************************
89
+
90
+ type CCMPaginationOptions struct {
91
+ Limit int32 `json:"limit,omitempty"`
92
+ Offset int32 `json:"offset,omitempty"`
93
+ }
94
+
95
+ type CCMListCostCategoriesDetailOptions struct {
96
+ AccountIdentifier string `json:"accountIdentifier,omitempty"`
97
+ SearchKey string `json:"searchKey,omitempty"`
98
+ SortType string `json:"sortType,omitempty"` // Enum: "NAME", "LAST_EDIT"
99
+ SortOrder string `json:"sortOrder,omitempty"` // Enum: "ASCENDING", "DESCENDING"
100
+ CCMPaginationOptions
101
+ }
102
+
103
+ type CCMCostCategoryDetailList struct {
104
+ MetaData map [string ]interface {} `json:"metaData"`
105
+ Resource CCMCostCategoryResource `json:"resource"`
106
+ ResponseMessages []CCMResponseMessage `json:"responseMessages"`
107
+ }
108
+
109
+ type CCMCostCategoryResource struct {
110
+ BusinessMappings []CCMBusinessMapping `json:"businessMappings"`
111
+ TotalCount int `json:"totalCount"`
112
+ }
113
+
114
+ type CCMBusinessMapping struct {
115
+ UUID string `json:"uuid"`
116
+ Name string `json:"name"`
117
+ AccountID string `json:"accountId"`
118
+ CostTargets []CCMCostTarget `json:"costTargets"`
119
+ SharedCosts []CCMSharedCost `json:"sharedCosts"`
120
+ UnallocatedCost CCMUnallocatedCost `json:"unallocatedCost"`
121
+ DataSources []string `json:"dataSources"`
122
+ CreatedAt int64 `json:"createdAt"`
123
+ LastUpdatedAt int64 `json:"lastUpdatedAt"`
124
+ CreatedBy CCMUser `json:"createdBy"`
125
+ LastUpdatedBy CCMUser `json:"lastUpdatedBy"`
126
+ }
127
+
128
+ type CCMCostTarget struct {
129
+ Name string `json:"name"`
130
+ Rules []CCMRule `json:"rules"`
131
+ }
132
+
133
+ type CCMSharedCost struct {
134
+ Name string `json:"name"`
135
+ Rules []CCMRule `json:"rules"`
136
+ Strategy string `json:"strategy"`
137
+ Splits []CCMSplit `json:"splits"`
138
+ }
139
+
140
+ type CCMUnallocatedCost struct {
141
+ Strategy string `json:"strategy"`
142
+ Label string `json:"label"`
143
+ SharingStrategy string `json:"sharingStrategy"`
144
+ Splits []CCMSplit `json:"splits"`
145
+ }
146
+
147
+ type CCMSplit struct {
148
+ CostTargetName * string `json:"costTargetName"`
149
+ PercentageContribution * float64 `json:"percentageContribution"`
150
+ }
151
+
152
+ type CCMRule struct {
153
+ ViewConditions []interface {} `json:"viewConditions"`
154
+ }
155
+
156
+ type CCMUser struct {
157
+ UUID string `json:"uuid"`
158
+ Name string `json:"name"`
159
+ Email string `json:"email"`
160
+ ExternalUserID string `json:"externalUserId"`
161
+ }
162
+
163
+ type CCMResponseMessage struct {
164
+ Code string `json:"code"`
165
+ Level string `json:"level"`
166
+ Message string `json:"message"`
167
+ Exception * CCMException `json:"exception"`
168
+ FailureTypes []string `json:"failureTypes"`
169
+ AdditionalInfo map [string ]string `json:"additionalInfo"`
170
+ }
171
+
172
+ type CCMException struct {
173
+ StackTrace []CCMStackTraceElement `json:"stackTrace"`
174
+ Message string `json:"message"`
175
+ Suppressed []CCMSuppressed `json:"suppressed"`
176
+ LocalizedMessage string `json:"localizedMessage"`
177
+ }
178
+
179
+ type CCMStackTraceElement struct {
180
+ ClassLoaderName * string `json:"classLoaderName"`
181
+ ModuleName * string `json:"moduleName"`
182
+ ModuleVersion * string `json:"moduleVersion"`
183
+ MethodName * string `json:"methodName"`
184
+ FileName * string `json:"fileName"`
185
+ LineNumber * int `json:"lineNumber"`
186
+ NativeMethod * bool `json:"nativeMethod"`
187
+ ClassName * string `json:"className"`
188
+ }
189
+
190
+ type CCMSuppressed struct {
191
+ StackTrace []CCMStackTraceElement `json:"stackTrace"`
192
+ Message string `json:"message"`
193
+ LocalizedMessage string `json:"localizedMessage"`
194
+ }
0 commit comments