azure_mgmt_time_series_insights 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (191) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights.rb +76 -0
  4. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/access_policies.rb +571 -0
  5. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/environments.rb +730 -0
  6. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/event_sources.rb +574 -0
  7. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/access_policy_create_or_update_parameters.rb +80 -0
  8. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/access_policy_list_response.rb +56 -0
  9. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/access_policy_resource.rb +109 -0
  10. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/access_policy_role.rb +16 -0
  11. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/access_policy_update_parameters.rb +68 -0
  12. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/azure_event_source_properties.rb +75 -0
  13. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/create_or_update_tracked_resource_properties.rb +67 -0
  14. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/environment_create_or_update_parameters.rb +101 -0
  15. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/environment_list_response.rb +56 -0
  16. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/environment_resource.rb +183 -0
  17. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/environment_update_parameters.rb +79 -0
  18. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/event_hub_event_source_common_properties.rb +118 -0
  19. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/event_hub_event_source_create_or_update_parameters.rb +190 -0
  20. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/event_hub_event_source_resource.rb +202 -0
  21. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/event_hub_event_source_update_parameters.rb +91 -0
  22. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/event_source_common_properties.rb +68 -0
  23. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/event_source_create_or_update_parameters.rb +68 -0
  24. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/event_source_list_response.rb +58 -0
  25. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/event_source_mutable_properties.rb +62 -0
  26. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/event_source_resource.rb +98 -0
  27. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/event_source_update_parameters.rb +55 -0
  28. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/io_thub_event_source_common_properties.rb +107 -0
  29. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/io_thub_event_source_create_or_update_parameters.rb +179 -0
  30. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/io_thub_event_source_resource.rb +191 -0
  31. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/io_thub_event_source_update_parameters.rb +91 -0
  32. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/local_timestamp.rb +67 -0
  33. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/local_timestamp_format.rb +17 -0
  34. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/local_timestamp_time_zone_offset.rb +54 -0
  35. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/operation.rb +62 -0
  36. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/operation_display.rb +86 -0
  37. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/operation_list_result.rb +104 -0
  38. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/provisioning_state.rb +20 -0
  39. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/reference_data_key_property_type.rb +18 -0
  40. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/reference_data_set_create_or_update_parameters.rb +81 -0
  41. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/reference_data_set_key_property.rb +60 -0
  42. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/reference_data_set_list_response.rb +56 -0
  43. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/reference_data_set_resource.rb +138 -0
  44. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/reference_data_set_update_parameters.rb +55 -0
  45. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/resource.rb +80 -0
  46. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/resource_properties.rb +62 -0
  47. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/sku.rb +65 -0
  48. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/sku_name.rb +16 -0
  49. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/storage_limit_exceeded_behavior.rb +16 -0
  50. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/models/tracked_resource.rb +92 -0
  51. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/module_definition.rb +9 -0
  52. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/operations.rb +219 -0
  53. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/reference_data_sets.rb +580 -0
  54. data/lib/2017-02-28-preview/generated/azure_mgmt_time_series_insights/time_series_insights_client.rb +148 -0
  55. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights.rb +83 -0
  56. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/access_policies.rb +571 -0
  57. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/environments.rb +736 -0
  58. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/event_sources.rb +574 -0
  59. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/access_policy_create_or_update_parameters.rb +80 -0
  60. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/access_policy_list_response.rb +56 -0
  61. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/access_policy_resource.rb +109 -0
  62. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/access_policy_role.rb +16 -0
  63. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/access_policy_update_parameters.rb +68 -0
  64. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/azure_event_source_properties.rb +74 -0
  65. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/create_or_update_tracked_resource_properties.rb +67 -0
  66. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/data_string_comparison_behavior.rb +16 -0
  67. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/environment_create_or_update_parameters.rb +123 -0
  68. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/environment_list_response.rb +56 -0
  69. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/environment_resource.rb +218 -0
  70. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/environment_state_details.rb +59 -0
  71. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/environment_status.rb +49 -0
  72. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/environment_update_parameters.rb +118 -0
  73. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/event_hub_event_source_common_properties.rb +117 -0
  74. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/event_hub_event_source_create_or_update_parameters.rb +189 -0
  75. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/event_hub_event_source_resource.rb +201 -0
  76. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/event_hub_event_source_update_parameters.rb +95 -0
  77. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/event_source_common_properties.rb +67 -0
  78. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/event_source_create_or_update_parameters.rb +68 -0
  79. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/event_source_list_response.rb +58 -0
  80. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/event_source_mutable_properties.rb +66 -0
  81. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/event_source_resource.rb +98 -0
  82. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/event_source_update_parameters.rb +55 -0
  83. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/ingress_environment_status.rb +63 -0
  84. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/ingress_state.rb +19 -0
  85. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/io_thub_event_source_common_properties.rb +106 -0
  86. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/io_thub_event_source_create_or_update_parameters.rb +178 -0
  87. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/io_thub_event_source_resource.rb +190 -0
  88. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/io_thub_event_source_update_parameters.rb +95 -0
  89. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/local_timestamp.rb +67 -0
  90. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/local_timestamp_format.rb +17 -0
  91. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/local_timestamp_time_zone_offset.rb +54 -0
  92. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/operation.rb +62 -0
  93. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/operation_display.rb +86 -0
  94. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/operation_list_result.rb +104 -0
  95. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/partition_key_property.rb +59 -0
  96. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/property_type.rb +15 -0
  97. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/provisioning_state.rb +20 -0
  98. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/reference_data_key_property_type.rb +18 -0
  99. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/reference_data_set_create_or_update_parameters.rb +99 -0
  100. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/reference_data_set_key_property.rb +60 -0
  101. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/reference_data_set_list_response.rb +56 -0
  102. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/reference_data_set_resource.rb +155 -0
  103. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/reference_data_set_update_parameters.rb +55 -0
  104. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/resource.rb +80 -0
  105. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/resource_properties.rb +61 -0
  106. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/sku.rb +65 -0
  107. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/sku_name.rb +16 -0
  108. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/storage_limit_exceeded_behavior.rb +16 -0
  109. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/models/tracked_resource.rb +92 -0
  110. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/module_definition.rb +9 -0
  111. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/operations.rb +219 -0
  112. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/reference_data_sets.rb +580 -0
  113. data/lib/2017-11-15/generated/azure_mgmt_time_series_insights/time_series_insights_client.rb +147 -0
  114. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights.rb +95 -0
  115. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/access_policies.rb +571 -0
  116. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/environments.rb +741 -0
  117. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/event_sources.rb +574 -0
  118. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/access_policy_create_or_update_parameters.rb +79 -0
  119. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/access_policy_list_response.rb +56 -0
  120. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/access_policy_resource.rb +108 -0
  121. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/access_policy_role.rb +16 -0
  122. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/access_policy_update_parameters.rb +67 -0
  123. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/azure_event_source_properties.rb +73 -0
  124. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/create_or_update_tracked_resource_properties.rb +67 -0
  125. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/data_string_comparison_behavior.rb +16 -0
  126. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/environment_create_or_update_parameters.rb +83 -0
  127. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/environment_list_response.rb +58 -0
  128. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/environment_resource.rb +111 -0
  129. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/environment_resource_properties.rb +93 -0
  130. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/environment_state_details.rb +59 -0
  131. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/environment_status.rb +62 -0
  132. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/environment_update_parameters.rb +55 -0
  133. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/event_hub_event_source_common_properties.rb +116 -0
  134. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/event_hub_event_source_create_or_update_parameters.rb +188 -0
  135. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/event_hub_event_source_resource.rb +200 -0
  136. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/event_hub_event_source_update_parameters.rb +95 -0
  137. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/event_source_common_properties.rb +66 -0
  138. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/event_source_create_or_update_parameters.rb +68 -0
  139. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/event_source_list_response.rb +58 -0
  140. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/event_source_mutable_properties.rb +66 -0
  141. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/event_source_resource.rb +98 -0
  142. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/event_source_update_parameters.rb +55 -0
  143. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/ingress_environment_status.rb +62 -0
  144. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/ingress_state.rb +19 -0
  145. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/io_thub_event_source_common_properties.rb +105 -0
  146. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/io_thub_event_source_create_or_update_parameters.rb +177 -0
  147. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/io_thub_event_source_resource.rb +189 -0
  148. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/io_thub_event_source_update_parameters.rb +95 -0
  149. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/local_timestamp.rb +66 -0
  150. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/local_timestamp_format.rb +17 -0
  151. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/local_timestamp_time_zone_offset.rb +54 -0
  152. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/long_term_environment_create_or_update_parameters.rb +133 -0
  153. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/long_term_environment_resource.rb +226 -0
  154. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/long_term_environment_update_parameters.rb +79 -0
  155. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/long_term_storage_configuration_input.rb +62 -0
  156. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/long_term_storage_configuration_mutable_properties.rb +51 -0
  157. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/long_term_storage_configuration_output.rb +49 -0
  158. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/operation.rb +62 -0
  159. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/operation_display.rb +86 -0
  160. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/operation_list_result.rb +104 -0
  161. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/property_type.rb +15 -0
  162. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/provisioning_state.rb +20 -0
  163. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/reference_data_key_property_type.rb +18 -0
  164. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/reference_data_set_create_or_update_parameters.rb +98 -0
  165. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/reference_data_set_key_property.rb +59 -0
  166. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/reference_data_set_list_response.rb +56 -0
  167. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/reference_data_set_resource.rb +153 -0
  168. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/reference_data_set_update_parameters.rb +55 -0
  169. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/resource.rb +80 -0
  170. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/resource_properties.rb +60 -0
  171. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/sku.rb +66 -0
  172. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/sku_name.rb +18 -0
  173. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/standard_environment_create_or_update_parameters.rb +135 -0
  174. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/standard_environment_resource.rb +228 -0
  175. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/standard_environment_update_parameters.rb +114 -0
  176. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/storage_limit_exceeded_behavior.rb +16 -0
  177. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/time_series_id_property.rb +59 -0
  178. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/tracked_resource.rb +92 -0
  179. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/warm_storage_environment_status.rb +82 -0
  180. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/models/warm_storage_properties_state.rb +17 -0
  181. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/module_definition.rb +9 -0
  182. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/operations.rb +219 -0
  183. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/reference_data_sets.rb +580 -0
  184. data/lib/2018-08-15-preview/generated/azure_mgmt_time_series_insights/time_series_insights_client.rb +147 -0
  185. data/lib/azure_mgmt_time_series_insights.rb +8 -0
  186. data/lib/module_definition.rb +7 -0
  187. data/lib/profiles/latest/modules/timeseriesinsights_profile_module.rb +321 -0
  188. data/lib/profiles/latest/timeseriesinsights_latest_profile_client.rb +40 -0
  189. data/lib/profiles/latest/timeseriesinsights_module_definition.rb +8 -0
  190. data/lib/version.rb +7 -0
  191. metadata +305 -0
