custom_cost_response.go 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. package model
  2. import "github.com/opencost/opencost/core/pkg/opencost"
  3. type CustomCostResponse struct {
  4. Metadata map[string]string
  5. Costsource string
  6. Domain string
  7. Version string
  8. Currency string
  9. Window opencost.Window
  10. Costs []*CustomCost
  11. Errors []error
  12. }
  13. type CustomCost struct {
  14. Metadata map[string]string
  15. Zone string
  16. BilledCost float32
  17. AccountName string
  18. ChargeCategory string
  19. Description string
  20. ListCost float32
  21. ListUnitPrice float32
  22. ResourceName string
  23. ResourceType string
  24. Id string
  25. ProviderId string
  26. Window *opencost.Window
  27. Labels map[string]string
  28. UsageQty float32
  29. UsageUnit string
  30. ExtendedAttributes *ExtendedCustomCostAttributes
  31. }
  32. type ExtendedCustomCostAttributes struct {
  33. BillingPeriod *opencost.Window
  34. AccountID string
  35. ChargeFrequency string
  36. Subcategory string
  37. CommitmentDiscountCategory string
  38. CommitmentDiscountID string
  39. CommitmentDiscountName string
  40. CommitmentDiscountType string
  41. EffectiveCost float32
  42. InvoiceIssuer string
  43. Provider string
  44. Publisher string
  45. ServiceCategory string
  46. ServiceName string
  47. SkuID string
  48. SkuPriceID string
  49. SubAccountID string
  50. SubAccountName string
  51. PricingQuantity float32
  52. PricingUnit string
  53. PricingCategory string
  54. }
  55. func (e *ExtendedCustomCostAttributes) GetBillingPeriod() *opencost.Window {
  56. return e.BillingPeriod
  57. }
  58. func (e *ExtendedCustomCostAttributes) GetAccountID() string {
  59. return e.AccountID
  60. }
  61. func (e *ExtendedCustomCostAttributes) GetChargeFrequency() string {
  62. return e.ChargeFrequency
  63. }
  64. func (e *ExtendedCustomCostAttributes) GetSubcategory() string {
  65. return e.Subcategory
  66. }
  67. func (e *ExtendedCustomCostAttributes) GetCommitmentDiscountCategory() string {
  68. return e.CommitmentDiscountCategory
  69. }
  70. func (e *ExtendedCustomCostAttributes) GetCommitmentDiscountID() string {
  71. return e.CommitmentDiscountID
  72. }
  73. func (e *ExtendedCustomCostAttributes) GetCommitmentDiscountName() string {
  74. return e.CommitmentDiscountName
  75. }
  76. func (e *ExtendedCustomCostAttributes) GetCommitmentDiscountType() string {
  77. return e.CommitmentDiscountType
  78. }
  79. func (e *ExtendedCustomCostAttributes) GetEffectiveCost() float32 {
  80. return e.EffectiveCost
  81. }
  82. func (e *ExtendedCustomCostAttributes) GetInvoiceIssuer() string {
  83. return e.InvoiceIssuer
  84. }
  85. func (e *ExtendedCustomCostAttributes) GetProvider() string {
  86. return e.Provider
  87. }
  88. func (e *ExtendedCustomCostAttributes) GetPublisher() string {
  89. return e.Publisher
  90. }
  91. func (e *ExtendedCustomCostAttributes) GetServiceCategory() string {
  92. return e.ServiceCategory
  93. }
  94. func (e *ExtendedCustomCostAttributes) GetServiceName() string {
  95. return e.ServiceName
  96. }
  97. func (e *ExtendedCustomCostAttributes) GetSKUID() string {
  98. return e.SkuID
  99. }
  100. func (e *ExtendedCustomCostAttributes) GetSKUPriceID() string {
  101. return e.SkuPriceID
  102. }
  103. func (e *ExtendedCustomCostAttributes) GetSubAccountID() string {
  104. return e.SubAccountID
  105. }
  106. func (e *ExtendedCustomCostAttributes) GetSubAccountName() string {
  107. return e.SubAccountName
  108. }
  109. func (e *ExtendedCustomCostAttributes) GetPricingQuantity() float32 {
  110. return e.PricingQuantity
  111. }
  112. func (e *ExtendedCustomCostAttributes) GetPricingUnit() string {
  113. return e.PricingUnit
  114. }
  115. func (e *ExtendedCustomCostAttributes) GetPricingCategory() string {
  116. return e.PricingCategory
  117. }
  118. func (d *CustomCost) GetMetadata() map[string]string {
  119. return d.Metadata
  120. }
  121. func (d *CustomCost) GetCostIncurredZone() string {
  122. return d.Zone
  123. }
  124. func (d *CustomCost) GetBilledCost() float32 {
  125. return d.BilledCost
  126. }
  127. func (d *CustomCost) GetAccountName() string {
  128. return d.AccountName
  129. }
  130. func (d *CustomCost) GetChargeCategory() string {
  131. return d.ChargeCategory
  132. }
  133. func (d *CustomCost) GetDescription() string {
  134. return d.Description
  135. }
  136. func (d *CustomCost) GetListCost() float32 {
  137. return d.ListCost
  138. }
  139. func (d *CustomCost) GetListUnitPrice() float32 {
  140. return d.ListUnitPrice
  141. }
  142. func (d *CustomCost) GetResourceName() string {
  143. return d.ResourceName
  144. }
  145. func (d *CustomCost) GetID() string {
  146. return d.Id
  147. }
  148. func (d *CustomCost) GetProviderID() string {
  149. return d.ProviderId
  150. }
  151. func (d *CustomCost) GetWindow() *opencost.Window {
  152. return d.Window
  153. }
  154. func (d *CustomCost) GetLabels() map[string]string {
  155. return d.Labels
  156. }
  157. func (d *CustomCost) GetUsageQuantity() float32 {
  158. return d.UsageQty
  159. }
  160. func (d *CustomCost) GetUsageUnit() string {
  161. return d.UsageUnit
  162. }
  163. func (d *CustomCost) GetExtendedAttributes() *ExtendedCustomCostAttributes {
  164. return d.ExtendedAttributes
  165. }
  166. func (d *CustomCost) GetResourceType() string {
  167. return d.ResourceType
  168. }
  169. func (d *CustomCostResponse) GetMetadata() map[string]string {
  170. return d.Metadata
  171. }
  172. func (d *CustomCostResponse) GetCostSource() string {
  173. return d.Costsource
  174. }
  175. func (d *CustomCostResponse) GetDomain() string {
  176. return d.Domain
  177. }
  178. func (d *CustomCostResponse) GetVersion() string {
  179. return d.Version
  180. }
  181. func (d *CustomCostResponse) GetCurrency() string {
  182. return d.Currency
  183. }
  184. func (d *CustomCostResponse) GetWindow() opencost.Window {
  185. return d.Window
  186. }
  187. func (d *CustomCostResponse) GetCosts() []*CustomCost {
  188. return d.Costs
  189. }
  190. func (d *CustomCostResponse) GetErrors() []error {
  191. return d.Errors
  192. }