azure_mgmt_cost_management 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2018-05-31/generated/azure_mgmt_cost_management.rb +63 -0
  4. data/lib/2018-05-31/generated/azure_mgmt_cost_management/billing_account_dimensions.rb +149 -0
  5. data/lib/2018-05-31/generated/azure_mgmt_cost_management/cost_management_client.rb +455 -0
  6. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/dimension.rb +154 -0
  7. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/dimensions_list_result.rb +56 -0
  8. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/error_details.rb +59 -0
  9. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/error_response.rb +48 -0
  10. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/format_type.rb +15 -0
  11. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/granularity_type.rb +15 -0
  12. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/operation.rb +59 -0
  13. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/operation_display.rb +72 -0
  14. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/operation_list_result.rb +103 -0
  15. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/query.rb +138 -0
  16. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/query_column.rb +58 -0
  17. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/query_result.rb +57 -0
  18. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/recurrence_type.rb +18 -0
  19. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config.rb +130 -0
  20. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_aggregation.rb +60 -0
  21. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_column_type.rb +16 -0
  22. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_comparison_expression.rb +82 -0
  23. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_dataset.rb +121 -0
  24. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_dataset_configuration.rb +56 -0
  25. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_definition.rb +87 -0
  26. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_delivery_destination.rb +71 -0
  27. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_delivery_info.rb +48 -0
  28. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_filter.rb +121 -0
  29. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_grouping.rb +58 -0
  30. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_list_result.rb +57 -0
  31. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_recurrence_period.rb +58 -0
  32. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_schedule.rb +74 -0
  33. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/report_config_time_period.rb +57 -0
  34. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/resource.rb +100 -0
  35. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/status_type.rb +16 -0
  36. data/lib/2018-05-31/generated/azure_mgmt_cost_management/models/timeframe_type.rb +18 -0
  37. data/lib/2018-05-31/generated/azure_mgmt_cost_management/module_definition.rb +9 -0
  38. data/lib/2018-05-31/generated/azure_mgmt_cost_management/operations.rb +219 -0
  39. data/lib/2018-05-31/generated/azure_mgmt_cost_management/report_config_operations.rb +794 -0
  40. data/lib/2018-05-31/generated/azure_mgmt_cost_management/resource_group_dimensions.rb +150 -0
  41. data/lib/2018-05-31/generated/azure_mgmt_cost_management/subscription_dimensions.rb +146 -0
  42. data/lib/2019-01-01/generated/azure_mgmt_cost_management.rb +69 -0
  43. data/lib/2019-01-01/generated/azure_mgmt_cost_management/cost_management_client.rb +144 -0
  44. data/lib/2019-01-01/generated/azure_mgmt_cost_management/dimensions.rb +182 -0
  45. data/lib/2019-01-01/generated/azure_mgmt_cost_management/exports.rb +754 -0
  46. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/common_export_properties.rb +72 -0
  47. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/dimension.rb +187 -0
  48. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/dimensions_list_result.rb +56 -0
  49. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/error_details.rb +59 -0
  50. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/error_response.rb +48 -0
  51. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/execution_status.rb +21 -0
  52. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/execution_type.rb +16 -0
  53. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export.rb +128 -0
  54. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_delivery_destination.rb +78 -0
  55. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_delivery_info.rb +48 -0
  56. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_execution.rb +173 -0
  57. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_execution_list_result.rb +56 -0
  58. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_list_result.rb +57 -0
  59. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_recurrence_period.rb +57 -0
  60. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/export_schedule.rb +74 -0
  61. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/format_type.rb +15 -0
  62. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/granularity_type.rb +16 -0
  63. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/operation.rb +59 -0
  64. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/operation_display.rb +72 -0
  65. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/operation_list_result.rb +103 -0
  66. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query.rb +138 -0
  67. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_aggregation.rb +60 -0
  68. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_column.rb +58 -0
  69. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_column_type.rb +16 -0
  70. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_comparison_expression.rb +82 -0
  71. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_dataset.rb +141 -0
  72. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_dataset_configuration.rb +56 -0
  73. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_definition.rb +88 -0
  74. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_filter.rb +120 -0
  75. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_grouping.rb +58 -0
  76. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_result.rb +57 -0
  77. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_sorting_configuration.rb +58 -0
  78. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/query_time_period.rb +57 -0
  79. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/recurrence_type.rb +18 -0
  80. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/resource.rb +100 -0
  81. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/sort_direction.rb +16 -0
  82. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/status_type.rb +16 -0
  83. data/lib/2019-01-01/generated/azure_mgmt_cost_management/models/timeframe_type.rb +23 -0
  84. data/lib/2019-01-01/generated/azure_mgmt_cost_management/module_definition.rb +9 -0
  85. data/lib/2019-01-01/generated/azure_mgmt_cost_management/operations.rb +219 -0
  86. data/lib/2019-01-01/generated/azure_mgmt_cost_management/query_operations.rb +161 -0
  87. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management.rb +82 -0
  88. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/cloud_connector.rb +492 -0
  89. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/cost_management_client.rb +164 -0
  90. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/dimensions.rb +775 -0
  91. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/external_billing_account.rb +207 -0
  92. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/external_subscription.rb +482 -0
  93. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/forecast.rb +755 -0
  94. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/connector_billing_model.rb +18 -0
  95. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/connector_collection_error_info.rb +84 -0
  96. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/connector_collection_info.rb +86 -0
  97. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/connector_definition.rb +261 -0
  98. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/connector_definition_list_result.rb +57 -0
  99. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/connector_status.rb +18 -0
  100. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/cost_allocation_details_kind.rb +131 -0
  101. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/cost_allocation_policy.rb +17 -0
  102. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/custom_price_details_kind.rb +169 -0
  103. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/dimension.rb +187 -0
  104. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/dimensions_list_result.rb +56 -0
  105. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/error_base.rb +72 -0
  106. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/error_details.rb +91 -0
  107. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/error_response.rb +48 -0
  108. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/external_billing_account_definition.rb +133 -0
  109. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/external_billing_account_definition_list_result.rb +59 -0
  110. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/external_subscription_definition.rb +157 -0
  111. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/external_subscription_definition_list_result.rb +58 -0
  112. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/external_subscription_id_list_request.rb +54 -0
  113. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/function_type.rb +18 -0
  114. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/granularity_type.rb +16 -0
  115. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/markup.rb +46 -0
  116. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/operation.rb +59 -0
  117. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/operation_display.rb +72 -0
  118. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/operation_list_result.rb +103 -0
  119. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/operator_type.rb +16 -0
  120. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/query.rb +138 -0
  121. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/query_column.rb +58 -0
  122. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/query_result.rb +57 -0
  123. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_aggregation.rb +60 -0
  124. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_column_type.rb +16 -0
  125. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_comparison_expression.rb +80 -0
  126. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_dataset.rb +142 -0
  127. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_dataset_configuration.rb +56 -0
  128. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_definition.rb +90 -0
  129. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_filter.rb +121 -0
  130. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_grouping.rb +59 -0
  131. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_sorting.rb +58 -0
  132. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/report_config_time_period.rb +57 -0
  133. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/resource.rb +100 -0
  134. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/scope.rb +80 -0
  135. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/showback_rule.rb +173 -0
  136. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/showback_rule_list_result.rb +57 -0
  137. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/showback_rule_properties.rb +138 -0
  138. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/showback_rule_status.rb +16 -0
  139. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/models/timeframe_type.rb +18 -0
  140. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/module_definition.rb +9 -0
  141. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/operations.rb +219 -0
  142. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/query_operations.rb +649 -0
  143. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/showback_rule_operations.rb +222 -0
  144. data/lib/2019-03-01-preview/generated/azure_mgmt_cost_management/showback_rules.rb +114 -0
  145. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management.rb +69 -0
  146. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/budget.rb +460 -0
  147. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/budgets.rb +285 -0
  148. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/cost_management_client.rb +144 -0
  149. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/accumulated_type.rb +16 -0
  150. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/budget_model.rb +170 -0
  151. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/budget_time_period.rb +58 -0
  152. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/budgets_list_result.rb +101 -0
  153. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/category_type.rb +16 -0
  154. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/chart_type.rb +19 -0
  155. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/current_spend.rb +59 -0
  156. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/error_base.rb +72 -0
  157. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/error_details.rb +91 -0
  158. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/error_response.rb +48 -0
  159. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/granularity_type.rb +16 -0
  160. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/kpi_properties.rb +69 -0
  161. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/kpi_type_type.rb +16 -0
  162. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/metric_type.rb +17 -0
  163. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/notification.rb +139 -0
  164. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/notification_operator_type.rb +17 -0
  165. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/operation.rb +59 -0
  166. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/operation_display.rb +72 -0
  167. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/operation_list_result.rb +103 -0
  168. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/operator_type.rb +16 -0
  169. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/pivot_properties.rb +58 -0
  170. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/pivot_type_type.rb +16 -0
  171. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/proxy_resource.rb +84 -0
  172. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_aggregation.rb +60 -0
  173. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_column_type.rb +16 -0
  174. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_comparison_expression.rb +80 -0
  175. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_dataset.rb +142 -0
  176. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_dataset_configuration.rb +56 -0
  177. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_filter.rb +121 -0
  178. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_grouping.rb +59 -0
  179. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_sorting.rb +58 -0
  180. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_time_period.rb +57 -0
  181. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/resource.rb +100 -0
  182. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/scope.rb +80 -0
  183. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/time_grain_type.rb +17 -0
  184. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/timeframe_type.rb +18 -0
  185. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/view.rb +269 -0
  186. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/models/view_list_result.rb +100 -0
  187. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/module_definition.rb +9 -0
  188. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/operations.rb +219 -0
  189. data/lib/2019-04-01-preview/generated/azure_mgmt_cost_management/views.rb +1248 -0
  190. data/lib/azure_mgmt_cost_management.rb +9 -0
  191. data/lib/module_definition.rb +7 -0
  192. data/lib/profiles/latest/costmanagement_latest_profile_client.rb +40 -0
  193. data/lib/profiles/latest/costmanagement_module_definition.rb +8 -0
  194. data/lib/profiles/latest/modules/costmanagement_profile_module.rb +219 -0
  195. data/lib/version.rb +7 -0
  196. metadata +311 -0
