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,100 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CostManagement::Mgmt::V2018_05_31
7
+ module Models
8
+ #
9
+ # The Resource model definition.
10
+ #
11
+ class Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Resource Id.
16
+ attr_accessor :id
17
+
18
+ # @return [String] Resource name.
19
+ attr_accessor :name
20
+
21
+ # @return [String] Resource type.
22
+ attr_accessor :type
23
+
24
+ # @return [Hash{String => String}] Resource tags.
25
+ attr_accessor :tags
26
+
27
+
28
+ # @return [String] the name of the resource group of the resource.
29
+ def resource_group
30
+ unless self.id.nil?
31
+ groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/)
32
+ groups.captures[0].strip if groups
33
+ end
34
+ end
35
+
36
+
37
+ #
38
+ # Mapper for Resource class as Ruby Hash.
39
+ # This will be used for serialization/deserialization.
40
+ #
41
+ def self.mapper()
42
+ {
43
+ client_side_validation: true,
44
+ required: false,
45
+ serialized_name: 'Resource',
46
+ type: {
47
+ name: 'Composite',
48
+ class_name: 'Resource',
49
+ model_properties: {
50
+ id: {
51
+ client_side_validation: true,
52
+ required: false,
53
+ read_only: true,
54
+ serialized_name: 'id',
55
+ type: {
56
+ name: 'String'
57
+ }
58
+ },
59
+ name: {
60
+ client_side_validation: true,
61
+ required: false,
62
+ read_only: true,
63
+ serialized_name: 'name',
64
+ type: {
65
+ name: 'String'
66
+ }
67
+ },
68
+ type: {
69
+ client_side_validation: true,
70
+ required: false,
71
+ read_only: true,
72
+ serialized_name: 'type',
73
+ type: {
74
+ name: 'String'
75
+ }
76
+ },
77
+ tags: {
78
+ client_side_validation: true,
79
+ required: false,
80
+ read_only: true,
81
+ serialized_name: 'tags',
82
+ type: {
83
+ name: 'Dictionary',
84
+ value: {
85
+ client_side_validation: true,
86
+ required: false,
87
+ serialized_name: 'StringElementType',
88
+ type: {
89
+ name: 'String'
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ end
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CostManagement::Mgmt::V2018_05_31
7
+ module Models
8
+ #
9
+ # Defines values for StatusType
10
+ #
11
+ module StatusType
12
+ Active = "Active"
13
+ Inactive = "Inactive"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CostManagement::Mgmt::V2018_05_31
7
+ module Models
8
+ #
9
+ # Defines values for TimeframeType
10
+ #
11
+ module TimeframeType
12
+ WeekToDate = "WeekToDate"
13
+ MonthToDate = "MonthToDate"
14
+ YearToDate = "YearToDate"
15
+ Custom = "Custom"
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::CostManagement end
8
+ module Azure::CostManagement::Mgmt end
9
+ module Azure::CostManagement::Mgmt::V2018_05_31 end
@@ -0,0 +1,219 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CostManagement::Mgmt::V2018_05_31
7
+ #
8
+ # Operations
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations 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 all of the available consumption REST API operations.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [Array<Operation>] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ first_page = list_as_lazy(custom_headers:custom_headers)
34
+ first_page.get_all_items
35
+ end
36
+
37
+ #
38
+ # Lists all of the available consumption REST API operations.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists all of the available consumption REST API operations.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers:nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+
60
+
61
+ request_headers = {}
62
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
63
+
64
+ # Set Headers
65
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
66
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
67
+ path_template = 'providers/Microsoft.CostManagement/operations'
68
+
69
+ request_url = @base_url || @client.base_url
70
+
71
+ options = {
72
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
73
+ query_params: {'api-version' => @client.api_version},
74
+ headers: request_headers.merge(custom_headers || {}),
75
+ base_url: request_url
76
+ }
77
+ promise = @client.make_request_async(:get, path_template, options)
78
+
79
+ promise = promise.then do |result|
80
+ http_response = result.response
81
+ status_code = http_response.status
82
+ response_content = http_response.body
83
+ unless status_code == 200
84
+ error_model = JSON.load(response_content)
85
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
86
+ end
87
+
88
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
89
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
90
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
91
+ # Deserialize Response
92
+ if status_code == 200
93
+ begin
94
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
95
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::OperationListResult.mapper()
96
+ result.body = @client.deserialize(result_mapper, parsed_response)
97
+ rescue Exception => e
98
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
99
+ end
100
+ end
101
+
102
+ result
103
+ end
104
+
105
+ promise.execute
106
+ end
107
+
108
+ #
109
+ # Lists all of the available consumption REST API operations.
110
+ #
111
+ # @param next_page_link [String] The NextLink from the previous successful call
112
+ # to List operation.
113
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
114
+ # will be added to the HTTP request.
115
+ #
116
+ # @return [OperationListResult] operation results.
117
+ #
118
+ def list_next(next_page_link, custom_headers:nil)
119
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
120
+ response.body unless response.nil?
121
+ end
122
+
123
+ #
124
+ # Lists all of the available consumption REST API operations.
125
+ #
126
+ # @param next_page_link [String] The NextLink from the previous successful call
127
+ # to List operation.
128
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
129
+ # will be added to the HTTP request.
130
+ #
131
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
132
+ #
133
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
134
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
135
+ end
136
+
137
+ #
138
+ # Lists all of the available consumption REST API operations.
139
+ #
140
+ # @param next_page_link [String] The NextLink from the previous successful call
141
+ # to List operation.
142
+ # @param [Hash{String => String}] A hash of custom headers that will be added
143
+ # to the HTTP request.
144
+ #
145
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
146
+ #
147
+ def list_next_async(next_page_link, custom_headers:nil)
148
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
149
+
150
+
151
+ request_headers = {}
152
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
153
+
154
+ # Set Headers
155
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
156
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
157
+ path_template = '{nextLink}'
158
+
159
+ request_url = @base_url || @client.base_url
160
+
161
+ options = {
162
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
163
+ skip_encoding_path_params: {'nextLink' => next_page_link},
164
+ headers: request_headers.merge(custom_headers || {}),
165
+ base_url: request_url
166
+ }
167
+ promise = @client.make_request_async(:get, path_template, options)
168
+
169
+ promise = promise.then do |result|
170
+ http_response = result.response
171
+ status_code = http_response.status
172
+ response_content = http_response.body
173
+ unless status_code == 200
174
+ error_model = JSON.load(response_content)
175
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
176
+ end
177
+
178
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
179
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
180
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
181
+ # Deserialize Response
182
+ if status_code == 200
183
+ begin
184
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
185
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::OperationListResult.mapper()
186
+ result.body = @client.deserialize(result_mapper, parsed_response)
187
+ rescue Exception => e
188
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
189
+ end
190
+ end
191
+
192
+ result
193
+ end
194
+
195
+ promise.execute
196
+ end
197
+
198
+ #
199
+ # Lists all of the available consumption REST API operations.
200
+ #
201
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
202
+ # will be added to the HTTP request.
203
+ #
204
+ # @return [OperationListResult] which provide lazy access to pages of the
205
+ # response.
206
+ #
207
+ def list_as_lazy(custom_headers:nil)
208
+ response = list_async(custom_headers:custom_headers).value!
209
+ unless response.nil?
210
+ page = response.body
211
+ page.next_method = Proc.new do |next_page_link|
212
+ list_next_async(next_page_link, custom_headers:custom_headers)
213
+ end
214
+ page
215
+ end
216
+ end
217
+
218
+ end
219
+ end
@@ -0,0 +1,794 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::CostManagement::Mgmt::V2018_05_31
7
+ #
8
+ # ReportConfigOperations
9
+ #
10
+ class ReportConfigOperations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ReportConfigOperations 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 all report configs for a subscription.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [ReportConfigListResult] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ response = list_async(custom_headers:custom_headers).value!
34
+ response.body unless response.nil?
35
+ end
36
+
37
+ #
38
+ # Lists all report configs for a subscription.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists all report configs for a subscription.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers:nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
60
+
61
+
62
+ request_headers = {}
63
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
64
+
65
+ # Set Headers
66
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
67
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
68
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs'
69
+
70
+ request_url = @base_url || @client.base_url
71
+
72
+ options = {
73
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
74
+ path_params: {'subscriptionId' => @client.subscription_id},
75
+ query_params: {'api-version' => @client.api_version},
76
+ headers: request_headers.merge(custom_headers || {}),
77
+ base_url: request_url
78
+ }
79
+ promise = @client.make_request_async(:get, path_template, options)
80
+
81
+ promise = promise.then do |result|
82
+ http_response = result.response
83
+ status_code = http_response.status
84
+ response_content = http_response.body
85
+ unless status_code == 200
86
+ error_model = JSON.load(response_content)
87
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
88
+ end
89
+
90
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
91
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
92
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
93
+ # Deserialize Response
94
+ if status_code == 200
95
+ begin
96
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
97
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::ReportConfigListResult.mapper()
98
+ result.body = @client.deserialize(result_mapper, parsed_response)
99
+ rescue Exception => e
100
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
101
+ end
102
+ end
103
+
104
+ result
105
+ end
106
+
107
+ promise.execute
108
+ end
109
+
110
+ #
111
+ # Lists all report configs for a resource group under a subscription.
112
+ #
113
+ # @param resource_group_name [String] Azure Resource Group Name.
114
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
115
+ # will be added to the HTTP request.
116
+ #
117
+ # @return [ReportConfigListResult] operation results.
118
+ #
119
+ def list_by_resource_group_name(resource_group_name, custom_headers:nil)
120
+ response = list_by_resource_group_name_async(resource_group_name, custom_headers:custom_headers).value!
121
+ response.body unless response.nil?
122
+ end
123
+
124
+ #
125
+ # Lists all report configs for a resource group under a subscription.
126
+ #
127
+ # @param resource_group_name [String] Azure Resource Group Name.
128
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
129
+ # will be added to the HTTP request.
130
+ #
131
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
132
+ #
133
+ def list_by_resource_group_name_with_http_info(resource_group_name, custom_headers:nil)
134
+ list_by_resource_group_name_async(resource_group_name, custom_headers:custom_headers).value!
135
+ end
136
+
137
+ #
138
+ # Lists all report configs for a resource group under a subscription.
139
+ #
140
+ # @param resource_group_name [String] Azure Resource Group Name.
141
+ # @param [Hash{String => String}] A hash of custom headers that will be added
142
+ # to the HTTP request.
143
+ #
144
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
145
+ #
146
+ def list_by_resource_group_name_async(resource_group_name, custom_headers:nil)
147
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
148
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
149
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
150
+
151
+
152
+ request_headers = {}
153
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
154
+
155
+ # Set Headers
156
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
157
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
158
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs'
159
+
160
+ request_url = @base_url || @client.base_url
161
+
162
+ options = {
163
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
164
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
165
+ query_params: {'api-version' => @client.api_version},
166
+ headers: request_headers.merge(custom_headers || {}),
167
+ base_url: request_url
168
+ }
169
+ promise = @client.make_request_async(:get, path_template, options)
170
+
171
+ promise = promise.then do |result|
172
+ http_response = result.response
173
+ status_code = http_response.status
174
+ response_content = http_response.body
175
+ unless status_code == 200
176
+ error_model = JSON.load(response_content)
177
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
178
+ end
179
+
180
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
181
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
182
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
183
+ # Deserialize Response
184
+ if status_code == 200
185
+ begin
186
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
187
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::ReportConfigListResult.mapper()
188
+ result.body = @client.deserialize(result_mapper, parsed_response)
189
+ rescue Exception => e
190
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
191
+ end
192
+ end
193
+
194
+ result
195
+ end
196
+
197
+ promise.execute
198
+ end
199
+
200
+ #
201
+ # Gets the report config for a subscription by report config name.
202
+ #
203
+ # @param report_config_name [String] Report Config Name.
204
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
205
+ # will be added to the HTTP request.
206
+ #
207
+ # @return [ReportConfig] operation results.
208
+ #
209
+ def get(report_config_name, custom_headers:nil)
210
+ response = get_async(report_config_name, custom_headers:custom_headers).value!
211
+ response.body unless response.nil?
212
+ end
213
+
214
+ #
215
+ # Gets the report config for a subscription by report config name.
216
+ #
217
+ # @param report_config_name [String] Report Config Name.
218
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
219
+ # will be added to the HTTP request.
220
+ #
221
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
222
+ #
223
+ def get_with_http_info(report_config_name, custom_headers:nil)
224
+ get_async(report_config_name, custom_headers:custom_headers).value!
225
+ end
226
+
227
+ #
228
+ # Gets the report config for a subscription by report config name.
229
+ #
230
+ # @param report_config_name [String] Report Config Name.
231
+ # @param [Hash{String => String}] A hash of custom headers that will be added
232
+ # to the HTTP request.
233
+ #
234
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
235
+ #
236
+ def get_async(report_config_name, custom_headers:nil)
237
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
238
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
239
+ fail ArgumentError, 'report_config_name is nil' if report_config_name.nil?
240
+
241
+
242
+ request_headers = {}
243
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
244
+
245
+ # Set Headers
246
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
247
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
248
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'
249
+
250
+ request_url = @base_url || @client.base_url
251
+
252
+ options = {
253
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
254
+ path_params: {'subscriptionId' => @client.subscription_id,'reportConfigName' => report_config_name},
255
+ query_params: {'api-version' => @client.api_version},
256
+ headers: request_headers.merge(custom_headers || {}),
257
+ base_url: request_url
258
+ }
259
+ promise = @client.make_request_async(:get, path_template, options)
260
+
261
+ promise = promise.then do |result|
262
+ http_response = result.response
263
+ status_code = http_response.status
264
+ response_content = http_response.body
265
+ unless status_code == 200
266
+ error_model = JSON.load(response_content)
267
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
268
+ end
269
+
270
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
271
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
272
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
273
+ # Deserialize Response
274
+ if status_code == 200
275
+ begin
276
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
277
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::ReportConfig.mapper()
278
+ result.body = @client.deserialize(result_mapper, parsed_response)
279
+ rescue Exception => e
280
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
281
+ end
282
+ end
283
+
284
+ result
285
+ end
286
+
287
+ promise.execute
288
+ end
289
+
290
+ #
291
+ # The operation to create or update a report config. Update operation requires
292
+ # latest eTag to be set in the request mandatorily. You may obtain the latest
293
+ # eTag by performing a get operation. Create operation does not require eTag.
294
+ #
295
+ # @param report_config_name [String] Report Config Name.
296
+ # @param parameters [ReportConfig] Parameters supplied to the CreateOrUpdate
297
+ # Report Config operation.
298
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
299
+ # will be added to the HTTP request.
300
+ #
301
+ # @return [ReportConfig] operation results.
302
+ #
303
+ def create_or_update(report_config_name, parameters, custom_headers:nil)
304
+ response = create_or_update_async(report_config_name, parameters, custom_headers:custom_headers).value!
305
+ response.body unless response.nil?
306
+ end
307
+
308
+ #
309
+ # The operation to create or update a report config. Update operation requires
310
+ # latest eTag to be set in the request mandatorily. You may obtain the latest
311
+ # eTag by performing a get operation. Create operation does not require eTag.
312
+ #
313
+ # @param report_config_name [String] Report Config Name.
314
+ # @param parameters [ReportConfig] Parameters supplied to the CreateOrUpdate
315
+ # Report Config operation.
316
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
317
+ # will be added to the HTTP request.
318
+ #
319
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
320
+ #
321
+ def create_or_update_with_http_info(report_config_name, parameters, custom_headers:nil)
322
+ create_or_update_async(report_config_name, parameters, custom_headers:custom_headers).value!
323
+ end
324
+
325
+ #
326
+ # The operation to create or update a report config. Update operation requires
327
+ # latest eTag to be set in the request mandatorily. You may obtain the latest
328
+ # eTag by performing a get operation. Create operation does not require eTag.
329
+ #
330
+ # @param report_config_name [String] Report Config Name.
331
+ # @param parameters [ReportConfig] Parameters supplied to the CreateOrUpdate
332
+ # Report Config operation.
333
+ # @param [Hash{String => String}] A hash of custom headers that will be added
334
+ # to the HTTP request.
335
+ #
336
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
337
+ #
338
+ def create_or_update_async(report_config_name, parameters, custom_headers:nil)
339
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
340
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
341
+ fail ArgumentError, 'report_config_name is nil' if report_config_name.nil?
342
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
343
+
344
+
345
+ request_headers = {}
346
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
347
+
348
+ # Set Headers
349
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
350
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
351
+
352
+ # Serialize Request
353
+ request_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::ReportConfig.mapper()
354
+ request_content = @client.serialize(request_mapper, parameters)
355
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
356
+
357
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'
358
+
359
+ request_url = @base_url || @client.base_url
360
+
361
+ options = {
362
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
363
+ path_params: {'subscriptionId' => @client.subscription_id,'reportConfigName' => report_config_name},
364
+ query_params: {'api-version' => @client.api_version},
365
+ body: request_content,
366
+ headers: request_headers.merge(custom_headers || {}),
367
+ base_url: request_url
368
+ }
369
+ promise = @client.make_request_async(:put, path_template, options)
370
+
371
+ promise = promise.then do |result|
372
+ http_response = result.response
373
+ status_code = http_response.status
374
+ response_content = http_response.body
375
+ unless status_code == 200 || status_code == 201
376
+ error_model = JSON.load(response_content)
377
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
378
+ end
379
+
380
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
381
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
382
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
383
+ # Deserialize Response
384
+ if status_code == 200
385
+ begin
386
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
387
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::ReportConfig.mapper()
388
+ result.body = @client.deserialize(result_mapper, parsed_response)
389
+ rescue Exception => e
390
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
391
+ end
392
+ end
393
+ # Deserialize Response
394
+ if status_code == 201
395
+ begin
396
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
397
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::ReportConfig.mapper()
398
+ result.body = @client.deserialize(result_mapper, parsed_response)
399
+ rescue Exception => e
400
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
401
+ end
402
+ end
403
+
404
+ result
405
+ end
406
+
407
+ promise.execute
408
+ end
409
+
410
+ #
411
+ # The operation to delete a report.
412
+ #
413
+ # @param report_config_name [String] Report Config Name.
414
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
415
+ # will be added to the HTTP request.
416
+ #
417
+ #
418
+ def delete(report_config_name, custom_headers:nil)
419
+ response = delete_async(report_config_name, custom_headers:custom_headers).value!
420
+ nil
421
+ end
422
+
423
+ #
424
+ # The operation to delete a report.
425
+ #
426
+ # @param report_config_name [String] Report Config Name.
427
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
428
+ # will be added to the HTTP request.
429
+ #
430
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
431
+ #
432
+ def delete_with_http_info(report_config_name, custom_headers:nil)
433
+ delete_async(report_config_name, custom_headers:custom_headers).value!
434
+ end
435
+
436
+ #
437
+ # The operation to delete a report.
438
+ #
439
+ # @param report_config_name [String] Report Config Name.
440
+ # @param [Hash{String => String}] A hash of custom headers that will be added
441
+ # to the HTTP request.
442
+ #
443
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
444
+ #
445
+ def delete_async(report_config_name, custom_headers:nil)
446
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
447
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
448
+ fail ArgumentError, 'report_config_name is nil' if report_config_name.nil?
449
+
450
+
451
+ request_headers = {}
452
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
453
+
454
+ # Set Headers
455
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
456
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
457
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'
458
+
459
+ request_url = @base_url || @client.base_url
460
+
461
+ options = {
462
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
463
+ path_params: {'subscriptionId' => @client.subscription_id,'reportConfigName' => report_config_name},
464
+ query_params: {'api-version' => @client.api_version},
465
+ headers: request_headers.merge(custom_headers || {}),
466
+ base_url: request_url
467
+ }
468
+ promise = @client.make_request_async(:delete, path_template, options)
469
+
470
+ promise = promise.then do |result|
471
+ http_response = result.response
472
+ status_code = http_response.status
473
+ response_content = http_response.body
474
+ unless status_code == 200
475
+ error_model = JSON.load(response_content)
476
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
477
+ end
478
+
479
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
480
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
481
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
482
+
483
+ result
484
+ end
485
+
486
+ promise.execute
487
+ end
488
+
489
+ #
490
+ # Gets the report config for a resource group under a subscription by report
491
+ # config name.
492
+ #
493
+ # @param resource_group_name [String] Azure Resource Group Name.
494
+ # @param report_config_name [String] Report Config Name.
495
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
496
+ # will be added to the HTTP request.
497
+ #
498
+ # @return [ReportConfig] operation results.
499
+ #
500
+ def get_by_resource_group_name(resource_group_name, report_config_name, custom_headers:nil)
501
+ response = get_by_resource_group_name_async(resource_group_name, report_config_name, custom_headers:custom_headers).value!
502
+ response.body unless response.nil?
503
+ end
504
+
505
+ #
506
+ # Gets the report config for a resource group under a subscription by report
507
+ # config name.
508
+ #
509
+ # @param resource_group_name [String] Azure Resource Group Name.
510
+ # @param report_config_name [String] Report Config Name.
511
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
512
+ # will be added to the HTTP request.
513
+ #
514
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
515
+ #
516
+ def get_by_resource_group_name_with_http_info(resource_group_name, report_config_name, custom_headers:nil)
517
+ get_by_resource_group_name_async(resource_group_name, report_config_name, custom_headers:custom_headers).value!
518
+ end
519
+
520
+ #
521
+ # Gets the report config for a resource group under a subscription by report
522
+ # config name.
523
+ #
524
+ # @param resource_group_name [String] Azure Resource Group Name.
525
+ # @param report_config_name [String] Report Config Name.
526
+ # @param [Hash{String => String}] A hash of custom headers that will be added
527
+ # to the HTTP request.
528
+ #
529
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
530
+ #
531
+ def get_by_resource_group_name_async(resource_group_name, report_config_name, custom_headers:nil)
532
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
533
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
534
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
535
+ fail ArgumentError, 'report_config_name is nil' if report_config_name.nil?
536
+
537
+
538
+ request_headers = {}
539
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
540
+
541
+ # Set Headers
542
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
543
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
544
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'
545
+
546
+ request_url = @base_url || @client.base_url
547
+
548
+ options = {
549
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
550
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'reportConfigName' => report_config_name},
551
+ query_params: {'api-version' => @client.api_version},
552
+ headers: request_headers.merge(custom_headers || {}),
553
+ base_url: request_url
554
+ }
555
+ promise = @client.make_request_async(:get, path_template, options)
556
+
557
+ promise = promise.then do |result|
558
+ http_response = result.response
559
+ status_code = http_response.status
560
+ response_content = http_response.body
561
+ unless status_code == 200
562
+ error_model = JSON.load(response_content)
563
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
564
+ end
565
+
566
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
567
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
568
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
569
+ # Deserialize Response
570
+ if status_code == 200
571
+ begin
572
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
573
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::ReportConfig.mapper()
574
+ result.body = @client.deserialize(result_mapper, parsed_response)
575
+ rescue Exception => e
576
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
577
+ end
578
+ end
579
+
580
+ result
581
+ end
582
+
583
+ promise.execute
584
+ end
585
+
586
+ #
587
+ # The operation to create or update a report config. Update operation requires
588
+ # latest eTag to be set in the request mandatorily. You may obtain the latest
589
+ # eTag by performing a get operation. Create operation does not require eTag.
590
+ #
591
+ # @param resource_group_name [String] Azure Resource Group Name.
592
+ # @param report_config_name [String] Report Config Name.
593
+ # @param parameters [ReportConfig] Parameters supplied to the CreateOrUpdate
594
+ # Report Config operation.
595
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
596
+ # will be added to the HTTP request.
597
+ #
598
+ # @return [ReportConfig] operation results.
599
+ #
600
+ def create_or_update_by_resource_group_name(resource_group_name, report_config_name, parameters, custom_headers:nil)
601
+ response = create_or_update_by_resource_group_name_async(resource_group_name, report_config_name, parameters, custom_headers:custom_headers).value!
602
+ response.body unless response.nil?
603
+ end
604
+
605
+ #
606
+ # The operation to create or update a report config. Update operation requires
607
+ # latest eTag to be set in the request mandatorily. You may obtain the latest
608
+ # eTag by performing a get operation. Create operation does not require eTag.
609
+ #
610
+ # @param resource_group_name [String] Azure Resource Group Name.
611
+ # @param report_config_name [String] Report Config Name.
612
+ # @param parameters [ReportConfig] Parameters supplied to the CreateOrUpdate
613
+ # Report Config operation.
614
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
615
+ # will be added to the HTTP request.
616
+ #
617
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
618
+ #
619
+ def create_or_update_by_resource_group_name_with_http_info(resource_group_name, report_config_name, parameters, custom_headers:nil)
620
+ create_or_update_by_resource_group_name_async(resource_group_name, report_config_name, parameters, custom_headers:custom_headers).value!
621
+ end
622
+
623
+ #
624
+ # The operation to create or update a report config. Update operation requires
625
+ # latest eTag to be set in the request mandatorily. You may obtain the latest
626
+ # eTag by performing a get operation. Create operation does not require eTag.
627
+ #
628
+ # @param resource_group_name [String] Azure Resource Group Name.
629
+ # @param report_config_name [String] Report Config Name.
630
+ # @param parameters [ReportConfig] Parameters supplied to the CreateOrUpdate
631
+ # Report Config operation.
632
+ # @param [Hash{String => String}] A hash of custom headers that will be added
633
+ # to the HTTP request.
634
+ #
635
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
636
+ #
637
+ def create_or_update_by_resource_group_name_async(resource_group_name, report_config_name, parameters, custom_headers:nil)
638
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
639
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
640
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
641
+ fail ArgumentError, 'report_config_name is nil' if report_config_name.nil?
642
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
643
+
644
+
645
+ request_headers = {}
646
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
647
+
648
+ # Set Headers
649
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
650
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
651
+
652
+ # Serialize Request
653
+ request_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::ReportConfig.mapper()
654
+ request_content = @client.serialize(request_mapper, parameters)
655
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
656
+
657
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'
658
+
659
+ request_url = @base_url || @client.base_url
660
+
661
+ options = {
662
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
663
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'reportConfigName' => report_config_name},
664
+ query_params: {'api-version' => @client.api_version},
665
+ body: request_content,
666
+ headers: request_headers.merge(custom_headers || {}),
667
+ base_url: request_url
668
+ }
669
+ promise = @client.make_request_async(:put, path_template, options)
670
+
671
+ promise = promise.then do |result|
672
+ http_response = result.response
673
+ status_code = http_response.status
674
+ response_content = http_response.body
675
+ unless status_code == 200 || status_code == 201
676
+ error_model = JSON.load(response_content)
677
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
678
+ end
679
+
680
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
681
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
682
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
683
+ # Deserialize Response
684
+ if status_code == 200
685
+ begin
686
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
687
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::ReportConfig.mapper()
688
+ result.body = @client.deserialize(result_mapper, parsed_response)
689
+ rescue Exception => e
690
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
691
+ end
692
+ end
693
+ # Deserialize Response
694
+ if status_code == 201
695
+ begin
696
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
697
+ result_mapper = Azure::CostManagement::Mgmt::V2018_05_31::Models::ReportConfig.mapper()
698
+ result.body = @client.deserialize(result_mapper, parsed_response)
699
+ rescue Exception => e
700
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
701
+ end
702
+ end
703
+
704
+ result
705
+ end
706
+
707
+ promise.execute
708
+ end
709
+
710
+ #
711
+ # The operation to delete a report config.
712
+ #
713
+ # @param resource_group_name [String] Azure Resource Group Name.
714
+ # @param report_config_name [String] Report Config Name.
715
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
716
+ # will be added to the HTTP request.
717
+ #
718
+ #
719
+ def delete_by_resource_group_name(resource_group_name, report_config_name, custom_headers:nil)
720
+ response = delete_by_resource_group_name_async(resource_group_name, report_config_name, custom_headers:custom_headers).value!
721
+ nil
722
+ end
723
+
724
+ #
725
+ # The operation to delete a report config.
726
+ #
727
+ # @param resource_group_name [String] Azure Resource Group Name.
728
+ # @param report_config_name [String] Report Config Name.
729
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
730
+ # will be added to the HTTP request.
731
+ #
732
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
733
+ #
734
+ def delete_by_resource_group_name_with_http_info(resource_group_name, report_config_name, custom_headers:nil)
735
+ delete_by_resource_group_name_async(resource_group_name, report_config_name, custom_headers:custom_headers).value!
736
+ end
737
+
738
+ #
739
+ # The operation to delete a report config.
740
+ #
741
+ # @param resource_group_name [String] Azure Resource Group Name.
742
+ # @param report_config_name [String] Report Config Name.
743
+ # @param [Hash{String => String}] A hash of custom headers that will be added
744
+ # to the HTTP request.
745
+ #
746
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
747
+ #
748
+ def delete_by_resource_group_name_async(resource_group_name, report_config_name, custom_headers:nil)
749
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
750
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
751
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
752
+ fail ArgumentError, 'report_config_name is nil' if report_config_name.nil?
753
+
754
+
755
+ request_headers = {}
756
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
757
+
758
+ # Set Headers
759
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
760
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
761
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CostManagement/reportconfigs/{reportConfigName}'
762
+
763
+ request_url = @base_url || @client.base_url
764
+
765
+ options = {
766
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
767
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'reportConfigName' => report_config_name},
768
+ query_params: {'api-version' => @client.api_version},
769
+ headers: request_headers.merge(custom_headers || {}),
770
+ base_url: request_url
771
+ }
772
+ promise = @client.make_request_async(:delete, path_template, options)
773
+
774
+ promise = promise.then do |result|
775
+ http_response = result.response
776
+ status_code = http_response.status
777
+ response_content = http_response.body
778
+ unless status_code == 200
779
+ error_model = JSON.load(response_content)
780
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
781
+ end
782
+
783
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
784
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
785
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
786
+
787
+ result
788
+ end
789
+
790
+ promise.execute
791
+ end
792
+
793
+ end
794
+ end