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,222 @@
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
+ # ShowbackRuleOperations
9
+ #
10
+ class ShowbackRuleOperations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ShowbackRuleOperations 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
+ # Gets the showback rule by rule name.
26
+ #
27
+ # @param billing_account_id [String] BillingAccount ID
28
+ # @param rule_name [String] Showback rule name
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [ShowbackRule] operation results.
33
+ #
34
+ def get_billing_account_id(billing_account_id, rule_name, custom_headers:nil)
35
+ response = get_billing_account_id_async(billing_account_id, rule_name, custom_headers:custom_headers).value!
36
+ response.body unless response.nil?
37
+ end
38
+
39
+ #
40
+ # Gets the showback rule by rule name.
41
+ #
42
+ # @param billing_account_id [String] BillingAccount ID
43
+ # @param rule_name [String] Showback rule name
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 get_billing_account_id_with_http_info(billing_account_id, rule_name, custom_headers:nil)
50
+ get_billing_account_id_async(billing_account_id, rule_name, custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Gets the showback rule by rule name.
55
+ #
56
+ # @param billing_account_id [String] BillingAccount ID
57
+ # @param rule_name [String] Showback rule name
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 get_billing_account_id_async(billing_account_id, rule_name, custom_headers:nil)
64
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
65
+ fail ArgumentError, 'billing_account_id is nil' if billing_account_id.nil?
66
+ fail ArgumentError, 'rule_name is nil' if rule_name.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
+ path_template = 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/showbackRules/{ruleName}'
76
+
77
+ request_url = @base_url || @client.base_url
78
+
79
+ options = {
80
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
81
+ path_params: {'billingAccountId' => billing_account_id,'ruleName' => rule_name},
82
+ query_params: {'api-version' => @client.api_version},
83
+ headers: request_headers.merge(custom_headers || {}),
84
+ base_url: request_url
85
+ }
86
+ promise = @client.make_request_async(:get, path_template, options)
87
+
88
+ promise = promise.then do |result|
89
+ http_response = result.response
90
+ status_code = http_response.status
91
+ response_content = http_response.body
92
+ unless status_code == 200
93
+ error_model = JSON.load(response_content)
94
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
95
+ end
96
+
97
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
98
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
99
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
100
+ # Deserialize Response
101
+ if status_code == 200
102
+ begin
103
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
104
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::ShowbackRule.mapper()
105
+ result.body = @client.deserialize(result_mapper, parsed_response)
106
+ rescue Exception => e
107
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
108
+ end
109
+ end
110
+
111
+ result
112
+ end
113
+
114
+ promise.execute
115
+ end
116
+
117
+ #
118
+ # Create/Update showback rule for billing account.
119
+ #
120
+ # @param billing_account_id [String] BillingAccount ID
121
+ # @param rule_name [String] Showback rule name
122
+ # @param showback_rule [ShowbackRule] Showback rule to create or update.
123
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
124
+ # will be added to the HTTP request.
125
+ #
126
+ # @return [ShowbackRule] operation results.
127
+ #
128
+ def create_update_rule(billing_account_id, rule_name, showback_rule, custom_headers:nil)
129
+ response = create_update_rule_async(billing_account_id, rule_name, showback_rule, custom_headers:custom_headers).value!
130
+ response.body unless response.nil?
131
+ end
132
+
133
+ #
134
+ # Create/Update showback rule for billing account.
135
+ #
136
+ # @param billing_account_id [String] BillingAccount ID
137
+ # @param rule_name [String] Showback rule name
138
+ # @param showback_rule [ShowbackRule] Showback rule to create or update.
139
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
140
+ # will be added to the HTTP request.
141
+ #
142
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
143
+ #
144
+ def create_update_rule_with_http_info(billing_account_id, rule_name, showback_rule, custom_headers:nil)
145
+ create_update_rule_async(billing_account_id, rule_name, showback_rule, custom_headers:custom_headers).value!
146
+ end
147
+
148
+ #
149
+ # Create/Update showback rule for billing account.
150
+ #
151
+ # @param billing_account_id [String] BillingAccount ID
152
+ # @param rule_name [String] Showback rule name
153
+ # @param showback_rule [ShowbackRule] Showback rule to create or update.
154
+ # @param [Hash{String => String}] A hash of custom headers that will be added
155
+ # to the HTTP request.
156
+ #
157
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
158
+ #
159
+ def create_update_rule_async(billing_account_id, rule_name, showback_rule, custom_headers:nil)
160
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
161
+ fail ArgumentError, 'billing_account_id is nil' if billing_account_id.nil?
162
+ fail ArgumentError, 'rule_name is nil' if rule_name.nil?
163
+ fail ArgumentError, 'showback_rule is nil' if showback_rule.nil?
164
+
165
+
166
+ request_headers = {}
167
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
168
+
169
+ # Set Headers
170
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
171
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
172
+
173
+ # Serialize Request
174
+ request_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::ShowbackRule.mapper()
175
+ request_content = @client.serialize(request_mapper, showback_rule)
176
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
177
+
178
+ path_template = 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/showbackRules/{ruleName}'
179
+
180
+ request_url = @base_url || @client.base_url
181
+
182
+ options = {
183
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
184
+ path_params: {'billingAccountId' => billing_account_id,'ruleName' => rule_name},
185
+ query_params: {'api-version' => @client.api_version},
186
+ body: request_content,
187
+ headers: request_headers.merge(custom_headers || {}),
188
+ base_url: request_url
189
+ }
190
+ promise = @client.make_request_async(:put, path_template, options)
191
+
192
+ promise = promise.then do |result|
193
+ http_response = result.response
194
+ status_code = http_response.status
195
+ response_content = http_response.body
196
+ unless status_code == 200
197
+ error_model = JSON.load(response_content)
198
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
199
+ end
200
+
201
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
202
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
203
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
204
+ # Deserialize Response
205
+ if status_code == 200
206
+ begin
207
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
208
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::ShowbackRule.mapper()
209
+ result.body = @client.deserialize(result_mapper, parsed_response)
210
+ rescue Exception => e
211
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
212
+ end
213
+ end
214
+
215
+ result
216
+ end
217
+
218
+ promise.execute
219
+ end
220
+
221
+ end
222
+ end
@@ -0,0 +1,114 @@
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
+ # ShowbackRules
9
+ #
10
+ class ShowbackRules
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ShowbackRules 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
+ # Get list all Showback Rules.
26
+ #
27
+ # @param billing_account_id [String] BillingAccount ID
28
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
+ # will be added to the HTTP request.
30
+ #
31
+ # @return [ShowbackRuleListResult] operation results.
32
+ #
33
+ def list(billing_account_id, custom_headers:nil)
34
+ response = list_async(billing_account_id, custom_headers:custom_headers).value!
35
+ response.body unless response.nil?
36
+ end
37
+
38
+ #
39
+ # Get list all Showback Rules.
40
+ #
41
+ # @param billing_account_id [String] BillingAccount ID
42
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
43
+ # will be added to the HTTP request.
44
+ #
45
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
46
+ #
47
+ def list_with_http_info(billing_account_id, custom_headers:nil)
48
+ list_async(billing_account_id, custom_headers:custom_headers).value!
49
+ end
50
+
51
+ #
52
+ # Get list all Showback Rules.
53
+ #
54
+ # @param billing_account_id [String] BillingAccount ID
55
+ # @param [Hash{String => String}] A hash of custom headers that will be added
56
+ # to the HTTP request.
57
+ #
58
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
59
+ #
60
+ def list_async(billing_account_id, custom_headers:nil)
61
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
62
+ fail ArgumentError, 'billing_account_id is nil' if billing_account_id.nil?
63
+
64
+
65
+ request_headers = {}
66
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
67
+
68
+ # Set Headers
69
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
70
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
71
+ path_template = 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/showbackRules'
72
+
73
+ request_url = @base_url || @client.base_url
74
+
75
+ options = {
76
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
77
+ path_params: {'billingAccountId' => billing_account_id},
78
+ query_params: {'api-version' => @client.api_version},
79
+ headers: request_headers.merge(custom_headers || {}),
80
+ base_url: request_url
81
+ }
82
+ promise = @client.make_request_async(:get, path_template, options)
83
+
84
+ promise = promise.then do |result|
85
+ http_response = result.response
86
+ status_code = http_response.status
87
+ response_content = http_response.body
88
+ unless status_code == 200
89
+ error_model = JSON.load(response_content)
90
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
91
+ end
92
+
93
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
94
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
95
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
96
+ # Deserialize Response
97
+ if status_code == 200
98
+ begin
99
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
100
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::ShowbackRuleListResult.mapper()
101
+ result.body = @client.deserialize(result_mapper, parsed_response)
102
+ rescue Exception => e
103
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
104
+ end
105
+ end
106
+
107
+ result
108
+ end
109
+
110
+ promise.execute
111
+ end
112
+
113
+ end
114
+ end
@@ -0,0 +1,69 @@
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 '2019-04-01-preview/generated/azure_mgmt_cost_management/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::CostManagement::Mgmt::V2019_04_01_preview
23
+ autoload :Views, '2019-04-01-preview/generated/azure_mgmt_cost_management/views.rb'
24
+ autoload :Budgets, '2019-04-01-preview/generated/azure_mgmt_cost_management/budgets.rb'
25
+ autoload :Budget, '2019-04-01-preview/generated/azure_mgmt_cost_management/budget.rb'
26
+ autoload :Operations, '2019-04-01-preview/generated/azure_mgmt_cost_management/operations.rb'
27
+ autoload :CostManagementClient, '2019-04-01-preview/generated/azure_mgmt_cost_management/cost_management_client.rb'
28
+
29
+ module Models
30
+ autoload :OperationDisplay, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/operation_display.rb'
31
+ autoload :ErrorBase, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/error_base.rb'
32
+ autoload :Operation, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/operation.rb'
33
+ autoload :ErrorResponse, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/error_response.rb'
34
+ autoload :OperationListResult, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/operation_list_result.rb'
35
+ autoload :ProxyResource, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/proxy_resource.rb'
36
+ autoload :Scope, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/scope.rb'
37
+ autoload :ReportConfigDatasetConfiguration, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_dataset_configuration.rb'
38
+ autoload :KpiProperties, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/kpi_properties.rb'
39
+ autoload :ReportConfigGrouping, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_grouping.rb'
40
+ autoload :PivotProperties, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/pivot_properties.rb'
41
+ autoload :ReportConfigComparisonExpression, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_comparison_expression.rb'
42
+ autoload :ReportConfigFilter, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_filter.rb'
43
+ autoload :ReportConfigDataset, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_dataset.rb'
44
+ autoload :Resource, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/resource.rb'
45
+ autoload :ViewListResult, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/view_list_result.rb'
46
+ autoload :ReportConfigAggregation, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_aggregation.rb'
47
+ autoload :BudgetTimePeriod, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/budget_time_period.rb'
48
+ autoload :ErrorDetails, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/error_details.rb'
49
+ autoload :CurrentSpend, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/current_spend.rb'
50
+ autoload :ReportConfigSorting, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_sorting.rb'
51
+ autoload :Notification, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/notification.rb'
52
+ autoload :ReportConfigTimePeriod, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_time_period.rb'
53
+ autoload :BudgetsListResult, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/budgets_list_result.rb'
54
+ autoload :View, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/view.rb'
55
+ autoload :BudgetModel, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/budget_model.rb'
56
+ autoload :TimeframeType, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/timeframe_type.rb'
57
+ autoload :GranularityType, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/granularity_type.rb'
58
+ autoload :ReportConfigColumnType, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/report_config_column_type.rb'
59
+ autoload :OperatorType, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/operator_type.rb'
60
+ autoload :ChartType, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/chart_type.rb'
61
+ autoload :AccumulatedType, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/accumulated_type.rb'
62
+ autoload :MetricType, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/metric_type.rb'
63
+ autoload :KpiTypeType, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/kpi_type_type.rb'
64
+ autoload :PivotTypeType, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/pivot_type_type.rb'
65
+ autoload :CategoryType, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/category_type.rb'
66
+ autoload :TimeGrainType, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/time_grain_type.rb'
67
+ autoload :NotificationOperatorType, '2019-04-01-preview/generated/azure_mgmt_cost_management/models/notification_operator_type.rb'
68
+ end
69
+ end
@@ -0,0 +1,460 @@
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_04_01_preview
7
+ #
8
+ # Budget
9
+ #
10
+ class Budget
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Budget 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
+ # Gets the budget for the scope by budget name.
26
+ #
27
+ # @param scope [String] The scope associated with budget operations. This
28
+ # includes '/subscriptions/{subscriptionId}/' for subscription scope,
29
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
30
+ # resourceGroup scope,
31
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
32
+ # Account scope,
33
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
34
+ # for Department scope,
35
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
36
+ # for EnrollmentAccount scope,
37
+ # '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
38
+ # Management Group scope,
39
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
40
+ # for billingProfile scope,
41
+ # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
42
+ # for invoiceSection scope.
43
+ # @param budget_name [String] Budget Name.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [BudgetModel] operation results.
48
+ #
49
+ def get(scope, budget_name, custom_headers:nil)
50
+ response = get_async(scope, budget_name, custom_headers:custom_headers).value!
51
+ response.body unless response.nil?
52
+ end
53
+
54
+ #
55
+ # Gets the budget for the scope by budget name.
56
+ #
57
+ # @param scope [String] The scope associated with budget operations. This
58
+ # includes '/subscriptions/{subscriptionId}/' for subscription scope,
59
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
60
+ # resourceGroup scope,
61
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
62
+ # Account scope,
63
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
64
+ # for Department scope,
65
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
66
+ # for EnrollmentAccount scope,
67
+ # '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
68
+ # Management Group scope,
69
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
70
+ # for billingProfile scope,
71
+ # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
72
+ # for invoiceSection scope.
73
+ # @param budget_name [String] Budget Name.
74
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
75
+ # will be added to the HTTP request.
76
+ #
77
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
78
+ #
79
+ def get_with_http_info(scope, budget_name, custom_headers:nil)
80
+ get_async(scope, budget_name, custom_headers:custom_headers).value!
81
+ end
82
+
83
+ #
84
+ # Gets the budget for the scope by budget name.
85
+ #
86
+ # @param scope [String] The scope associated with budget operations. This
87
+ # includes '/subscriptions/{subscriptionId}/' for subscription scope,
88
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
89
+ # resourceGroup scope,
90
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
91
+ # Account scope,
92
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
93
+ # for Department scope,
94
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
95
+ # for EnrollmentAccount scope,
96
+ # '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
97
+ # Management Group scope,
98
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
99
+ # for billingProfile scope,
100
+ # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
101
+ # for invoiceSection scope.
102
+ # @param budget_name [String] Budget Name.
103
+ # @param [Hash{String => String}] A hash of custom headers that will be added
104
+ # to the HTTP request.
105
+ #
106
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
107
+ #
108
+ def get_async(scope, budget_name, custom_headers:nil)
109
+ fail ArgumentError, 'scope is nil' if scope.nil?
110
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
111
+ fail ArgumentError, 'budget_name is nil' if budget_name.nil?
112
+
113
+
114
+ request_headers = {}
115
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
116
+
117
+ # Set Headers
118
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
119
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
120
+ path_template = '{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}'
121
+
122
+ request_url = @base_url || @client.base_url
123
+
124
+ options = {
125
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
126
+ path_params: {'budgetName' => budget_name},
127
+ skip_encoding_path_params: {'scope' => scope},
128
+ query_params: {'api-version' => @client.api_version},
129
+ headers: request_headers.merge(custom_headers || {}),
130
+ base_url: request_url
131
+ }
132
+ promise = @client.make_request_async(:get, path_template, options)
133
+
134
+ promise = promise.then do |result|
135
+ http_response = result.response
136
+ status_code = http_response.status
137
+ response_content = http_response.body
138
+ unless status_code == 200
139
+ error_model = JSON.load(response_content)
140
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
141
+ end
142
+
143
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
144
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
145
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
146
+ # Deserialize Response
147
+ if status_code == 200
148
+ begin
149
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
150
+ result_mapper = Azure::CostManagement::Mgmt::V2019_04_01_preview::Models::BudgetModel.mapper()
151
+ result.body = @client.deserialize(result_mapper, parsed_response)
152
+ rescue Exception => e
153
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
154
+ end
155
+ end
156
+
157
+ result
158
+ end
159
+
160
+ promise.execute
161
+ end
162
+
163
+ #
164
+ # The operation to create or update a budget. Update operation requires latest
165
+ # eTag to be set in the request mandatorily. You may obtain the latest eTag by
166
+ # performing a get operation. Create operation does not require eTag.
167
+ #
168
+ # @param scope [String] The scope associated with budget operations. This
169
+ # includes '/subscriptions/{subscriptionId}/' for subscription scope,
170
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
171
+ # resourceGroup scope,
172
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
173
+ # Account scope,
174
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
175
+ # for Department scope,
176
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
177
+ # for EnrollmentAccount scope,
178
+ # '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
179
+ # Management Group scope,
180
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
181
+ # for billingProfile scope,
182
+ # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
183
+ # for invoiceSection scope.
184
+ # @param budget_name [String] Budget Name.
185
+ # @param parameters [BudgetModel] Parameters supplied to the Create Budget
186
+ # operation.
187
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
188
+ # will be added to the HTTP request.
189
+ #
190
+ # @return [BudgetModel] operation results.
191
+ #
192
+ def create_or_update(scope, budget_name, parameters:nil, custom_headers:nil)
193
+ response = create_or_update_async(scope, budget_name, parameters:parameters, custom_headers:custom_headers).value!
194
+ response.body unless response.nil?
195
+ end
196
+
197
+ #
198
+ # The operation to create or update a budget. Update operation requires latest
199
+ # eTag to be set in the request mandatorily. You may obtain the latest eTag by
200
+ # performing a get operation. Create operation does not require eTag.
201
+ #
202
+ # @param scope [String] The scope associated with budget operations. This
203
+ # includes '/subscriptions/{subscriptionId}/' for subscription scope,
204
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
205
+ # resourceGroup scope,
206
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
207
+ # Account scope,
208
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
209
+ # for Department scope,
210
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
211
+ # for EnrollmentAccount scope,
212
+ # '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
213
+ # Management Group scope,
214
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
215
+ # for billingProfile scope,
216
+ # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
217
+ # for invoiceSection scope.
218
+ # @param budget_name [String] Budget Name.
219
+ # @param parameters [BudgetModel] Parameters supplied to the Create Budget
220
+ # operation.
221
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
222
+ # will be added to the HTTP request.
223
+ #
224
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
225
+ #
226
+ def create_or_update_with_http_info(scope, budget_name, parameters:nil, custom_headers:nil)
227
+ create_or_update_async(scope, budget_name, parameters:parameters, custom_headers:custom_headers).value!
228
+ end
229
+
230
+ #
231
+ # The operation to create or update a budget. Update operation requires latest
232
+ # eTag to be set in the request mandatorily. You may obtain the latest eTag by
233
+ # performing a get operation. Create operation does not require eTag.
234
+ #
235
+ # @param scope [String] The scope associated with budget operations. This
236
+ # includes '/subscriptions/{subscriptionId}/' for subscription scope,
237
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
238
+ # resourceGroup scope,
239
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
240
+ # Account scope,
241
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
242
+ # for Department scope,
243
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
244
+ # for EnrollmentAccount scope,
245
+ # '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
246
+ # Management Group scope,
247
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
248
+ # for billingProfile scope,
249
+ # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
250
+ # for invoiceSection scope.
251
+ # @param budget_name [String] Budget Name.
252
+ # @param parameters [BudgetModel] Parameters supplied to the Create Budget
253
+ # operation.
254
+ # @param [Hash{String => String}] A hash of custom headers that will be added
255
+ # to the HTTP request.
256
+ #
257
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
258
+ #
259
+ def create_or_update_async(scope, budget_name, parameters:nil, custom_headers:nil)
260
+ fail ArgumentError, 'scope is nil' if scope.nil?
261
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
262
+ fail ArgumentError, 'budget_name is nil' if budget_name.nil?
263
+
264
+
265
+ request_headers = {}
266
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
267
+
268
+ # Set Headers
269
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
270
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
271
+
272
+ # Serialize Request
273
+ request_mapper = Azure::CostManagement::Mgmt::V2019_04_01_preview::Models::BudgetModel.mapper()
274
+ request_content = @client.serialize(request_mapper, parameters)
275
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
276
+
277
+ path_template = '{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}'
278
+
279
+ request_url = @base_url || @client.base_url
280
+
281
+ options = {
282
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
283
+ path_params: {'budgetName' => budget_name},
284
+ skip_encoding_path_params: {'scope' => scope},
285
+ query_params: {'api-version' => @client.api_version},
286
+ body: request_content,
287
+ headers: request_headers.merge(custom_headers || {}),
288
+ base_url: request_url
289
+ }
290
+ promise = @client.make_request_async(:put, path_template, options)
291
+
292
+ promise = promise.then do |result|
293
+ http_response = result.response
294
+ status_code = http_response.status
295
+ response_content = http_response.body
296
+ unless status_code == 200 || status_code == 201
297
+ error_model = JSON.load(response_content)
298
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
299
+ end
300
+
301
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
302
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
303
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
304
+ # Deserialize Response
305
+ if status_code == 200
306
+ begin
307
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
308
+ result_mapper = Azure::CostManagement::Mgmt::V2019_04_01_preview::Models::BudgetModel.mapper()
309
+ result.body = @client.deserialize(result_mapper, parsed_response)
310
+ rescue Exception => e
311
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
312
+ end
313
+ end
314
+ # Deserialize Response
315
+ if status_code == 201
316
+ begin
317
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
318
+ result_mapper = Azure::CostManagement::Mgmt::V2019_04_01_preview::Models::BudgetModel.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
+ # The operation to delete a budget.
333
+ #
334
+ # @param scope [String] The scope associated with budget operations. This
335
+ # includes '/subscriptions/{subscriptionId}/' for subscription scope,
336
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
337
+ # resourceGroup scope,
338
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
339
+ # Account scope,
340
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
341
+ # for Department scope,
342
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
343
+ # for EnrollmentAccount scope,
344
+ # '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
345
+ # Management Group scope,
346
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
347
+ # for billingProfile scope,
348
+ # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
349
+ # for invoiceSection scope.
350
+ # @param budget_name [String] Budget Name.
351
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
352
+ # will be added to the HTTP request.
353
+ #
354
+ #
355
+ def delete(scope, budget_name, custom_headers:nil)
356
+ response = delete_async(scope, budget_name, custom_headers:custom_headers).value!
357
+ nil
358
+ end
359
+
360
+ #
361
+ # The operation to delete a budget.
362
+ #
363
+ # @param scope [String] The scope associated with budget operations. This
364
+ # includes '/subscriptions/{subscriptionId}/' for subscription scope,
365
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
366
+ # resourceGroup scope,
367
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
368
+ # Account scope,
369
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
370
+ # for Department scope,
371
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
372
+ # for EnrollmentAccount scope,
373
+ # '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
374
+ # Management Group scope,
375
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
376
+ # for billingProfile scope,
377
+ # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
378
+ # for invoiceSection scope.
379
+ # @param budget_name [String] Budget Name.
380
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
381
+ # will be added to the HTTP request.
382
+ #
383
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
384
+ #
385
+ def delete_with_http_info(scope, budget_name, custom_headers:nil)
386
+ delete_async(scope, budget_name, custom_headers:custom_headers).value!
387
+ end
388
+
389
+ #
390
+ # The operation to delete a budget.
391
+ #
392
+ # @param scope [String] The scope associated with budget operations. This
393
+ # includes '/subscriptions/{subscriptionId}/' for subscription scope,
394
+ # '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
395
+ # resourceGroup scope,
396
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing
397
+ # Account scope,
398
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
399
+ # for Department scope,
400
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
401
+ # for EnrollmentAccount scope,
402
+ # '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for
403
+ # Management Group scope,
404
+ # '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
405
+ # for billingProfile scope,
406
+ # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
407
+ # for invoiceSection scope.
408
+ # @param budget_name [String] Budget Name.
409
+ # @param [Hash{String => String}] A hash of custom headers that will be added
410
+ # to the HTTP request.
411
+ #
412
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
413
+ #
414
+ def delete_async(scope, budget_name, custom_headers:nil)
415
+ fail ArgumentError, 'scope is nil' if scope.nil?
416
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
417
+ fail ArgumentError, 'budget_name is nil' if budget_name.nil?
418
+
419
+
420
+ request_headers = {}
421
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
422
+
423
+ # Set Headers
424
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
425
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
426
+ path_template = '{scope}/providers/Microsoft.CostManagement/budgets/{budgetName}'
427
+
428
+ request_url = @base_url || @client.base_url
429
+
430
+ options = {
431
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
432
+ path_params: {'budgetName' => budget_name},
433
+ skip_encoding_path_params: {'scope' => scope},
434
+ query_params: {'api-version' => @client.api_version},
435
+ headers: request_headers.merge(custom_headers || {}),
436
+ base_url: request_url
437
+ }
438
+ promise = @client.make_request_async(:delete, path_template, options)
439
+
440
+ promise = promise.then do |result|
441
+ http_response = result.response
442
+ status_code = http_response.status
443
+ response_content = http_response.body
444
+ unless status_code == 200 || status_code == 204
445
+ error_model = JSON.load(response_content)
446
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
447
+ end
448
+
449
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
450
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
451
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
452
+
453
+ result
454
+ end
455
+
456
+ promise.execute
457
+ end
458
+
459
+ end
460
+ end