@@ -0,0 +1,741 @@
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::TimeSeriesInsights::Mgmt::V2018_08_15_preview
7
+ #
8
+ # Time Series Insights client
9
+ #
10
+ class Environments
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Environments class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [TimeSeriesInsightsClient] reference to the TimeSeriesInsightsClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Create or update an environment in the specified subscription and resource
26
+ # group.
27
+ #
28
+ # @param resource_group_name [String] Name of an Azure Resource group.
29
+ # @param environment_name [String] Name of the environment
30
+ # @param parameters [EnvironmentCreateOrUpdateParameters] Parameters for
31
+ # creating an environment resource.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [EnvironmentResource] operation results.
36
+ #
37
+ def create_or_update(resource_group_name, environment_name, parameters, custom_headers:nil)
38
+ response = create_or_update_async(resource_group_name, environment_name, parameters, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # @param resource_group_name [String] Name of an Azure Resource group.
44
+ # @param environment_name [String] Name of the environment
45
+ # @param parameters [EnvironmentCreateOrUpdateParameters] Parameters for
46
+ # creating an environment resource.
47
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
48
+ # will be added to the HTTP request.
49
+ #
50
+ # @return [Concurrent::Promise] promise which provides async access to http
51
+ # response.
52
+ #
53
+ def create_or_update_async(resource_group_name, environment_name, parameters, custom_headers:nil)
54
+ # Send request
55
+ promise = begin_create_or_update_async(resource_group_name, environment_name, parameters, custom_headers:custom_headers)
56
+
57
+ promise = promise.then do |response|
58
+ # Defining deserialization method.
59
+ deserialize_method = lambda do |parsed_response|
60
+ result_mapper = Azure::TimeSeriesInsights::Mgmt::V2018_08_15_preview::Models::EnvironmentResource.mapper()
61
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
62
+ end
63
+
64
+ # Waiting for response.
65
+ @client.get_long_running_operation_result(response, deserialize_method)
66
+ end
67
+
68
+ promise
69
+ end
70
+
71
+ #
72
+ # Gets the environment with the specified name in the specified subscription
73
+ # and resource group.
74
+ #
75
+ # @param resource_group_name [String] Name of an Azure Resource group.
76
+ # @param environment_name [String] The name of the Time Series Insights
77
+ # environment associated with the specified resource group.
78
+ # @param expand [String] Setting $expand=status will include the status of the
79
+ # internal services of the environment in the Time Series Insights service.
80
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
81
+ # will be added to the HTTP request.
82
+ #
83
+ # @return [EnvironmentResource] operation results.
84
+ #
85
+ def get(resource_group_name, environment_name, expand:nil, custom_headers:nil)
86
+ response = get_async(resource_group_name, environment_name, expand:expand, custom_headers:custom_headers).value!
87
+ response.body unless response.nil?
88
+ end
89
+
90
+ #
91
+ # Gets the environment with the specified name in the specified subscription
92
+ # and resource group.
93
+ #
94
+ # @param resource_group_name [String] Name of an Azure Resource group.
95
+ # @param environment_name [String] The name of the Time Series Insights
96
+ # environment associated with the specified resource group.
97
+ # @param expand [String] Setting $expand=status will include the status of the
98
+ # internal services of the environment in the Time Series Insights service.
99
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
100
+ # will be added to the HTTP request.
101
+ #
102
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
103
+ #
104
+ def get_with_http_info(resource_group_name, environment_name, expand:nil, custom_headers:nil)
105
+ get_async(resource_group_name, environment_name, expand:expand, custom_headers:custom_headers).value!
106
+ end
107
+
108
+ #
109
+ # Gets the environment with the specified name in the specified subscription
110
+ # and resource group.
111
+ #
112
+ # @param resource_group_name [String] Name of an Azure Resource group.
113
+ # @param environment_name [String] The name of the Time Series Insights
114
+ # environment associated with the specified resource group.
115
+ # @param expand [String] Setting $expand=status will include the status of the
116
+ # internal services of the environment in the Time Series Insights service.
117
+ # @param [Hash{String => String}] A hash of custom headers that will be added
118
+ # to the HTTP request.
119
+ #
120
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
121
+ #
122
+ def get_async(resource_group_name, environment_name, expand:nil, custom_headers:nil)
123
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
124
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
125
+ fail ArgumentError, 'environment_name is nil' if environment_name.nil?
126
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
127
+
128
+
129
+ request_headers = {}
130
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
131
+
132
+ # Set Headers
133
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
134
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
135
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'
136
+
137
+ request_url = @base_url || @client.base_url
138
+
139
+ options = {
140
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
141
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'environmentName' => environment_name},
142
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
143
+ headers: request_headers.merge(custom_headers || {}),
144
+ base_url: request_url
145
+ }
146
+ promise = @client.make_request_async(:get, path_template, options)
147
+
148
+ promise = promise.then do |result|
149
+ http_response = result.response
150
+ status_code = http_response.status
151
+ response_content = http_response.body
152
+ unless status_code == 200
153
+ error_model = JSON.load(response_content)
154
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
155
+ end
156
+
157
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
158
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
159
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
160
+ # Deserialize Response
161
+ if status_code == 200
162
+ begin
163
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
164
+ result_mapper = Azure::TimeSeriesInsights::Mgmt::V2018_08_15_preview::Models::EnvironmentResource.mapper()
165
+ result.body = @client.deserialize(result_mapper, parsed_response)
166
+ rescue Exception => e
167
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
168
+ end
169
+ end
170
+
171
+ result
172
+ end
173
+
174
+ promise.execute
175
+ end
176
+
177
+ #
178
+ # Updates the environment with the specified name in the specified subscription
179
+ # and resource group.
180
+ #
181
+ # @param resource_group_name [String] Name of an Azure Resource group.
182
+ # @param environment_name [String] The name of the Time Series Insights
183
+ # environment associated with the specified resource group.
184
+ # @param standard_environment_update_parameters
185
+ # [StandardEnvironmentUpdateParameters] Request object that contains the
186
+ # updated information for the environment.
187
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
188
+ # will be added to the HTTP request.
189
+ #
190
+ # @return [EnvironmentResource] operation results.
191
+ #
192
+ def update(resource_group_name, environment_name, standard_environment_update_parameters, custom_headers:nil)
193
+ response = update_async(resource_group_name, environment_name, standard_environment_update_parameters, custom_headers:custom_headers).value!
194
+ response.body unless response.nil?
195
+ end
196
+
197
+ #
198
+ # @param resource_group_name [String] Name of an Azure Resource group.
199
+ # @param environment_name [String] The name of the Time Series Insights
200
+ # environment associated with the specified resource group.
201
+ # @param standard_environment_update_parameters
202
+ # [StandardEnvironmentUpdateParameters] Request object that contains the
203
+ # updated information for the environment.
204
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
205
+ # will be added to the HTTP request.
206
+ #
207
+ # @return [Concurrent::Promise] promise which provides async access to http
208
+ # response.
209
+ #
210
+ def update_async(resource_group_name, environment_name, standard_environment_update_parameters, custom_headers:nil)
211
+ # Send request
212
+ promise = begin_update_async(resource_group_name, environment_name, standard_environment_update_parameters, custom_headers:custom_headers)
213
+
214
+ promise = promise.then do |response|
215
+ # Defining deserialization method.
216
+ deserialize_method = lambda do |parsed_response|
217
+ result_mapper = Azure::TimeSeriesInsights::Mgmt::V2018_08_15_preview::Models::EnvironmentResource.mapper()
218
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
219
+ end
220
+
221
+ # Waiting for response.
222
+ @client.get_long_running_operation_result(response, deserialize_method)
223
+ end
224
+
225
+ promise
226
+ end
227
+
228
+ #
229
+ # Deletes the environment with the specified name in the specified subscription
230
+ # and resource group.
231
+ #
232
+ # @param resource_group_name [String] Name of an Azure Resource group.
233
+ # @param environment_name [String] The name of the Time Series Insights
234
+ # environment associated with the specified resource group.
235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
236
+ # will be added to the HTTP request.
237
+ #
238
+ #
239
+ def delete(resource_group_name, environment_name, custom_headers:nil)
240
+ response = delete_async(resource_group_name, environment_name, custom_headers:custom_headers).value!
241
+ nil
242
+ end
243
+
244
+ #
245
+ # Deletes the environment with the specified name in the specified subscription
246
+ # and resource group.
247
+ #
248
+ # @param resource_group_name [String] Name of an Azure Resource group.
249
+ # @param environment_name [String] The name of the Time Series Insights
250
+ # environment associated with the specified resource group.
251
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
252
+ # will be added to the HTTP request.
253
+ #
254
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
255
+ #
256
+ def delete_with_http_info(resource_group_name, environment_name, custom_headers:nil)
257
+ delete_async(resource_group_name, environment_name, custom_headers:custom_headers).value!
258
+ end
259
+
260
+ #
261
+ # Deletes the environment with the specified name in the specified subscription
262
+ # and resource group.
263
+ #
264
+ # @param resource_group_name [String] Name of an Azure Resource group.
265
+ # @param environment_name [String] The name of the Time Series Insights
266
+ # environment associated with the specified resource group.
267
+ # @param [Hash{String => String}] A hash of custom headers that will be added
268
+ # to the HTTP request.
269
+ #
270
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
271
+ #
272
+ def delete_async(resource_group_name, environment_name, custom_headers:nil)
273
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
274
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
275
+ fail ArgumentError, 'environment_name is nil' if environment_name.nil?
276
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
277
+
278
+
279
+ request_headers = {}
280
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
281
+
282
+ # Set Headers
283
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
284
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
285
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'
286
+
287
+ request_url = @base_url || @client.base_url
288
+
289
+ options = {
290
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
291
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'environmentName' => environment_name},
292
+ query_params: {'api-version' => @client.api_version},
293
+ headers: request_headers.merge(custom_headers || {}),
294
+ base_url: request_url
295
+ }
296
+ promise = @client.make_request_async(:delete, path_template, options)
297
+
298
+ promise = promise.then do |result|
299
+ http_response = result.response
300
+ status_code = http_response.status
301
+ response_content = http_response.body
302
+ unless status_code == 200 || status_code == 204
303
+ error_model = JSON.load(response_content)
304
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
305
+ end
306
+
307
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
308
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
309
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
310
+
311
+ result
312
+ end
313
+
314
+ promise.execute
315
+ end
316
+
317
+ #
318
+ # Lists all the available environments associated with the subscription and
319
+ # within the specified resource group.
320
+ #
321
+ # @param resource_group_name [String] Name of an Azure Resource group.
322
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
323
+ # will be added to the HTTP request.
324
+ #
325
+ # @return [EnvironmentListResponse] operation results.
326
+ #
327
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
328
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
329
+ response.body unless response.nil?
330
+ end
331
+
332
+ #
333
+ # Lists all the available environments associated with the subscription and
334
+ # within the specified resource group.
335
+ #
336
+ # @param resource_group_name [String] Name of an Azure Resource group.
337
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
338
+ # will be added to the HTTP request.
339
+ #
340
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
341
+ #
342
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
343
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
344
+ end
345
+
346
+ #
347
+ # Lists all the available environments associated with the subscription and
348
+ # within the specified resource group.
349
+ #
350
+ # @param resource_group_name [String] Name of an Azure Resource group.
351
+ # @param [Hash{String => String}] A hash of custom headers that will be added
352
+ # to the HTTP request.
353
+ #
354
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
355
+ #
356
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
357
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
358
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
359
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
360
+
361
+
362
+ request_headers = {}
363
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
364
+
365
+ # Set Headers
366
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
367
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
368
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments'
369
+
370
+ request_url = @base_url || @client.base_url
371
+
372
+ options = {
373
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
374
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
375
+ query_params: {'api-version' => @client.api_version},
376
+ headers: request_headers.merge(custom_headers || {}),
377
+ base_url: request_url
378
+ }
379
+ promise = @client.make_request_async(:get, path_template, options)
380
+
381
+ promise = promise.then do |result|
382
+ http_response = result.response
383
+ status_code = http_response.status
384
+ response_content = http_response.body
385
+ unless status_code == 200
386
+ error_model = JSON.load(response_content)
387
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
388
+ end
389
+
390
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
391
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
392
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
393
+ # Deserialize Response
394
+ if status_code == 200
395
+ begin
396
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
397
+ result_mapper = Azure::TimeSeriesInsights::Mgmt::V2018_08_15_preview::Models::EnvironmentListResponse.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
+ # Lists all the available environments within a subscription, irrespective of
412
+ # the resource groups.
413
+ #
414
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
415
+ # will be added to the HTTP request.
416
+ #
417
+ # @return [EnvironmentListResponse] operation results.
418
+ #
419
+ def list_by_subscription(custom_headers:nil)
420
+ response = list_by_subscription_async(custom_headers:custom_headers).value!
421
+ response.body unless response.nil?
422
+ end
423
+
424
+ #
425
+ # Lists all the available environments within a subscription, irrespective of
426
+ # the resource groups.
427
+ #
428
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
429
+ # will be added to the HTTP request.
430
+ #
431
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
432
+ #
433
+ def list_by_subscription_with_http_info(custom_headers:nil)
434
+ list_by_subscription_async(custom_headers:custom_headers).value!
435
+ end
436
+
437
+ #
438
+ # Lists all the available environments within a subscription, irrespective of
439
+ # the resource groups.
440
+ #
441
+ # @param [Hash{String => String}] A hash of custom headers that will be added
442
+ # to the HTTP request.
443
+ #
444
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
445
+ #
446
+ def list_by_subscription_async(custom_headers:nil)
447
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
448
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.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.TimeSeriesInsights/environments'
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},
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(:get, 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 MsRestAzure::AzureOperationError.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
+ # Deserialize Response
483
+ if status_code == 200
484
+ begin
485
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
486
+ result_mapper = Azure::TimeSeriesInsights::Mgmt::V2018_08_15_preview::Models::EnvironmentListResponse.mapper()
487
+ result.body = @client.deserialize(result_mapper, parsed_response)
488
+ rescue Exception => e
489
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
490
+ end
491
+ end
492
+
493
+ result
494
+ end
495
+
496
+ promise.execute
497
+ end
498
+
499
+ #
500
+ # Create or update an environment in the specified subscription and resource
501
+ # group.
502
+ #
503
+ # @param resource_group_name [String] Name of an Azure Resource group.
504
+ # @param environment_name [String] Name of the environment
505
+ # @param parameters [EnvironmentCreateOrUpdateParameters] Parameters for
506
+ # creating an environment resource.
507
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
508
+ # will be added to the HTTP request.
509
+ #
510
+ # @return [EnvironmentResource] operation results.
511
+ #
512
+ def begin_create_or_update(resource_group_name, environment_name, parameters, custom_headers:nil)
513
+ response = begin_create_or_update_async(resource_group_name, environment_name, parameters, custom_headers:custom_headers).value!
514
+ response.body unless response.nil?
515
+ end
516
+
517
+ #
518
+ # Create or update an environment in the specified subscription and resource
519
+ # group.
520
+ #
521
+ # @param resource_group_name [String] Name of an Azure Resource group.
522
+ # @param environment_name [String] Name of the environment
523
+ # @param parameters [EnvironmentCreateOrUpdateParameters] Parameters for
524
+ # creating an environment resource.
525
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
526
+ # will be added to the HTTP request.
527
+ #
528
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
529
+ #
530
+ def begin_create_or_update_with_http_info(resource_group_name, environment_name, parameters, custom_headers:nil)
531
+ begin_create_or_update_async(resource_group_name, environment_name, parameters, custom_headers:custom_headers).value!
532
+ end
533
+
534
+ #
535
+ # Create or update an environment in the specified subscription and resource
536
+ # group.
537
+ #
538
+ # @param resource_group_name [String] Name of an Azure Resource group.
539
+ # @param environment_name [String] Name of the environment
540
+ # @param parameters [EnvironmentCreateOrUpdateParameters] Parameters for
541
+ # creating an environment resource.
542
+ # @param [Hash{String => String}] A hash of custom headers that will be added
543
+ # to the HTTP request.
544
+ #
545
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
546
+ #
547
+ def begin_create_or_update_async(resource_group_name, environment_name, parameters, custom_headers:nil)
548
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
549
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
550
+ fail ArgumentError, 'environment_name is nil' if environment_name.nil?
551
+ fail ArgumentError, "'environment_name' should satisfy the constraint - 'MaxLength': '90'" if !environment_name.nil? && environment_name.length > 90
552
+ fail ArgumentError, "'environment_name' should satisfy the constraint - 'MinLength': '1'" if !environment_name.nil? && environment_name.length < 1
553
+ fail ArgumentError, "'environment_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !environment_name.nil? && environment_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
554
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
555
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
556
+
557
+
558
+ request_headers = {}
559
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
560
+
561
+ # Set Headers
562
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
563
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
564
+
565
+ # Serialize Request
566
+ request_mapper = Azure::TimeSeriesInsights::Mgmt::V2018_08_15_preview::Models::EnvironmentCreateOrUpdateParameters.mapper()
567
+ request_content = @client.serialize(request_mapper, parameters)
568
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
569
+
570
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'
571
+
572
+ request_url = @base_url || @client.base_url
573
+
574
+ options = {
575
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
576
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'environmentName' => environment_name},
577
+ query_params: {'api-version' => @client.api_version},
578
+ body: request_content,
579
+ headers: request_headers.merge(custom_headers || {}),
580
+ base_url: request_url
581
+ }
582
+ promise = @client.make_request_async(:put, path_template, options)
583
+
584
+ promise = promise.then do |result|
585
+ http_response = result.response
586
+ status_code = http_response.status
587
+ response_content = http_response.body
588
+ unless status_code == 200 || status_code == 201 || status_code == 404
589
+ error_model = JSON.load(response_content)
590
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
591
+ end
592
+
593
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
594
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
595
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
596
+ # Deserialize Response
597
+ if status_code == 200
598
+ begin
599
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
600
+ result_mapper = Azure::TimeSeriesInsights::Mgmt::V2018_08_15_preview::Models::EnvironmentResource.mapper()
601
+ result.body = @client.deserialize(result_mapper, parsed_response)
602
+ rescue Exception => e
603
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
604
+ end
605
+ end
606
+ # Deserialize Response
607
+ if status_code == 201
608
+ begin
609
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
610
+ result_mapper = Azure::TimeSeriesInsights::Mgmt::V2018_08_15_preview::Models::EnvironmentResource.mapper()
611
+ result.body = @client.deserialize(result_mapper, parsed_response)
612
+ rescue Exception => e
613
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
614
+ end
615
+ end
616
+
617
+ result
618
+ end
619
+
620
+ promise.execute
621
+ end
622
+
623
+ #
624
+ # Updates the environment with the specified name in the specified subscription
625
+ # and resource group.
626
+ #
627
+ # @param resource_group_name [String] Name of an Azure Resource group.
628
+ # @param environment_name [String] The name of the Time Series Insights
629
+ # environment associated with the specified resource group.
630
+ # @param standard_environment_update_parameters
631
+ # [StandardEnvironmentUpdateParameters] Request object that contains the
632
+ # updated information for the environment.
633
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
634
+ # will be added to the HTTP request.
635
+ #
636
+ # @return [EnvironmentResource] operation results.
637
+ #
638
+ def begin_update(resource_group_name, environment_name, standard_environment_update_parameters, custom_headers:nil)
639
+ response = begin_update_async(resource_group_name, environment_name, standard_environment_update_parameters, custom_headers:custom_headers).value!
640
+ response.body unless response.nil?
641
+ end
642
+
643
+ #
644
+ # Updates the environment with the specified name in the specified subscription
645
+ # and resource group.
646
+ #
647
+ # @param resource_group_name [String] Name of an Azure Resource group.
648
+ # @param environment_name [String] The name of the Time Series Insights
649
+ # environment associated with the specified resource group.
650
+ # @param standard_environment_update_parameters
651
+ # [StandardEnvironmentUpdateParameters] Request object that contains the
652
+ # updated information for the environment.
653
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
654
+ # will be added to the HTTP request.
655
+ #
656
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
657
+ #
658
+ def begin_update_with_http_info(resource_group_name, environment_name, standard_environment_update_parameters, custom_headers:nil)
659
+ begin_update_async(resource_group_name, environment_name, standard_environment_update_parameters, custom_headers:custom_headers).value!
660
+ end
661
+
662
+ #
663
+ # Updates the environment with the specified name in the specified subscription
664
+ # and resource group.
665
+ #
666
+ # @param resource_group_name [String] Name of an Azure Resource group.
667
+ # @param environment_name [String] The name of the Time Series Insights
668
+ # environment associated with the specified resource group.
669
+ # @param standard_environment_update_parameters
670
+ # [StandardEnvironmentUpdateParameters] Request object that contains the
671
+ # updated information for the environment.
672
+ # @param [Hash{String => String}] A hash of custom headers that will be added
673
+ # to the HTTP request.
674
+ #
675
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
676
+ #
677
+ def begin_update_async(resource_group_name, environment_name, standard_environment_update_parameters, custom_headers:nil)
678
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
679
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
680
+ fail ArgumentError, 'environment_name is nil' if environment_name.nil?
681
+ fail ArgumentError, 'standard_environment_update_parameters is nil' if standard_environment_update_parameters.nil?
682
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
683
+
684
+
685
+ request_headers = {}
686
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
687
+
688
+ # Set Headers
689
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
690
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
691
+
692
+ # Serialize Request
693
+ request_mapper = Azure::TimeSeriesInsights::Mgmt::V2018_08_15_preview::Models::StandardEnvironmentUpdateParameters.mapper()
694
+ request_content = @client.serialize(request_mapper, standard_environment_update_parameters)
695
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
696
+
697
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}'
698
+
699
+ request_url = @base_url || @client.base_url
700
+
701
+ options = {
702
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
703
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'environmentName' => environment_name},
704
+ query_params: {'api-version' => @client.api_version},
705
+ body: request_content,
706
+ headers: request_headers.merge(custom_headers || {}),
707
+ base_url: request_url
708
+ }
709
+ promise = @client.make_request_async(:patch, path_template, options)
710
+
711
+ promise = promise.then do |result|
712
+ http_response = result.response
713
+ status_code = http_response.status
714
+ response_content = http_response.body
715
+ unless status_code == 200
716
+ error_model = JSON.load(response_content)
717
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
718
+ end
719
+
720
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
721
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
722
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
723
+ # Deserialize Response
724
+ if status_code == 200
725
+ begin
726
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
727
+ result_mapper = Azure::TimeSeriesInsights::Mgmt::V2018_08_15_preview::Models::EnvironmentResource.mapper()
728
+ result.body = @client.deserialize(result_mapper, parsed_response)
729
+ rescue Exception => e
730
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
731
+ end
732
+ end
733
+
734
+ result
735
+ end
736
+
737
+ promise.execute
738
+ end
739
+
740
+ end
741
+ end