@@ -0,0 +1,755 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CostManagement::Mgmt::V2019_03_01_preview
7
+ #
8
+ # Forecast
9
+ #
10
+ class Forecast
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Forecast class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [CostManagementClient] reference to the CostManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Forecast the usage data for subscriptionId.
26
+ #
27
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
28
+ # CreateOrUpdate Report Config operation.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [QueryResult] operation results.
33
+ #
34
+ def usage_by_subscription(parameters, custom_headers:nil)
35
+ response = usage_by_subscription_async(parameters, custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Forecast the usage data for subscriptionId.
41
+ #
42
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
43
+ # CreateOrUpdate Report Config operation.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def usage_by_subscription_with_http_info(parameters, custom_headers:nil)
50
+ usage_by_subscription_async(parameters, custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Forecast the usage data for subscriptionId.
55
+ #
56
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
57
+ # CreateOrUpdate Report Config operation.
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def usage_by_subscription_async(parameters, custom_headers:nil)
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
66
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
67
+
68
+
69
+ request_headers = {}
70
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
71
+
72
+ # Set Headers
73
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
74
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
75
+
76
+ # Serialize Request
77
+ request_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::ReportConfigDefinition.mapper()
78
+ request_content = @client.serialize(request_mapper, parameters)
79
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
80
+
81
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Forecast'
82
+
83
+ request_url = @base_url || @client.base_url
84
+
85
+ options = {
86
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
87
+ path_params: {'subscriptionId' => @client.subscription_id},
88
+ query_params: {'api-version' => @client.api_version},
89
+ body: request_content,
90
+ headers: request_headers.merge(custom_headers || {}),
91
+ base_url: request_url
92
+ }
93
+ promise = @client.make_request_async(:post, path_template, options)
94
+
95
+ promise = promise.then do |result|
96
+ http_response = result.response
97
+ status_code = http_response.status
98
+ response_content = http_response.body
99
+ unless status_code == 200
100
+ error_model = JSON.load(response_content)
101
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
102
+ end
103
+
104
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
105
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
106
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
107
+ # Deserialize Response
108
+ if status_code == 200
109
+ begin
110
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
111
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::QueryResult.mapper()
112
+ result.body = @client.deserialize(result_mapper, parsed_response)
113
+ rescue Exception => e
114
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
115
+ end
116
+ end
117
+
118
+ result
119
+ end
120
+
121
+ promise.execute
122
+ end
123
+
124
+ #
125
+ # Forecast the usage data for subscriptionId and resource group.
126
+ #
127
+ # @param resource_group_name [String] Azure Resource Group Name.
128
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
129
+ # CreateOrUpdate Report Config operation.
130
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
131
+ # will be added to the HTTP request.
132
+ #
133
+ # @return [QueryResult] operation results.
134
+ #
135
+ def usage_by_resource_group(resource_group_name, parameters, custom_headers:nil)
136
+ response = usage_by_resource_group_async(resource_group_name, parameters, custom_headers:custom_headers).value!
137
+ response.body unless response.nil?
138
+ end
139
+
140
+ #
141
+ # Forecast the usage data for subscriptionId and resource group.
142
+ #
143
+ # @param resource_group_name [String] Azure Resource Group Name.
144
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
145
+ # CreateOrUpdate Report Config operation.
146
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
+ # will be added to the HTTP request.
148
+ #
149
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
150
+ #
151
+ def usage_by_resource_group_with_http_info(resource_group_name, parameters, custom_headers:nil)
152
+ usage_by_resource_group_async(resource_group_name, parameters, custom_headers:custom_headers).value!
153
+ end
154
+
155
+ #
156
+ # Forecast the usage data for subscriptionId and resource group.
157
+ #
158
+ # @param resource_group_name [String] Azure Resource Group Name.
159
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
160
+ # CreateOrUpdate Report Config operation.
161
+ # @param [Hash{String => String}] A hash of custom headers that will be added
162
+ # to the HTTP request.
163
+ #
164
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
165
+ #
166
+ def usage_by_resource_group_async(resource_group_name, parameters, custom_headers:nil)
167
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
168
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
169
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
170
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
171
+
172
+
173
+ request_headers = {}
174
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
175
+
176
+ # Set Headers
177
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
178
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
179
+
180
+ # Serialize Request
181
+ request_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::ReportConfigDefinition.mapper()
182
+ request_content = @client.serialize(request_mapper, parameters)
183
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
184
+
185
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Forecast'
186
+
187
+ request_url = @base_url || @client.base_url
188
+
189
+ options = {
190
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
191
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
192
+ query_params: {'api-version' => @client.api_version},
193
+ body: request_content,
194
+ headers: request_headers.merge(custom_headers || {}),
195
+ base_url: request_url
196
+ }
197
+ promise = @client.make_request_async(:post, path_template, options)
198
+
199
+ promise = promise.then do |result|
200
+ http_response = result.response
201
+ status_code = http_response.status
202
+ response_content = http_response.body
203
+ unless status_code == 200
204
+ error_model = JSON.load(response_content)
205
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
206
+ end
207
+
208
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
209
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
210
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
211
+ # Deserialize Response
212
+ if status_code == 200
213
+ begin
214
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
215
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::QueryResult.mapper()
216
+ result.body = @client.deserialize(result_mapper, parsed_response)
217
+ rescue Exception => e
218
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
219
+ end
220
+ end
221
+
222
+ result
223
+ end
224
+
225
+ promise.execute
226
+ end
227
+
228
+ #
229
+ # Forecast the usage data for billing account.
230
+ #
231
+ # @param billing_account_id [String] BillingAccount ID
232
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
233
+ # CreateOrUpdate Report Config operation.
234
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
235
+ # will be added to the HTTP request.
236
+ #
237
+ # @return [QueryResult] operation results.
238
+ #
239
+ def usage_by_billing_account(billing_account_id, parameters, custom_headers:nil)
240
+ response = usage_by_billing_account_async(billing_account_id, parameters, custom_headers:custom_headers).value!
241
+ response.body unless response.nil?
242
+ end
243
+
244
+ #
245
+ # Forecast the usage data for billing account.
246
+ #
247
+ # @param billing_account_id [String] BillingAccount ID
248
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
249
+ # CreateOrUpdate Report Config operation.
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
254
+ #
255
+ def usage_by_billing_account_with_http_info(billing_account_id, parameters, custom_headers:nil)
256
+ usage_by_billing_account_async(billing_account_id, parameters, custom_headers:custom_headers).value!
257
+ end
258
+
259
+ #
260
+ # Forecast the usage data for billing account.
261
+ #
262
+ # @param billing_account_id [String] BillingAccount ID
263
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
264
+ # CreateOrUpdate Report Config operation.
265
+ # @param [Hash{String => String}] A hash of custom headers that will be added
266
+ # to the HTTP request.
267
+ #
268
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
269
+ #
270
+ def usage_by_billing_account_async(billing_account_id, parameters, custom_headers:nil)
271
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
272
+ fail ArgumentError, 'billing_account_id is nil' if billing_account_id.nil?
273
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
274
+
275
+
276
+ request_headers = {}
277
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
278
+
279
+ # Set Headers
280
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
281
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
282
+
283
+ # Serialize Request
284
+ request_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::ReportConfigDefinition.mapper()
285
+ request_content = @client.serialize(request_mapper, parameters)
286
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
287
+
288
+ path_template = 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Forecast'
289
+
290
+ request_url = @base_url || @client.base_url
291
+
292
+ options = {
293
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
294
+ path_params: {'billingAccountId' => billing_account_id},
295
+ query_params: {'api-version' => @client.api_version},
296
+ body: request_content,
297
+ headers: request_headers.merge(custom_headers || {}),
298
+ base_url: request_url
299
+ }
300
+ promise = @client.make_request_async(:post, path_template, options)
301
+
302
+ promise = promise.then do |result|
303
+ http_response = result.response
304
+ status_code = http_response.status
305
+ response_content = http_response.body
306
+ unless status_code == 200
307
+ error_model = JSON.load(response_content)
308
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
309
+ end
310
+
311
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
312
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
313
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
314
+ # Deserialize Response
315
+ if status_code == 200
316
+ begin
317
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
318
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::QueryResult.mapper()
319
+ result.body = @client.deserialize(result_mapper, parsed_response)
320
+ rescue Exception => e
321
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
322
+ end
323
+ end
324
+
325
+ result
326
+ end
327
+
328
+ promise.execute
329
+ end
330
+
331
+ #
332
+ # Forecast the usage data for an enrollment account.
333
+ #
334
+ # @param billing_account_id [String] BillingAccount ID
335
+ # @param enrollment_account_id [String] Enrollment Account ID
336
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
337
+ # CreateOrUpdate Report Config operation.
338
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
339
+ # will be added to the HTTP request.
340
+ #
341
+ # @return [QueryResult] operation results.
342
+ #
343
+ def usage_by_enrollment_account(billing_account_id, enrollment_account_id, parameters, custom_headers:nil)
344
+ response = usage_by_enrollment_account_async(billing_account_id, enrollment_account_id, parameters, custom_headers:custom_headers).value!
345
+ response.body unless response.nil?
346
+ end
347
+
348
+ #
349
+ # Forecast the usage data for an enrollment account.
350
+ #
351
+ # @param billing_account_id [String] BillingAccount ID
352
+ # @param enrollment_account_id [String] Enrollment Account ID
353
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
354
+ # CreateOrUpdate Report Config operation.
355
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
356
+ # will be added to the HTTP request.
357
+ #
358
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
359
+ #
360
+ def usage_by_enrollment_account_with_http_info(billing_account_id, enrollment_account_id, parameters, custom_headers:nil)
361
+ usage_by_enrollment_account_async(billing_account_id, enrollment_account_id, parameters, custom_headers:custom_headers).value!
362
+ end
363
+
364
+ #
365
+ # Forecast the usage data for an enrollment account.
366
+ #
367
+ # @param billing_account_id [String] BillingAccount ID
368
+ # @param enrollment_account_id [String] Enrollment Account ID
369
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
370
+ # CreateOrUpdate Report Config operation.
371
+ # @param [Hash{String => String}] A hash of custom headers that will be added
372
+ # to the HTTP request.
373
+ #
374
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
375
+ #
376
+ def usage_by_enrollment_account_async(billing_account_id, enrollment_account_id, parameters, custom_headers:nil)
377
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
378
+ fail ArgumentError, 'billing_account_id is nil' if billing_account_id.nil?
379
+ fail ArgumentError, 'enrollment_account_id is nil' if enrollment_account_id.nil?
380
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
381
+
382
+
383
+ request_headers = {}
384
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
385
+
386
+ # Set Headers
387
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
388
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
389
+
390
+ # Serialize Request
391
+ request_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::ReportConfigDefinition.mapper()
392
+ request_content = @client.serialize(request_mapper, parameters)
393
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
394
+
395
+ path_template = 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/Forecast'
396
+
397
+ request_url = @base_url || @client.base_url
398
+
399
+ options = {
400
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
401
+ path_params: {'billingAccountId' => billing_account_id,'enrollmentAccountId' => enrollment_account_id},
402
+ query_params: {'api-version' => @client.api_version},
403
+ body: request_content,
404
+ headers: request_headers.merge(custom_headers || {}),
405
+ base_url: request_url
406
+ }
407
+ promise = @client.make_request_async(:post, path_template, options)
408
+
409
+ promise = promise.then do |result|
410
+ http_response = result.response
411
+ status_code = http_response.status
412
+ response_content = http_response.body
413
+ unless status_code == 200
414
+ error_model = JSON.load(response_content)
415
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
416
+ end
417
+
418
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
419
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
420
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
421
+ # Deserialize Response
422
+ if status_code == 200
423
+ begin
424
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
425
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::QueryResult.mapper()
426
+ result.body = @client.deserialize(result_mapper, parsed_response)
427
+ rescue Exception => e
428
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
429
+ end
430
+ end
431
+
432
+ result
433
+ end
434
+
435
+ promise.execute
436
+ end
437
+
438
+ #
439
+ # Forecast the usage data for department.
440
+ #
441
+ # @param billing_account_id [String] BillingAccount ID
442
+ # @param department_id [String] Department ID
443
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
444
+ # CreateOrUpdate Report Config operation.
445
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
446
+ # will be added to the HTTP request.
447
+ #
448
+ # @return [QueryResult] operation results.
449
+ #
450
+ def usage_by_department(billing_account_id, department_id, parameters, custom_headers:nil)
451
+ response = usage_by_department_async(billing_account_id, department_id, parameters, custom_headers:custom_headers).value!
452
+ response.body unless response.nil?
453
+ end
454
+
455
+ #
456
+ # Forecast the usage data for department.
457
+ #
458
+ # @param billing_account_id [String] BillingAccount ID
459
+ # @param department_id [String] Department ID
460
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
461
+ # CreateOrUpdate Report Config operation.
462
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
463
+ # will be added to the HTTP request.
464
+ #
465
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
466
+ #
467
+ def usage_by_department_with_http_info(billing_account_id, department_id, parameters, custom_headers:nil)
468
+ usage_by_department_async(billing_account_id, department_id, parameters, custom_headers:custom_headers).value!
469
+ end
470
+
471
+ #
472
+ # Forecast the usage data for department.
473
+ #
474
+ # @param billing_account_id [String] BillingAccount ID
475
+ # @param department_id [String] Department ID
476
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
477
+ # CreateOrUpdate Report Config operation.
478
+ # @param [Hash{String => String}] A hash of custom headers that will be added
479
+ # to the HTTP request.
480
+ #
481
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
482
+ #
483
+ def usage_by_department_async(billing_account_id, department_id, parameters, custom_headers:nil)
484
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
485
+ fail ArgumentError, 'billing_account_id is nil' if billing_account_id.nil?
486
+ fail ArgumentError, 'department_id is nil' if department_id.nil?
487
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
488
+
489
+
490
+ request_headers = {}
491
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
492
+
493
+ # Set Headers
494
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
495
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
496
+
497
+ # Serialize Request
498
+ request_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::ReportConfigDefinition.mapper()
499
+ request_content = @client.serialize(request_mapper, parameters)
500
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
501
+
502
+ path_template = 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/Forecast'
503
+
504
+ request_url = @base_url || @client.base_url
505
+
506
+ options = {
507
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
508
+ path_params: {'billingAccountId' => billing_account_id,'departmentId' => department_id},
509
+ query_params: {'api-version' => @client.api_version},
510
+ body: request_content,
511
+ headers: request_headers.merge(custom_headers || {}),
512
+ base_url: request_url
513
+ }
514
+ promise = @client.make_request_async(:post, path_template, options)
515
+
516
+ promise = promise.then do |result|
517
+ http_response = result.response
518
+ status_code = http_response.status
519
+ response_content = http_response.body
520
+ unless status_code == 200
521
+ error_model = JSON.load(response_content)
522
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
523
+ end
524
+
525
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
526
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
527
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
528
+ # Deserialize Response
529
+ if status_code == 200
530
+ begin
531
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
532
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::QueryResult.mapper()
533
+ result.body = @client.deserialize(result_mapper, parsed_response)
534
+ rescue Exception => e
535
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
536
+ end
537
+ end
538
+
539
+ result
540
+ end
541
+
542
+ promise.execute
543
+ end
544
+
545
+ #
546
+ # Lists the usage data for management group.
547
+ #
548
+ # @param management_group_id [String] ManagementGroup ID
549
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
550
+ # CreateOrUpdate Report Config operation.
551
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
552
+ # will be added to the HTTP request.
553
+ #
554
+ # @return [QueryResult] operation results.
555
+ #
556
+ def usage_by_management_group(management_group_id, parameters, custom_headers:nil)
557
+ response = usage_by_management_group_async(management_group_id, parameters, custom_headers:custom_headers).value!
558
+ response.body unless response.nil?
559
+ end
560
+
561
+ #
562
+ # Lists the usage data for management group.
563
+ #
564
+ # @param management_group_id [String] ManagementGroup ID
565
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
566
+ # CreateOrUpdate Report Config operation.
567
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
568
+ # will be added to the HTTP request.
569
+ #
570
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
571
+ #
572
+ def usage_by_management_group_with_http_info(management_group_id, parameters, custom_headers:nil)
573
+ usage_by_management_group_async(management_group_id, parameters, custom_headers:custom_headers).value!
574
+ end
575
+
576
+ #
577
+ # Lists the usage data for management group.
578
+ #
579
+ # @param management_group_id [String] ManagementGroup ID
580
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
581
+ # CreateOrUpdate Report Config operation.
582
+ # @param [Hash{String => String}] A hash of custom headers that will be added
583
+ # to the HTTP request.
584
+ #
585
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
586
+ #
587
+ def usage_by_management_group_async(management_group_id, parameters, custom_headers:nil)
588
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
589
+ fail ArgumentError, 'management_group_id is nil' if management_group_id.nil?
590
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
591
+
592
+
593
+ request_headers = {}
594
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
595
+
596
+ # Set Headers
597
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
598
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
599
+
600
+ # Serialize Request
601
+ request_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::ReportConfigDefinition.mapper()
602
+ request_content = @client.serialize(request_mapper, parameters)
603
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
604
+
605
+ path_template = 'providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/Forecast'
606
+
607
+ request_url = @base_url || @client.base_url
608
+
609
+ options = {
610
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
611
+ path_params: {'managementGroupId' => management_group_id},
612
+ query_params: {'api-version' => @client.api_version},
613
+ body: request_content,
614
+ headers: request_headers.merge(custom_headers || {}),
615
+ base_url: request_url
616
+ }
617
+ promise = @client.make_request_async(:post, path_template, options)
618
+
619
+ promise = promise.then do |result|
620
+ http_response = result.response
621
+ status_code = http_response.status
622
+ response_content = http_response.body
623
+ unless status_code == 200
624
+ error_model = JSON.load(response_content)
625
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
626
+ end
627
+
628
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
629
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
630
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
631
+ # Deserialize Response
632
+ if status_code == 200
633
+ begin
634
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
635
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::QueryResult.mapper()
636
+ result.body = @client.deserialize(result_mapper, parsed_response)
637
+ rescue Exception => e
638
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
639
+ end
640
+ end
641
+
642
+ result
643
+ end
644
+
645
+ promise.execute
646
+ end
647
+
648
+ #
649
+ # Forecast the usage data for external billing account.
650
+ #
651
+ # @param external_billing_account_name [String] External Billing Account Name.
652
+ # (eg 'aws-{PayerAccountId}')
653
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
654
+ # CreateOrUpdate Report Config operation.
655
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
656
+ # will be added to the HTTP request.
657
+ #
658
+ # @return [QueryResult] operation results.
659
+ #
660
+ def usage_by_external_billing_account(external_billing_account_name, parameters, custom_headers:nil)
661
+ response = usage_by_external_billing_account_async(external_billing_account_name, parameters, custom_headers:custom_headers).value!
662
+ response.body unless response.nil?
663
+ end
664
+
665
+ #
666
+ # Forecast the usage data for external billing account.
667
+ #
668
+ # @param external_billing_account_name [String] External Billing Account Name.
669
+ # (eg 'aws-{PayerAccountId}')
670
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
671
+ # CreateOrUpdate Report Config operation.
672
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
673
+ # will be added to the HTTP request.
674
+ #
675
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
676
+ #
677
+ def usage_by_external_billing_account_with_http_info(external_billing_account_name, parameters, custom_headers:nil)
678
+ usage_by_external_billing_account_async(external_billing_account_name, parameters, custom_headers:custom_headers).value!
679
+ end
680
+
681
+ #
682
+ # Forecast the usage data for external billing account.
683
+ #
684
+ # @param external_billing_account_name [String] External Billing Account Name.
685
+ # (eg 'aws-{PayerAccountId}')
686
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
687
+ # CreateOrUpdate Report Config operation.
688
+ # @param [Hash{String => String}] A hash of custom headers that will be added
689
+ # to the HTTP request.
690
+ #
691
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
692
+ #
693
+ def usage_by_external_billing_account_async(external_billing_account_name, parameters, custom_headers:nil)
694
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
695
+ fail ArgumentError, 'external_billing_account_name is nil' if external_billing_account_name.nil?
696
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
697
+
698
+
699
+ request_headers = {}
700
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
701
+
702
+ # Set Headers
703
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
704
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
705
+
706
+ # Serialize Request
707
+ request_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::ReportConfigDefinition.mapper()
708
+ request_content = @client.serialize(request_mapper, parameters)
709
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
710
+
711
+ path_template = 'providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}/Forecast'
712
+
713
+ request_url = @base_url || @client.base_url
714
+
715
+ options = {
716
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
717
+ path_params: {'externalBillingAccountName' => external_billing_account_name},
718
+ query_params: {'api-version' => @client.api_version},
719
+ body: request_content,
720
+ headers: request_headers.merge(custom_headers || {}),
721
+ base_url: request_url
722
+ }
723
+ promise = @client.make_request_async(:post, path_template, options)
724
+
725
+ promise = promise.then do |result|
726
+ http_response = result.response
727
+ status_code = http_response.status
728
+ response_content = http_response.body
729
+ unless status_code == 200
730
+ error_model = JSON.load(response_content)
731
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
732
+ end
733
+
734
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
735
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
736
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
737
+ # Deserialize Response
738
+ if status_code == 200
739
+ begin
740
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
741
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::QueryResult.mapper()
742
+ result.body = @client.deserialize(result_mapper, parsed_response)
743
+ rescue Exception => e
744
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
745
+ end
746
+ end
747
+
748
+ result
749
+ end
750
+
751
+ promise.execute
752
+ end
753
+
754
+ end
755
+ end