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,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9a3d4ecd8c3a590d3ba7d7e37fad5aeb53aac89fb22998c4fca8903f941c5792
4
+ data.tar.gz: 78c0545214f56172cf9604360e696759aad5d3b720b94e9d0c01d6fdcc0f2d2d
5
+ SHA512:
6
+ metadata.gz: fddc3f837d1375e75c19053bb7af283a933701a8de4366a89b30341e89c5a63369ab3df2c6231fad4dbcbc0811d063785f2961668cc40e3ebf2ab1077a5f85e7
7
+ data.tar.gz: 29703229c5b6389ef9c206f9e6295abffa45c097d2ae8f71bbff36b301a2ed3cfa774626f22dac55ecfc6e7a65067cb777f1c178d48e65388523ede0019a3186
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,63 @@
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
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2018-05-31/generated/azure_mgmt_cost_management/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::CostManagement::Mgmt::V2018_05_31
23
+ autoload :ReportConfigOperations, '2018-05-31/generated/azure_mgmt_cost_management/report_config_operations.rb'
24
+ autoload :BillingAccountDimensions, '2018-05-31/generated/azure_mgmt_cost_management/billing_account_dimensions.rb'
25
+ autoload :SubscriptionDimensions, '2018-05-31/generated/azure_mgmt_cost_management/subscription_dimensions.rb'
26
+ autoload :ResourceGroupDimensions, '2018-05-31/generated/azure_mgmt_cost_management/resource_group_dimensions.rb'
27
+ autoload :Operations, '2018-05-31/generated/azure_mgmt_cost_management/operations.rb'
28
+ autoload :CostManagementClient, '2018-05-31/generated/azure_mgmt_cost_management/cost_management_client.rb'
29
+
30
+ module Models
31
+ autoload :ReportConfigFilter, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_filter.rb'
32
+ autoload :ReportConfigDataset, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_dataset.rb'
33
+ autoload :ErrorResponse, '2018-05-31/generated/azure_mgmt_cost_management/models/error_response.rb'
34
+ autoload :ReportConfigDefinition, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_definition.rb'
35
+ autoload :ReportConfigRecurrencePeriod, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_recurrence_period.rb'
36
+ autoload :Resource, '2018-05-31/generated/azure_mgmt_cost_management/models/resource.rb'
37
+ autoload :ReportConfigSchedule, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_schedule.rb'
38
+ autoload :ReportConfigDeliveryInfo, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_delivery_info.rb'
39
+ autoload :ReportConfigDatasetConfiguration, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_dataset_configuration.rb'
40
+ autoload :ReportConfigListResult, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_list_result.rb'
41
+ autoload :ReportConfigGrouping, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_grouping.rb'
42
+ autoload :OperationListResult, '2018-05-31/generated/azure_mgmt_cost_management/models/operation_list_result.rb'
43
+ autoload :ErrorDetails, '2018-05-31/generated/azure_mgmt_cost_management/models/error_details.rb'
44
+ autoload :DimensionsListResult, '2018-05-31/generated/azure_mgmt_cost_management/models/dimensions_list_result.rb'
45
+ autoload :ReportConfigTimePeriod, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_time_period.rb'
46
+ autoload :QueryColumn, '2018-05-31/generated/azure_mgmt_cost_management/models/query_column.rb'
47
+ autoload :ReportConfigComparisonExpression, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_comparison_expression.rb'
48
+ autoload :Operation, '2018-05-31/generated/azure_mgmt_cost_management/models/operation.rb'
49
+ autoload :ReportConfigAggregation, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_aggregation.rb'
50
+ autoload :QueryResult, '2018-05-31/generated/azure_mgmt_cost_management/models/query_result.rb'
51
+ autoload :ReportConfigDeliveryDestination, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_delivery_destination.rb'
52
+ autoload :OperationDisplay, '2018-05-31/generated/azure_mgmt_cost_management/models/operation_display.rb'
53
+ autoload :ReportConfig, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config.rb'
54
+ autoload :Dimension, '2018-05-31/generated/azure_mgmt_cost_management/models/dimension.rb'
55
+ autoload :Query, '2018-05-31/generated/azure_mgmt_cost_management/models/query.rb'
56
+ autoload :StatusType, '2018-05-31/generated/azure_mgmt_cost_management/models/status_type.rb'
57
+ autoload :RecurrenceType, '2018-05-31/generated/azure_mgmt_cost_management/models/recurrence_type.rb'
58
+ autoload :FormatType, '2018-05-31/generated/azure_mgmt_cost_management/models/format_type.rb'
59
+ autoload :TimeframeType, '2018-05-31/generated/azure_mgmt_cost_management/models/timeframe_type.rb'
60
+ autoload :GranularityType, '2018-05-31/generated/azure_mgmt_cost_management/models/granularity_type.rb'
61
+ autoload :ReportConfigColumnType, '2018-05-31/generated/azure_mgmt_cost_management/models/report_config_column_type.rb'
62
+ end
63
+ end
@@ -0,0 +1,149 @@
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::V2018_05_31
7
+ #
8
+ # BillingAccountDimensions
9
+ #
10
+ class BillingAccountDimensions
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the BillingAccountDimensions 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
+ # Lists the dimensions by billingAccount Id.
26
+ #
27
+ # @param billing_account_id [String] BillingAccount ID
28
+ # @param filter [String] May be used to filter dimensions by
29
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
30
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
31
+ # @param expand [String] May be used to expand the properties/data within a
32
+ # dimension category. By default, data is not included when listing dimensions.
33
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
34
+ # returned a partial result. If a previous response contains a nextLink
35
+ # element, the value of the nextLink element will include a skiptoken parameter
36
+ # that specifies a starting point to use for subsequent calls.
37
+ # @param top [Integer] May be used to limit the number of results to the most
38
+ # recent N dimension data.
39
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
40
+ # will be added to the HTTP request.
41
+ #
42
+ # @return [DimensionsListResult] operation results.
43
+ #
44
+ def list(billing_account_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
45
+ response = list_async(billing_account_id, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
46
+ response.body unless response.nil?
47
+ end
48
+
49
+ #
50
+ # Lists the dimensions by billingAccount Id.
51
+ #
52
+ # @param billing_account_id [String] BillingAccount ID
53
+ # @param filter [String] May be used to filter dimensions by
54
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
55
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
56
+ # @param expand [String] May be used to expand the properties/data within a
57
+ # dimension category. By default, data is not included when listing dimensions.
58
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
59
+ # returned a partial result. If a previous response contains a nextLink
60
+ # element, the value of the nextLink element will include a skiptoken parameter
61
+ # that specifies a starting point to use for subsequent calls.
62
+ # @param top [Integer] May be used to limit the number of results to the most
63
+ # recent N dimension data.
64
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
65
+ # will be added to the HTTP request.
66
+ #
67
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
68
+ #
69
+ def list_with_http_info(billing_account_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
70
+ list_async(billing_account_id, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
71
+ end
72
+
73
+ #
74
+ # Lists the dimensions by billingAccount Id.
75
+ #
76
+ # @param billing_account_id [String] BillingAccount ID
77
+ # @param filter [String] May be used to filter dimensions by
78
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
79
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
80
+ # @param expand [String] May be used to expand the properties/data within a
81
+ # dimension category. By default, data is not included when listing dimensions.
82
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
83
+ # returned a partial result. If a previous response contains a nextLink
84
+ # element, the value of the nextLink element will include a skiptoken parameter
85
+ # that specifies a starting point to use for subsequent calls.
86
+ # @param top [Integer] May be used to limit the number of results to the most
87
+ # recent N dimension data.
88
+ # @param [Hash{String => String}] A hash of custom headers that will be added
89
+ # to the HTTP request.
90
+ #
91
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
92
+ #
93
+ def list_async(billing_account_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
94
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
95
+ fail ArgumentError, 'billing_account_id is nil' if billing_account_id.nil?
96
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000
97
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
98
+
99
+
100
+ request_headers = {}
101
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
102
+
103
+ # Set Headers
104
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
105
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
106
+ path_template = 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/dimensions'
107
+
108
+ request_url = @base_url || @client.base_url
109
+
110
+ options = {
111
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
112
+ path_params: {'billingAccountId' => billing_account_id},
113
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
114
+ headers: request_headers.merge(custom_headers || {}),
115
+ base_url: request_url
116
+ }
117
+ promise = @client.make_request_async(:get, path_template, options)
118
+
119
+ promise = promise.then do |result|
120
+ http_response = result.response
121
+ status_code = http_response.status
122
+ response_content = http_response.body
123
+ unless status_code == 200
124
+ error_model = JSON.load(response_content)
125
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
126
+ end
127
+
128
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
129
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
130
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
131
+ # Deserialize Response
132
+ if status_code == 200
133
+ begin
134
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
135
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::DimensionsListResult.mapper()
136
+ result.body = @client.deserialize(result_mapper, parsed_response)
137
+ rescue Exception => e
138
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
139
+ end
140
+ end
141
+
142
+ result
143
+ end
144
+
145
+ promise.execute
146
+ end
147
+
148
+ end
149
+ end
@@ -0,0 +1,455 @@
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::V2018_05_31
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class CostManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Version of the API to be used with the client request.
21
+ # The current version is 2018-05-31.
22
+ attr_reader :api_version
23
+
24
+ # @return [String] Azure Subscription ID.
25
+ attr_accessor :subscription_id
26
+
27
+ # @return [String] The preferred language for the response.
28
+ attr_accessor :accept_language
29
+
30
+ # @return [Integer] The retry timeout in seconds for Long Running
31
+ # Operations. Default value is 30.
32
+ attr_accessor :long_running_operation_retry_timeout
33
+
34
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
35
+ # generated. When set to true a unique x-ms-client-request-id value is
36
+ # generated and included in each request. Default is true.
37
+ attr_accessor :generate_client_request_id
38
+
39
+ # @return [ReportConfigOperations] report_config_operations
40
+ attr_reader :report_config_operations
41
+
42
+ # @return [BillingAccountDimensions] billing_account_dimensions
43
+ attr_reader :billing_account_dimensions
44
+
45
+ # @return [SubscriptionDimensions] subscription_dimensions
46
+ attr_reader :subscription_dimensions
47
+
48
+ # @return [ResourceGroupDimensions] resource_group_dimensions
49
+ attr_reader :resource_group_dimensions
50
+
51
+ # @return [Operations] operations
52
+ attr_reader :operations
53
+
54
+ #
55
+ # Creates initializes a new instance of the CostManagementClient class.
56
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
57
+ # @param base_url [String] the base URI of the service.
58
+ # @param options [Array] filters to be applied to the HTTP requests.
59
+ #
60
+ def initialize(credentials = nil, base_url = nil, options = nil)
61
+ super(credentials, options)
62
+ @base_url = base_url || 'https://management.azure.com'
63
+
64
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
65
+ @credentials = credentials
66
+
67
+ @report_config_operations = ReportConfigOperations.new(self)
68
+ @billing_account_dimensions = BillingAccountDimensions.new(self)
69
+ @subscription_dimensions = SubscriptionDimensions.new(self)
70
+ @resource_group_dimensions = ResourceGroupDimensions.new(self)
71
+ @operations = Operations.new(self)
72
+ @api_version = '2018-05-31'
73
+ @accept_language = 'en-US'
74
+ @long_running_operation_retry_timeout = 30
75
+ @generate_client_request_id = true
76
+ add_telemetry
77
+ end
78
+
79
+ #
80
+ # Makes a request and returns the body of the response.
81
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
82
+ # @param path [String] the path, relative to {base_url}.
83
+ # @param options [Hash{String=>String}] specifying any request options like :body.
84
+ # @return [Hash{String=>String}] containing the body of the response.
85
+ # Example:
86
+ #
87
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
88
+ # path = "/path"
89
+ # options = {
90
+ # body: request_content,
91
+ # query_params: {'api-version' => '2016-02-01'}
92
+ # }
93
+ # result = @client.make_request(:put, path, options)
94
+ #
95
+ def make_request(method, path, options = {})
96
+ result = make_request_with_http_info(method, path, options)
97
+ result.body unless result.nil?
98
+ end
99
+
100
+ #
101
+ # Makes a request and returns the operation response.
102
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
103
+ # @param path [String] the path, relative to {base_url}.
104
+ # @param options [Hash{String=>String}] specifying any request options like :body.
105
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
106
+ #
107
+ def make_request_with_http_info(method, path, options = {})
108
+ result = make_request_async(method, path, options).value!
109
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
110
+ result
111
+ end
112
+
113
+ #
114
+ # Makes a request asynchronously.
115
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
116
+ # @param path [String] the path, relative to {base_url}.
117
+ # @param options [Hash{String=>String}] specifying any request options like :body.
118
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
119
+ #
120
+ def make_request_async(method, path, options = {})
121
+ fail ArgumentError, 'method is nil' if method.nil?
122
+ fail ArgumentError, 'path is nil' if path.nil?
123
+
124
+ request_url = options[:base_url] || @base_url
125
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
126
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
127
+ end
128
+
129
+ request_headers = @request_headers
130
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
131
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
132
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
133
+
134
+ super(request_url, method, path, options)
135
+ end
136
+
137
+ #
138
+ # Lists the usage data for subscriptionId.
139
+ #
140
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
141
+ # CreateOrUpdate Report Config operation.
142
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
143
+ # will be added to the HTTP request.
144
+ #
145
+ # @return [QueryResult] operation results.
146
+ #
147
+ def query_subscription(parameters, custom_headers:nil)
148
+ response = query_subscription_async(parameters, custom_headers:custom_headers).value!
149
+ response.body unless response.nil?
150
+ end
151
+
152
+ #
153
+ # Lists the usage data for subscriptionId.
154
+ #
155
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
156
+ # CreateOrUpdate Report Config operation.
157
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
158
+ # will be added to the HTTP request.
159
+ #
160
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
161
+ #
162
+ def query_subscription_with_http_info(parameters, custom_headers:nil)
163
+ query_subscription_async(parameters, custom_headers:custom_headers).value!
164
+ end
165
+
166
+ #
167
+ # Lists the usage data for subscriptionId.
168
+ #
169
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
170
+ # CreateOrUpdate Report Config operation.
171
+ # @param [Hash{String => String}] A hash of custom headers that will be added
172
+ # to the HTTP request.
173
+ #
174
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
175
+ #
176
+ def query_subscription_async(parameters, custom_headers:nil)
177
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
178
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
179
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
180
+
181
+
182
+ request_headers = {}
183
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
184
+
185
+ # Set Headers
186
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
187
+ request_headers['accept-language'] = accept_language unless accept_language.nil?
188
+
189
+ # Serialize Request
190
+ request_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::ReportConfigDefinition.mapper()
191
+ request_content = self.serialize(request_mapper, parameters)
192
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
193
+
194
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/Query'
195
+
196
+ request_url = @base_url || self.base_url
197
+
198
+ options = {
199
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
200
+ path_params: {'subscriptionId' => subscription_id},
201
+ query_params: {'api-version' => api_version},
202
+ body: request_content,
203
+ headers: request_headers.merge(custom_headers || {}),
204
+ base_url: request_url
205
+ }
206
+ promise = self.make_request_async(:post, path_template, options)
207
+
208
+ promise = promise.then do |result|
209
+ http_response = result.response
210
+ status_code = http_response.status
211
+ response_content = http_response.body
212
+ unless status_code == 200
213
+ error_model = JSON.load(response_content)
214
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
215
+ end
216
+
217
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
218
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
219
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
220
+ # Deserialize Response
221
+ if status_code == 200
222
+ begin
223
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
224
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::QueryResult.mapper()
225
+ result.body = self.deserialize(result_mapper, parsed_response)
226
+ rescue Exception => e
227
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
228
+ end
229
+ end
230
+
231
+ result
232
+ end
233
+
234
+ promise.execute
235
+ end
236
+
237
+ #
238
+ # Lists the usage data for subscriptionId and resource group.
239
+ #
240
+ # @param resource_group_name [String] Azure Resource Group Name.
241
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
242
+ # CreateOrUpdate Report Config operation.
243
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
244
+ # will be added to the HTTP request.
245
+ #
246
+ # @return [QueryResult] operation results.
247
+ #
248
+ def query_resource_group(resource_group_name, parameters, custom_headers:nil)
249
+ response = query_resource_group_async(resource_group_name, parameters, custom_headers:custom_headers).value!
250
+ response.body unless response.nil?
251
+ end
252
+
253
+ #
254
+ # Lists the usage data for subscriptionId and resource group.
255
+ #
256
+ # @param resource_group_name [String] Azure Resource Group Name.
257
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
258
+ # CreateOrUpdate Report Config operation.
259
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
260
+ # will be added to the HTTP request.
261
+ #
262
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
263
+ #
264
+ def query_resource_group_with_http_info(resource_group_name, parameters, custom_headers:nil)
265
+ query_resource_group_async(resource_group_name, parameters, custom_headers:custom_headers).value!
266
+ end
267
+
268
+ #
269
+ # Lists the usage data for subscriptionId and resource group.
270
+ #
271
+ # @param resource_group_name [String] Azure Resource Group Name.
272
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
273
+ # CreateOrUpdate Report Config operation.
274
+ # @param [Hash{String => String}] A hash of custom headers that will be added
275
+ # to the HTTP request.
276
+ #
277
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
278
+ #
279
+ def query_resource_group_async(resource_group_name, parameters, custom_headers:nil)
280
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
281
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
282
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
283
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
284
+
285
+
286
+ request_headers = {}
287
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
288
+
289
+ # Set Headers
290
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
291
+ request_headers['accept-language'] = accept_language unless accept_language.nil?
292
+
293
+ # Serialize Request
294
+ request_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::ReportConfigDefinition.mapper()
295
+ request_content = self.serialize(request_mapper, parameters)
296
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
297
+
298
+ path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.CostManagement/Query'
299
+
300
+ request_url = @base_url || self.base_url
301
+
302
+ options = {
303
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
304
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name},
305
+ query_params: {'api-version' => api_version},
306
+ body: request_content,
307
+ headers: request_headers.merge(custom_headers || {}),
308
+ base_url: request_url
309
+ }
310
+ promise = self.make_request_async(:post, path_template, options)
311
+
312
+ promise = promise.then do |result|
313
+ http_response = result.response
314
+ status_code = http_response.status
315
+ response_content = http_response.body
316
+ unless status_code == 200
317
+ error_model = JSON.load(response_content)
318
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
319
+ end
320
+
321
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
322
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
323
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
324
+ # Deserialize Response
325
+ if status_code == 200
326
+ begin
327
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
328
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::QueryResult.mapper()
329
+ result.body = self.deserialize(result_mapper, parsed_response)
330
+ rescue Exception => e
331
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
332
+ end
333
+ end
334
+
335
+ result
336
+ end
337
+
338
+ promise.execute
339
+ end
340
+
341
+ #
342
+ # Lists the usage data for billing account.
343
+ #
344
+ # @param billing_account_id [String] BillingAccount ID
345
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
346
+ # CreateOrUpdate Report Config operation.
347
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
348
+ # will be added to the HTTP request.
349
+ #
350
+ # @return [QueryResult] operation results.
351
+ #
352
+ def query_billing_account(billing_account_id, parameters, custom_headers:nil)
353
+ response = query_billing_account_async(billing_account_id, parameters, custom_headers:custom_headers).value!
354
+ response.body unless response.nil?
355
+ end
356
+
357
+ #
358
+ # Lists the usage data for billing account.
359
+ #
360
+ # @param billing_account_id [String] BillingAccount ID
361
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
362
+ # CreateOrUpdate Report Config operation.
363
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
364
+ # will be added to the HTTP request.
365
+ #
366
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
367
+ #
368
+ def query_billing_account_with_http_info(billing_account_id, parameters, custom_headers:nil)
369
+ query_billing_account_async(billing_account_id, parameters, custom_headers:custom_headers).value!
370
+ end
371
+
372
+ #
373
+ # Lists the usage data for billing account.
374
+ #
375
+ # @param billing_account_id [String] BillingAccount ID
376
+ # @param parameters [ReportConfigDefinition] Parameters supplied to the
377
+ # CreateOrUpdate Report Config operation.
378
+ # @param [Hash{String => String}] A hash of custom headers that will be added
379
+ # to the HTTP request.
380
+ #
381
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
382
+ #
383
+ def query_billing_account_async(billing_account_id, parameters, custom_headers:nil)
384
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
385
+ fail ArgumentError, 'billing_account_id is nil' if billing_account_id.nil?
386
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
387
+
388
+
389
+ request_headers = {}
390
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
391
+
392
+ # Set Headers
393
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
394
+ request_headers['accept-language'] = accept_language unless accept_language.nil?
395
+
396
+ # Serialize Request
397
+ request_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::ReportConfigDefinition.mapper()
398
+ request_content = self.serialize(request_mapper, parameters)
399
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
400
+
401
+ path_template = 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/Query'
402
+
403
+ request_url = @base_url || self.base_url
404
+
405
+ options = {
406
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
407
+ path_params: {'billingAccountId' => billing_account_id},
408
+ query_params: {'api-version' => api_version},
409
+ body: request_content,
410
+ headers: request_headers.merge(custom_headers || {}),
411
+ base_url: request_url
412
+ }
413
+ promise = self.make_request_async(:post, path_template, options)
414
+
415
+ promise = promise.then do |result|
416
+ http_response = result.response
417
+ status_code = http_response.status
418
+ response_content = http_response.body
419
+ unless status_code == 200
420
+ error_model = JSON.load(response_content)
421
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
422
+ end
423
+
424
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
425
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
426
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
427
+ # Deserialize Response
428
+ if status_code == 200
429
+ begin
430
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
431
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::QueryResult.mapper()
432
+ result.body = self.deserialize(result_mapper, parsed_response)
433
+ rescue Exception => e
434
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
435
+ end
436
+ end
437
+
438
+ result
439
+ end
440
+
441
+ promise.execute
442
+ end
443
+
444
+
445
+ private
446
+ #
447
+ # Adds telemetry information.
448
+ #
449
+ def add_telemetry
450
+ sdk_information = 'azure_mgmt_cost_management'
451
+ sdk_information = "#{sdk_information}/0.17.0"
452
+ add_user_agent_information(sdk_information)
453
+ end
454
+ end
455
+ end