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,164 @@
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
+ # 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 2019-03-01-preview
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 [Dimensions] dimensions
40
+ attr_reader :dimensions
41
+
42
+ # @return [QueryOperations] query_operations
43
+ attr_reader :query_operations
44
+
45
+ # @return [Forecast] forecast
46
+ attr_reader :forecast
47
+
48
+ # @return [CloudConnector] cloud_connector
49
+ attr_reader :cloud_connector
50
+
51
+ # @return [ExternalBillingAccount] external_billing_account
52
+ attr_reader :external_billing_account
53
+
54
+ # @return [ExternalSubscription] external_subscription
55
+ attr_reader :external_subscription
56
+
57
+ # @return [ShowbackRules] showback_rules
58
+ attr_reader :showback_rules
59
+
60
+ # @return [ShowbackRuleOperations] showback_rule_operations
61
+ attr_reader :showback_rule_operations
62
+
63
+ # @return [Operations] operations
64
+ attr_reader :operations
65
+
66
+ #
67
+ # Creates initializes a new instance of the CostManagementClient class.
68
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
69
+ # @param base_url [String] the base URI of the service.
70
+ # @param options [Array] filters to be applied to the HTTP requests.
71
+ #
72
+ def initialize(credentials = nil, base_url = nil, options = nil)
73
+ super(credentials, options)
74
+ @base_url = base_url || 'https://management.azure.com'
75
+
76
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
77
+ @credentials = credentials
78
+
79
+ @dimensions = Dimensions.new(self)
80
+ @query_operations = QueryOperations.new(self)
81
+ @forecast = Forecast.new(self)
82
+ @cloud_connector = CloudConnector.new(self)
83
+ @external_billing_account = ExternalBillingAccount.new(self)
84
+ @external_subscription = ExternalSubscription.new(self)
85
+ @showback_rules = ShowbackRules.new(self)
86
+ @showback_rule_operations = ShowbackRuleOperations.new(self)
87
+ @operations = Operations.new(self)
88
+ @api_version = '2019-03-01-preview'
89
+ @accept_language = 'en-US'
90
+ @long_running_operation_retry_timeout = 30
91
+ @generate_client_request_id = true
92
+ add_telemetry
93
+ end
94
+
95
+ #
96
+ # Makes a request and returns the body of the response.
97
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
98
+ # @param path [String] the path, relative to {base_url}.
99
+ # @param options [Hash{String=>String}] specifying any request options like :body.
100
+ # @return [Hash{String=>String}] containing the body of the response.
101
+ # Example:
102
+ #
103
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
104
+ # path = "/path"
105
+ # options = {
106
+ # body: request_content,
107
+ # query_params: {'api-version' => '2016-02-01'}
108
+ # }
109
+ # result = @client.make_request(:put, path, options)
110
+ #
111
+ def make_request(method, path, options = {})
112
+ result = make_request_with_http_info(method, path, options)
113
+ result.body unless result.nil?
114
+ end
115
+
116
+ #
117
+ # Makes a request and returns the operation response.
118
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
119
+ # @param path [String] the path, relative to {base_url}.
120
+ # @param options [Hash{String=>String}] specifying any request options like :body.
121
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
122
+ #
123
+ def make_request_with_http_info(method, path, options = {})
124
+ result = make_request_async(method, path, options).value!
125
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
126
+ result
127
+ end
128
+
129
+ #
130
+ # Makes a request asynchronously.
131
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
132
+ # @param path [String] the path, relative to {base_url}.
133
+ # @param options [Hash{String=>String}] specifying any request options like :body.
134
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
135
+ #
136
+ def make_request_async(method, path, options = {})
137
+ fail ArgumentError, 'method is nil' if method.nil?
138
+ fail ArgumentError, 'path is nil' if path.nil?
139
+
140
+ request_url = options[:base_url] || @base_url
141
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
142
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
143
+ end
144
+
145
+ request_headers = @request_headers
146
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
147
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
148
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
149
+
150
+ super(request_url, method, path, options)
151
+ end
152
+
153
+
154
+ private
155
+ #
156
+ # Adds telemetry information.
157
+ #
158
+ def add_telemetry
159
+ sdk_information = 'azure_mgmt_cost_management'
160
+ sdk_information = "#{sdk_information}/0.17.0"
161
+ add_user_agent_information(sdk_information)
162
+ end
163
+ end
164
+ end
@@ -0,0 +1,775 @@
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
+ # Dimensions
9
+ #
10
+ class Dimensions
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Dimensions 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_by_billing_account(billing_account_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
45
+ response = list_by_billing_account_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_by_billing_account_with_http_info(billing_account_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
70
+ list_by_billing_account_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_by_billing_account_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::V2019_03_01_preview::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
+ #
149
+ # Lists the dimensions by Enrollment Account Id.
150
+ #
151
+ # @param billing_account_id [String] BillingAccount ID
152
+ # @param enrollment_account_id [String] Enrollment Account ID
153
+ # @param filter [String] May be used to filter dimensions by
154
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
155
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
156
+ # @param expand [String] May be used to expand the properties/data within a
157
+ # dimension category. By default, data is not included when listing dimensions.
158
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
159
+ # returned a partial result. If a previous response contains a nextLink
160
+ # element, the value of the nextLink element will include a skiptoken parameter
161
+ # that specifies a starting point to use for subsequent calls.
162
+ # @param top [Integer] May be used to limit the number of results to the most
163
+ # recent N dimension data.
164
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
165
+ # will be added to the HTTP request.
166
+ #
167
+ # @return [DimensionsListResult] operation results.
168
+ #
169
+ def list_by_enrollment_account(billing_account_id, enrollment_account_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
170
+ response = list_by_enrollment_account_async(billing_account_id, enrollment_account_id, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
171
+ response.body unless response.nil?
172
+ end
173
+
174
+ #
175
+ # Lists the dimensions by Enrollment Account Id.
176
+ #
177
+ # @param billing_account_id [String] BillingAccount ID
178
+ # @param enrollment_account_id [String] Enrollment Account ID
179
+ # @param filter [String] May be used to filter dimensions by
180
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
181
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
182
+ # @param expand [String] May be used to expand the properties/data within a
183
+ # dimension category. By default, data is not included when listing dimensions.
184
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
185
+ # returned a partial result. If a previous response contains a nextLink
186
+ # element, the value of the nextLink element will include a skiptoken parameter
187
+ # that specifies a starting point to use for subsequent calls.
188
+ # @param top [Integer] May be used to limit the number of results to the most
189
+ # recent N dimension data.
190
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
191
+ # will be added to the HTTP request.
192
+ #
193
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
194
+ #
195
+ def list_by_enrollment_account_with_http_info(billing_account_id, enrollment_account_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
196
+ list_by_enrollment_account_async(billing_account_id, enrollment_account_id, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
197
+ end
198
+
199
+ #
200
+ # Lists the dimensions by Enrollment Account Id.
201
+ #
202
+ # @param billing_account_id [String] BillingAccount ID
203
+ # @param enrollment_account_id [String] Enrollment Account ID
204
+ # @param filter [String] May be used to filter dimensions by
205
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
206
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
207
+ # @param expand [String] May be used to expand the properties/data within a
208
+ # dimension category. By default, data is not included when listing dimensions.
209
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
210
+ # returned a partial result. If a previous response contains a nextLink
211
+ # element, the value of the nextLink element will include a skiptoken parameter
212
+ # that specifies a starting point to use for subsequent calls.
213
+ # @param top [Integer] May be used to limit the number of results to the most
214
+ # recent N dimension data.
215
+ # @param [Hash{String => String}] A hash of custom headers that will be added
216
+ # to the HTTP request.
217
+ #
218
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
219
+ #
220
+ def list_by_enrollment_account_async(billing_account_id, enrollment_account_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
221
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
222
+ fail ArgumentError, 'billing_account_id is nil' if billing_account_id.nil?
223
+ fail ArgumentError, 'enrollment_account_id is nil' if enrollment_account_id.nil?
224
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000
225
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
226
+
227
+
228
+ request_headers = {}
229
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
230
+
231
+ # Set Headers
232
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
233
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
234
+ path_template = 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}/providers/Microsoft.CostManagement/dimensions'
235
+
236
+ request_url = @base_url || @client.base_url
237
+
238
+ options = {
239
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
240
+ path_params: {'billingAccountId' => billing_account_id,'enrollmentAccountId' => enrollment_account_id},
241
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
242
+ headers: request_headers.merge(custom_headers || {}),
243
+ base_url: request_url
244
+ }
245
+ promise = @client.make_request_async(:get, path_template, options)
246
+
247
+ promise = promise.then do |result|
248
+ http_response = result.response
249
+ status_code = http_response.status
250
+ response_content = http_response.body
251
+ unless status_code == 200
252
+ error_model = JSON.load(response_content)
253
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
254
+ end
255
+
256
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
257
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
258
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
259
+ # Deserialize Response
260
+ if status_code == 200
261
+ begin
262
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
263
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::DimensionsListResult.mapper()
264
+ result.body = @client.deserialize(result_mapper, parsed_response)
265
+ rescue Exception => e
266
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
267
+ end
268
+ end
269
+
270
+ result
271
+ end
272
+
273
+ promise.execute
274
+ end
275
+
276
+ #
277
+ # Lists the dimensions by Department Id.
278
+ #
279
+ # @param billing_account_id [String] BillingAccount ID
280
+ # @param department_id [String] Department ID
281
+ # @param filter [String] May be used to filter dimensions by
282
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
283
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
284
+ # @param expand [String] May be used to expand the properties/data within a
285
+ # dimension category. By default, data is not included when listing dimensions.
286
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
287
+ # returned a partial result. If a previous response contains a nextLink
288
+ # element, the value of the nextLink element will include a skiptoken parameter
289
+ # that specifies a starting point to use for subsequent calls.
290
+ # @param top [Integer] May be used to limit the number of results to the most
291
+ # recent N dimension data.
292
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
293
+ # will be added to the HTTP request.
294
+ #
295
+ # @return [DimensionsListResult] operation results.
296
+ #
297
+ def list_by_department(billing_account_id, department_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
298
+ response = list_by_department_async(billing_account_id, department_id, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
299
+ response.body unless response.nil?
300
+ end
301
+
302
+ #
303
+ # Lists the dimensions by Department Id.
304
+ #
305
+ # @param billing_account_id [String] BillingAccount ID
306
+ # @param department_id [String] Department ID
307
+ # @param filter [String] May be used to filter dimensions by
308
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
309
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
310
+ # @param expand [String] May be used to expand the properties/data within a
311
+ # dimension category. By default, data is not included when listing dimensions.
312
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
313
+ # returned a partial result. If a previous response contains a nextLink
314
+ # element, the value of the nextLink element will include a skiptoken parameter
315
+ # that specifies a starting point to use for subsequent calls.
316
+ # @param top [Integer] May be used to limit the number of results to the most
317
+ # recent N dimension data.
318
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
319
+ # will be added to the HTTP request.
320
+ #
321
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
322
+ #
323
+ def list_by_department_with_http_info(billing_account_id, department_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
324
+ list_by_department_async(billing_account_id, department_id, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
325
+ end
326
+
327
+ #
328
+ # Lists the dimensions by Department Id.
329
+ #
330
+ # @param billing_account_id [String] BillingAccount ID
331
+ # @param department_id [String] Department ID
332
+ # @param filter [String] May be used to filter dimensions by
333
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
334
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
335
+ # @param expand [String] May be used to expand the properties/data within a
336
+ # dimension category. By default, data is not included when listing dimensions.
337
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
338
+ # returned a partial result. If a previous response contains a nextLink
339
+ # element, the value of the nextLink element will include a skiptoken parameter
340
+ # that specifies a starting point to use for subsequent calls.
341
+ # @param top [Integer] May be used to limit the number of results to the most
342
+ # recent N dimension data.
343
+ # @param [Hash{String => String}] A hash of custom headers that will be added
344
+ # to the HTTP request.
345
+ #
346
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
347
+ #
348
+ def list_by_department_async(billing_account_id, department_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
349
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
350
+ fail ArgumentError, 'billing_account_id is nil' if billing_account_id.nil?
351
+ fail ArgumentError, 'department_id is nil' if department_id.nil?
352
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000
353
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
354
+
355
+
356
+ request_headers = {}
357
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
358
+
359
+ # Set Headers
360
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
361
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
362
+ path_template = 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.CostManagement/dimensions'
363
+
364
+ request_url = @base_url || @client.base_url
365
+
366
+ options = {
367
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
368
+ path_params: {'billingAccountId' => billing_account_id,'departmentId' => department_id},
369
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
370
+ headers: request_headers.merge(custom_headers || {}),
371
+ base_url: request_url
372
+ }
373
+ promise = @client.make_request_async(:get, path_template, options)
374
+
375
+ promise = promise.then do |result|
376
+ http_response = result.response
377
+ status_code = http_response.status
378
+ response_content = http_response.body
379
+ unless status_code == 200
380
+ error_model = JSON.load(response_content)
381
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
382
+ end
383
+
384
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
385
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
386
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
387
+ # Deserialize Response
388
+ if status_code == 200
389
+ begin
390
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
391
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::DimensionsListResult.mapper()
392
+ result.body = @client.deserialize(result_mapper, parsed_response)
393
+ rescue Exception => e
394
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
395
+ end
396
+ end
397
+
398
+ result
399
+ end
400
+
401
+ promise.execute
402
+ end
403
+
404
+ #
405
+ # Lists the dimensions by managementGroup Id.
406
+ #
407
+ # @param management_group_id [String] ManagementGroup ID
408
+ # @param filter [String] May be used to filter dimensions by
409
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
410
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
411
+ # @param expand [String] May be used to expand the properties/data within a
412
+ # dimension category. By default, data is not included when listing dimensions.
413
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
414
+ # returned a partial result. If a previous response contains a nextLink
415
+ # element, the value of the nextLink element will include a skiptoken parameter
416
+ # that specifies a starting point to use for subsequent calls.
417
+ # @param top [Integer] May be used to limit the number of results to the most
418
+ # recent N dimension data.
419
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
420
+ # will be added to the HTTP request.
421
+ #
422
+ # @return [DimensionsListResult] operation results.
423
+ #
424
+ def list_by_management_group(management_group_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
425
+ response = list_by_management_group_async(management_group_id, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
426
+ response.body unless response.nil?
427
+ end
428
+
429
+ #
430
+ # Lists the dimensions by managementGroup Id.
431
+ #
432
+ # @param management_group_id [String] ManagementGroup ID
433
+ # @param filter [String] May be used to filter dimensions by
434
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
435
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
436
+ # @param expand [String] May be used to expand the properties/data within a
437
+ # dimension category. By default, data is not included when listing dimensions.
438
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
439
+ # returned a partial result. If a previous response contains a nextLink
440
+ # element, the value of the nextLink element will include a skiptoken parameter
441
+ # that specifies a starting point to use for subsequent calls.
442
+ # @param top [Integer] May be used to limit the number of results to the most
443
+ # recent N dimension data.
444
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
445
+ # will be added to the HTTP request.
446
+ #
447
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
448
+ #
449
+ def list_by_management_group_with_http_info(management_group_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
450
+ list_by_management_group_async(management_group_id, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
451
+ end
452
+
453
+ #
454
+ # Lists the dimensions by managementGroup Id.
455
+ #
456
+ # @param management_group_id [String] ManagementGroup ID
457
+ # @param filter [String] May be used to filter dimensions by
458
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
459
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
460
+ # @param expand [String] May be used to expand the properties/data within a
461
+ # dimension category. By default, data is not included when listing dimensions.
462
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
463
+ # returned a partial result. If a previous response contains a nextLink
464
+ # element, the value of the nextLink element will include a skiptoken parameter
465
+ # that specifies a starting point to use for subsequent calls.
466
+ # @param top [Integer] May be used to limit the number of results to the most
467
+ # recent N dimension data.
468
+ # @param [Hash{String => String}] A hash of custom headers that will be added
469
+ # to the HTTP request.
470
+ #
471
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
472
+ #
473
+ def list_by_management_group_async(management_group_id, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
474
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
475
+ fail ArgumentError, 'management_group_id is nil' if management_group_id.nil?
476
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000
477
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
478
+
479
+
480
+ request_headers = {}
481
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
482
+
483
+ # Set Headers
484
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
485
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
486
+ path_template = 'providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.CostManagement/dimensions'
487
+
488
+ request_url = @base_url || @client.base_url
489
+
490
+ options = {
491
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
492
+ path_params: {'managementGroupId' => management_group_id},
493
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
494
+ headers: request_headers.merge(custom_headers || {}),
495
+ base_url: request_url
496
+ }
497
+ promise = @client.make_request_async(:get, path_template, options)
498
+
499
+ promise = promise.then do |result|
500
+ http_response = result.response
501
+ status_code = http_response.status
502
+ response_content = http_response.body
503
+ unless status_code == 200
504
+ error_model = JSON.load(response_content)
505
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
506
+ end
507
+
508
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
509
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
510
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
511
+ # Deserialize Response
512
+ if status_code == 200
513
+ begin
514
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
515
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::DimensionsListResult.mapper()
516
+ result.body = @client.deserialize(result_mapper, parsed_response)
517
+ rescue Exception => e
518
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
519
+ end
520
+ end
521
+
522
+ result
523
+ end
524
+
525
+ promise.execute
526
+ end
527
+
528
+ #
529
+ # Lists the dimensions by subscription Id.
530
+ #
531
+ # @param filter [String] May be used to filter dimensions by
532
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
533
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
534
+ # @param expand [String] May be used to expand the properties/data within a
535
+ # dimension category. By default, data is not included when listing dimensions.
536
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
537
+ # returned a partial result. If a previous response contains a nextLink
538
+ # element, the value of the nextLink element will include a skiptoken parameter
539
+ # that specifies a starting point to use for subsequent calls.
540
+ # @param top [Integer] May be used to limit the number of results to the most
541
+ # recent N dimension data.
542
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
543
+ # will be added to the HTTP request.
544
+ #
545
+ # @return [DimensionsListResult] operation results.
546
+ #
547
+ def list_by_subscription(filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
548
+ response = list_by_subscription_async(filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
549
+ response.body unless response.nil?
550
+ end
551
+
552
+ #
553
+ # Lists the dimensions by subscription Id.
554
+ #
555
+ # @param filter [String] May be used to filter dimensions by
556
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
557
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
558
+ # @param expand [String] May be used to expand the properties/data within a
559
+ # dimension category. By default, data is not included when listing dimensions.
560
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
561
+ # returned a partial result. If a previous response contains a nextLink
562
+ # element, the value of the nextLink element will include a skiptoken parameter
563
+ # that specifies a starting point to use for subsequent calls.
564
+ # @param top [Integer] May be used to limit the number of results to the most
565
+ # recent N dimension data.
566
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
567
+ # will be added to the HTTP request.
568
+ #
569
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
570
+ #
571
+ def list_by_subscription_with_http_info(filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
572
+ list_by_subscription_async(filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
573
+ end
574
+
575
+ #
576
+ # Lists the dimensions by subscription Id.
577
+ #
578
+ # @param filter [String] May be used to filter dimensions by
579
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
580
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
581
+ # @param expand [String] May be used to expand the properties/data within a
582
+ # dimension category. By default, data is not included when listing dimensions.
583
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
584
+ # returned a partial result. If a previous response contains a nextLink
585
+ # element, the value of the nextLink element will include a skiptoken parameter
586
+ # that specifies a starting point to use for subsequent calls.
587
+ # @param top [Integer] May be used to limit the number of results to the most
588
+ # recent N dimension data.
589
+ # @param [Hash{String => String}] A hash of custom headers that will be added
590
+ # to the HTTP request.
591
+ #
592
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
593
+ #
594
+ def list_by_subscription_async(filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
595
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
596
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
597
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000
598
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
599
+
600
+
601
+ request_headers = {}
602
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
603
+
604
+ # Set Headers
605
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
606
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
607
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/dimensions'
608
+
609
+ request_url = @base_url || @client.base_url
610
+
611
+ options = {
612
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
613
+ path_params: {'subscriptionId' => @client.subscription_id},
614
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
615
+ headers: request_headers.merge(custom_headers || {}),
616
+ base_url: request_url
617
+ }
618
+ promise = @client.make_request_async(:get, path_template, options)
619
+
620
+ promise = promise.then do |result|
621
+ http_response = result.response
622
+ status_code = http_response.status
623
+ response_content = http_response.body
624
+ unless status_code == 200
625
+ error_model = JSON.load(response_content)
626
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
627
+ end
628
+
629
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
630
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
631
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
632
+ # Deserialize Response
633
+ if status_code == 200
634
+ begin
635
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
636
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::DimensionsListResult.mapper()
637
+ result.body = @client.deserialize(result_mapper, parsed_response)
638
+ rescue Exception => e
639
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
640
+ end
641
+ end
642
+
643
+ result
644
+ end
645
+
646
+ promise.execute
647
+ end
648
+
649
+ #
650
+ # Lists the dimensions by resource group Id.
651
+ #
652
+ # @param resource_group_name [String] Azure Resource Group Name.
653
+ # @param filter [String] May be used to filter dimensions by
654
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
655
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
656
+ # @param expand [String] May be used to expand the properties/data within a
657
+ # dimension category. By default, data is not included when listing dimensions.
658
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
659
+ # returned a partial result. If a previous response contains a nextLink
660
+ # element, the value of the nextLink element will include a skiptoken parameter
661
+ # that specifies a starting point to use for subsequent calls.
662
+ # @param top [Integer] May be used to limit the number of results to the most
663
+ # recent N dimension data.
664
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
665
+ # will be added to the HTTP request.
666
+ #
667
+ # @return [DimensionsListResult] operation results.
668
+ #
669
+ def list_by_resource_group(resource_group_name, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
670
+ response = list_by_resource_group_async(resource_group_name, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
671
+ response.body unless response.nil?
672
+ end
673
+
674
+ #
675
+ # Lists the dimensions by resource group Id.
676
+ #
677
+ # @param resource_group_name [String] Azure Resource Group Name.
678
+ # @param filter [String] May be used to filter dimensions by
679
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
680
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
681
+ # @param expand [String] May be used to expand the properties/data within a
682
+ # dimension category. By default, data is not included when listing dimensions.
683
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
684
+ # returned a partial result. If a previous response contains a nextLink
685
+ # element, the value of the nextLink element will include a skiptoken parameter
686
+ # that specifies a starting point to use for subsequent calls.
687
+ # @param top [Integer] May be used to limit the number of results to the most
688
+ # recent N dimension data.
689
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
690
+ # will be added to the HTTP request.
691
+ #
692
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
693
+ #
694
+ def list_by_resource_group_with_http_info(resource_group_name, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
695
+ list_by_resource_group_async(resource_group_name, filter:filter, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
696
+ end
697
+
698
+ #
699
+ # Lists the dimensions by resource group Id.
700
+ #
701
+ # @param resource_group_name [String] Azure Resource Group Name.
702
+ # @param filter [String] May be used to filter dimensions by
703
+ # properties/category, properties/usageStart, properties/usageEnd. Supported
704
+ # operators are 'eq','lt', 'gt', 'le', 'ge'.
705
+ # @param expand [String] May be used to expand the properties/data within a
706
+ # dimension category. By default, data is not included when listing dimensions.
707
+ # @param skiptoken [String] Skiptoken is only used if a previous operation
708
+ # returned a partial result. If a previous response contains a nextLink
709
+ # element, the value of the nextLink element will include a skiptoken parameter
710
+ # that specifies a starting point to use for subsequent calls.
711
+ # @param top [Integer] May be used to limit the number of results to the most
712
+ # recent N dimension data.
713
+ # @param [Hash{String => String}] A hash of custom headers that will be added
714
+ # to the HTTP request.
715
+ #
716
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
717
+ #
718
+ def list_by_resource_group_async(resource_group_name, filter:nil, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
719
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
720
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
721
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
722
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !top.nil? && top > 1000
723
+ fail ArgumentError, "'top' should satisfy the constraint - 'InclusiveMinimum': '1'" if !top.nil? && top < 1
724
+
725
+
726
+ request_headers = {}
727
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
728
+
729
+ # Set Headers
730
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
731
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
732
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/dimensions'
733
+
734
+ request_url = @base_url || @client.base_url
735
+
736
+ options = {
737
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
738
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
739
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$expand' => expand,'$skiptoken' => skiptoken,'$top' => top},
740
+ headers: request_headers.merge(custom_headers || {}),
741
+ base_url: request_url
742
+ }
743
+ promise = @client.make_request_async(:get, path_template, options)
744
+
745
+ promise = promise.then do |result|
746
+ http_response = result.response
747
+ status_code = http_response.status
748
+ response_content = http_response.body
749
+ unless status_code == 200
750
+ error_model = JSON.load(response_content)
751
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
752
+ end
753
+
754
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
755
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
756
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
757
+ # Deserialize Response
758
+ if status_code == 200
759
+ begin
760
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
761
+ result_mapper = Azure::CostManagement::Mgmt::V2019_03_01_preview::Models::DimensionsListResult.mapper()
762
+ result.body = @client.deserialize(result_mapper, parsed_response)
763
+ rescue Exception => e
764
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
765
+ end
766
+ end
767
+
768
+ result
769
+ end
770
+
771
+ promise.execute
772
+ end
773
+
774
+ end
775
+ end