azure_mgmt_storage 0.21.2 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  3. data/lib/2015-06-15/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  4. data/lib/2016-01-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  5. data/lib/2016-12-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  6. data/lib/2017-06-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  7. data/lib/2017-10-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  8. data/lib/2018-02-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  9. data/lib/2018-03-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  10. data/lib/2018-07-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  11. data/lib/2018-11-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  12. data/lib/2019-04-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  13. data/lib/2019-06-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  14. data/lib/2020-08-01-preview/generated/azure_mgmt_storage.rb +201 -0
  15. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/blob_containers.rb +2046 -0
  16. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/blob_services.rb +383 -0
  17. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/deleted_accounts.rb +321 -0
  18. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/encryption_scopes.rb +691 -0
  19. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/file_services.rb +377 -0
  20. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/file_shares.rb +940 -0
  21. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/management_policies.rb +361 -0
  22. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/access_tier.rb +16 -0
  23. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/account_sas_parameters.rb +136 -0
  24. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/account_status.rb +16 -0
  25. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/action.rb +15 -0
  26. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/active_directory_properties.rb +103 -0
  27. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/azure_entity_resource.rb +75 -0
  28. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/azure_files_identity_based_authentication.rb +59 -0
  29. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_container.rb +290 -0
  30. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_restore_parameters.rb +66 -0
  31. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_restore_progress_status.rb +17 -0
  32. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_restore_range.rb +59 -0
  33. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_restore_status.rb +88 -0
  34. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_service_items.rb +57 -0
  35. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/blob_service_properties.rb +178 -0
  36. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/bypass.rb +18 -0
  37. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/change_feed.rb +47 -0
  38. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/check_name_availability_result.rb +77 -0
  39. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/cors_rule.rb +128 -0
  40. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/cors_rules.rb +57 -0
  41. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/custom_domain.rb +60 -0
  42. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/date_after_creation.rb +50 -0
  43. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/date_after_modification.rb +51 -0
  44. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/default_action.rb +16 -0
  45. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/delete_retention_policy.rb +63 -0
  46. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/deleted_account.rb +123 -0
  47. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/deleted_account_list_result.rb +103 -0
  48. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/deleted_share.rb +59 -0
  49. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/dimension.rb +57 -0
  50. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/directory_service_options.rb +17 -0
  51. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/enabled_protocols.rb +16 -0
  52. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption.rb +87 -0
  53. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_scope.rb +129 -0
  54. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_scope_key_vault_properties.rb +51 -0
  55. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_scope_list_result.rb +103 -0
  56. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_scope_source.rb +16 -0
  57. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_scope_state.rb +16 -0
  58. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_service.rb +76 -0
  59. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/encryption_services.rb +87 -0
  60. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/endpoints.rb +134 -0
  61. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/error_response.rb +48 -0
  62. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/error_response_body.rb +59 -0
  63. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/file_service_items.rb +57 -0
  64. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/file_service_properties.rb +103 -0
  65. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/file_share.rb +251 -0
  66. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/file_share_item.rb +250 -0
  67. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/file_share_items.rb +103 -0
  68. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/geo_replication_stats.rb +85 -0
  69. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/geo_replication_status.rb +17 -0
  70. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/get_share_expand.rb +15 -0
  71. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/http_protocol.rb +16 -0
  72. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/identity.rb +72 -0
  73. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/immutability_policy.rb +114 -0
  74. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/immutability_policy_properties.rb +111 -0
  75. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/immutability_policy_state.rb +16 -0
  76. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/immutability_policy_update_type.rb +17 -0
  77. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/iprule.rb +61 -0
  78. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/key_permission.rb +16 -0
  79. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/key_source.rb +16 -0
  80. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/key_type.rb +16 -0
  81. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/key_vault_properties.rb +93 -0
  82. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/kind.rb +19 -0
  83. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/large_file_shares_state.rb +16 -0
  84. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/lease_container_request.rb +97 -0
  85. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/lease_container_response.rb +60 -0
  86. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/lease_duration.rb +16 -0
  87. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/lease_state.rb +19 -0
  88. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/lease_status.rb +16 -0
  89. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/legal_hold.rb +71 -0
  90. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/legal_hold_properties.rb +72 -0
  91. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_account_sas_response.rb +47 -0
  92. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_container_item.rb +289 -0
  93. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_container_items.rb +103 -0
  94. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_containers_include.rb +15 -0
  95. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_key_expand.rb +15 -0
  96. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_queue.rb +83 -0
  97. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_queue_resource.rb +101 -0
  98. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_queue_services.rb +58 -0
  99. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_service_sas_response.rb +47 -0
  100. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_shares_expand.rb +15 -0
  101. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_table_resource.rb +101 -0
  102. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/list_table_services.rb +58 -0
  103. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy.rb +89 -0
  104. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_action.rb +62 -0
  105. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_base_blob.rb +73 -0
  106. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_definition.rb +60 -0
  107. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_filter.rb +97 -0
  108. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_rule.rb +87 -0
  109. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_schema.rb +58 -0
  110. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/management_policy_snap_shot.rb +47 -0
  111. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/metric_specification.rb +145 -0
  112. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/minimum_tls_version.rb +17 -0
  113. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/network_rule_set.rb +106 -0
  114. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/object_replication_policies.rb +56 -0
  115. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/object_replication_policy.rb +131 -0
  116. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/object_replication_policy_filter.rb +70 -0
  117. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/object_replication_policy_rule.rb +82 -0
  118. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/operation.rb +83 -0
  119. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/operation_display.rb +79 -0
  120. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/operation_list_result.rb +57 -0
  121. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/permissions.rb +22 -0
  122. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_endpoint.rb +47 -0
  123. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_endpoint_connection.rb +101 -0
  124. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_endpoint_connection_list_result.rb +57 -0
  125. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_endpoint_connection_provisioning_state.rb +18 -0
  126. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_endpoint_service_connection_status.rb +17 -0
  127. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_link_resource.rb +115 -0
  128. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_link_resource_list_result.rb +55 -0
  129. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/private_link_service_connection_state.rb +72 -0
  130. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/provisioning_state.rb +17 -0
  131. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/proxy_resource.rb +63 -0
  132. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/public_access.rb +17 -0
  133. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/queue_service_properties.rb +77 -0
  134. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/reason.rb +16 -0
  135. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/reason_code.rb +16 -0
  136. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/resource.rb +83 -0
  137. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/restore_policy_properties.rb +87 -0
  138. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/restriction.rb +85 -0
  139. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/root_squash_type.rb +17 -0
  140. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/routing_choice.rb +16 -0
  141. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/routing_preference.rb +74 -0
  142. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/service_sas_parameters.rb +247 -0
  143. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/service_specification.rb +56 -0
  144. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/services.rb +18 -0
  145. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/share_access_tier.rb +18 -0
  146. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/signed_resource.rb +18 -0
  147. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/signed_resource_types.rb +17 -0
  148. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/sku.rb +60 -0
  149. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/sku_information.rb +153 -0
  150. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/sku_name.rb +22 -0
  151. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/sku_tier.rb +16 -0
  152. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/skucapability.rb +63 -0
  153. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/state.rb +19 -0
  154. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account.rb +462 -0
  155. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +63 -0
  156. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +254 -0
  157. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_expand.rb +16 -0
  158. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_internet_endpoints.rb +84 -0
  159. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_key.rb +73 -0
  160. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_list_keys_result.rb +57 -0
  161. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_list_result.rb +103 -0
  162. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_microsoft_endpoints.rb +108 -0
  163. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +47 -0
  164. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +231 -0
  165. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_queue.rb +97 -0
  166. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/storage_sku_list_result.rb +57 -0
  167. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/table.rb +74 -0
  168. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/table_service_properties.rb +77 -0
  169. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/tag_filter.rb +80 -0
  170. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/tag_property.rb +97 -0
  171. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/tracked_resource.rb +92 -0
  172. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/update_history_property.rb +114 -0
  173. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/usage.rb +89 -0
  174. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/usage_list_result.rb +56 -0
  175. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/usage_name.rb +59 -0
  176. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/usage_unit.rb +20 -0
  177. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/models/virtual_network_rule.rb +75 -0
  178. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/module_definition.rb +9 -0
  179. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/object_replication_policies_operations.rb +495 -0
  180. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/operations.rb +110 -0
  181. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/private_endpoint_connections.rb +501 -0
  182. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/private_link_resources.rb +138 -0
  183. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/queue.rb +805 -0
  184. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/queue_services.rb +386 -0
  185. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/skus.rb +116 -0
  186. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/storage_accounts.rb +1943 -0
  187. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +200 -0
  188. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/table_operations.rb +743 -0
  189. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/table_services.rb +386 -0
  190. data/lib/2020-08-01-preview/generated/azure_mgmt_storage/usages.rb +120 -0
  191. data/lib/azure_mgmt_storage.rb +10 -9
  192. data/lib/profiles/latest/modules/storage_profile_module.rb +391 -377
  193. data/lib/version.rb +1 -1
  194. metadata +180 -3
@@ -0,0 +1,377 @@
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::Storage::Mgmt::V2020_08_01_preview
7
+ #
8
+ # The Azure Storage Management API.
9
+ #
10
+ class FileServices
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the FileServices class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [StorageManagementClient] reference to the StorageManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # List all file services in storage accounts
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group within the
28
+ # user's subscription. The name is case insensitive.
29
+ # @param account_name [String] The name of the storage account within the
30
+ # specified resource group. Storage account names must be between 3 and 24
31
+ # characters in length and use numbers and lower-case letters only.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [FileServiceItems] operation results.
36
+ #
37
+ def list(resource_group_name, account_name, custom_headers:nil)
38
+ response = list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # List all file services in storage accounts
44
+ #
45
+ # @param resource_group_name [String] The name of the resource group within the
46
+ # user's subscription. The name is case insensitive.
47
+ # @param account_name [String] The name of the storage account within the
48
+ # specified resource group. Storage account names must be between 3 and 24
49
+ # characters in length and use numbers and lower-case letters only.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def list_with_http_info(resource_group_name, account_name, custom_headers:nil)
56
+ list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # List all file services in storage accounts
61
+ #
62
+ # @param resource_group_name [String] The name of the resource group within the
63
+ # user's subscription. The name is case insensitive.
64
+ # @param account_name [String] The name of the storage account within the
65
+ # specified resource group. Storage account names must be between 3 and 24
66
+ # characters in length and use numbers and lower-case letters only.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def list_async(resource_group_name, account_name, custom_headers:nil)
73
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
74
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
75
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
76
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
77
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
78
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
79
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
80
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
81
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
82
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
83
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
84
+
85
+
86
+ request_headers = {}
87
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
88
+
89
+ # Set Headers
90
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
91
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
92
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices'
93
+
94
+ request_url = @base_url || @client.base_url
95
+
96
+ options = {
97
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
98
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
99
+ query_params: {'api-version' => @client.api_version},
100
+ headers: request_headers.merge(custom_headers || {}),
101
+ base_url: request_url
102
+ }
103
+ promise = @client.make_request_async(:get, path_template, options)
104
+
105
+ promise = promise.then do |result|
106
+ http_response = result.response
107
+ status_code = http_response.status
108
+ response_content = http_response.body
109
+ unless status_code == 200
110
+ error_model = JSON.load(response_content)
111
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
112
+ end
113
+
114
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
115
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
116
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
117
+ # Deserialize Response
118
+ if status_code == 200
119
+ begin
120
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
121
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::FileServiceItems.mapper()
122
+ result.body = @client.deserialize(result_mapper, parsed_response)
123
+ rescue Exception => e
124
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
125
+ end
126
+ end
127
+
128
+ result
129
+ end
130
+
131
+ promise.execute
132
+ end
133
+
134
+ #
135
+ # Sets the properties of file services in storage accounts, including CORS
136
+ # (Cross-Origin Resource Sharing) rules.
137
+ #
138
+ # @param resource_group_name [String] The name of the resource group within the
139
+ # user's subscription. The name is case insensitive.
140
+ # @param account_name [String] The name of the storage account within the
141
+ # specified resource group. Storage account names must be between 3 and 24
142
+ # characters in length and use numbers and lower-case letters only.
143
+ # @param parameters [FileServiceProperties] The properties of file services in
144
+ # storage accounts, including CORS (Cross-Origin Resource Sharing) rules.
145
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
146
+ # will be added to the HTTP request.
147
+ #
148
+ # @return [FileServiceProperties] operation results.
149
+ #
150
+ def set_service_properties(resource_group_name, account_name, parameters, custom_headers:nil)
151
+ response = set_service_properties_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
152
+ response.body unless response.nil?
153
+ end
154
+
155
+ #
156
+ # Sets the properties of file services in storage accounts, including CORS
157
+ # (Cross-Origin Resource Sharing) rules.
158
+ #
159
+ # @param resource_group_name [String] The name of the resource group within the
160
+ # user's subscription. The name is case insensitive.
161
+ # @param account_name [String] The name of the storage account within the
162
+ # specified resource group. Storage account names must be between 3 and 24
163
+ # characters in length and use numbers and lower-case letters only.
164
+ # @param parameters [FileServiceProperties] The properties of file services in
165
+ # storage accounts, including CORS (Cross-Origin Resource Sharing) rules.
166
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
167
+ # will be added to the HTTP request.
168
+ #
169
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
170
+ #
171
+ def set_service_properties_with_http_info(resource_group_name, account_name, parameters, custom_headers:nil)
172
+ set_service_properties_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
173
+ end
174
+
175
+ #
176
+ # Sets the properties of file services in storage accounts, including CORS
177
+ # (Cross-Origin Resource Sharing) rules.
178
+ #
179
+ # @param resource_group_name [String] The name of the resource group within the
180
+ # user's subscription. The name is case insensitive.
181
+ # @param account_name [String] The name of the storage account within the
182
+ # specified resource group. Storage account names must be between 3 and 24
183
+ # characters in length and use numbers and lower-case letters only.
184
+ # @param parameters [FileServiceProperties] The properties of file services in
185
+ # storage accounts, including CORS (Cross-Origin Resource Sharing) rules.
186
+ # @param [Hash{String => String}] A hash of custom headers that will be added
187
+ # to the HTTP request.
188
+ #
189
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
190
+ #
191
+ def set_service_properties_async(resource_group_name, account_name, parameters, custom_headers:nil)
192
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
193
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
194
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
195
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
196
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
197
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
198
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
199
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
200
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
201
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
202
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
203
+ file_services_name = 'default'
204
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
205
+
206
+
207
+ request_headers = {}
208
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
209
+
210
+ # Set Headers
211
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
212
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
213
+
214
+ # Serialize Request
215
+ request_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::FileServiceProperties.mapper()
216
+ request_content = @client.serialize(request_mapper, parameters)
217
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
218
+
219
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'
220
+
221
+ request_url = @base_url || @client.base_url
222
+
223
+ options = {
224
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
225
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'FileServicesName' => file_services_name},
226
+ query_params: {'api-version' => @client.api_version},
227
+ body: request_content,
228
+ headers: request_headers.merge(custom_headers || {}),
229
+ base_url: request_url
230
+ }
231
+ promise = @client.make_request_async(:put, path_template, options)
232
+
233
+ promise = promise.then do |result|
234
+ http_response = result.response
235
+ status_code = http_response.status
236
+ response_content = http_response.body
237
+ unless status_code == 200
238
+ error_model = JSON.load(response_content)
239
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
240
+ end
241
+
242
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
243
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
244
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
245
+ # Deserialize Response
246
+ if status_code == 200
247
+ begin
248
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
249
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::FileServiceProperties.mapper()
250
+ result.body = @client.deserialize(result_mapper, parsed_response)
251
+ rescue Exception => e
252
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
253
+ end
254
+ end
255
+
256
+ result
257
+ end
258
+
259
+ promise.execute
260
+ end
261
+
262
+ #
263
+ # Gets the properties of file services in storage accounts, including CORS
264
+ # (Cross-Origin Resource Sharing) rules.
265
+ #
266
+ # @param resource_group_name [String] The name of the resource group within the
267
+ # user's subscription. The name is case insensitive.
268
+ # @param account_name [String] The name of the storage account within the
269
+ # specified resource group. Storage account names must be between 3 and 24
270
+ # characters in length and use numbers and lower-case letters only.
271
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
272
+ # will be added to the HTTP request.
273
+ #
274
+ # @return [FileServiceProperties] operation results.
275
+ #
276
+ def get_service_properties(resource_group_name, account_name, custom_headers:nil)
277
+ response = get_service_properties_async(resource_group_name, account_name, custom_headers:custom_headers).value!
278
+ response.body unless response.nil?
279
+ end
280
+
281
+ #
282
+ # Gets the properties of file services in storage accounts, including CORS
283
+ # (Cross-Origin Resource Sharing) rules.
284
+ #
285
+ # @param resource_group_name [String] The name of the resource group within the
286
+ # user's subscription. The name is case insensitive.
287
+ # @param account_name [String] The name of the storage account within the
288
+ # specified resource group. Storage account names must be between 3 and 24
289
+ # characters in length and use numbers and lower-case letters only.
290
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
291
+ # will be added to the HTTP request.
292
+ #
293
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
294
+ #
295
+ def get_service_properties_with_http_info(resource_group_name, account_name, custom_headers:nil)
296
+ get_service_properties_async(resource_group_name, account_name, custom_headers:custom_headers).value!
297
+ end
298
+
299
+ #
300
+ # Gets the properties of file services in storage accounts, including CORS
301
+ # (Cross-Origin Resource Sharing) rules.
302
+ #
303
+ # @param resource_group_name [String] The name of the resource group within the
304
+ # user's subscription. The name is case insensitive.
305
+ # @param account_name [String] The name of the storage account within the
306
+ # specified resource group. Storage account names must be between 3 and 24
307
+ # characters in length and use numbers and lower-case letters only.
308
+ # @param [Hash{String => String}] A hash of custom headers that will be added
309
+ # to the HTTP request.
310
+ #
311
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
312
+ #
313
+ def get_service_properties_async(resource_group_name, account_name, custom_headers:nil)
314
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
315
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
316
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
317
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
318
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
319
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
320
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
321
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
322
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
323
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
324
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
325
+ file_services_name = 'default'
326
+
327
+
328
+ request_headers = {}
329
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
330
+
331
+ # Set Headers
332
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
333
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
334
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'
335
+
336
+ request_url = @base_url || @client.base_url
337
+
338
+ options = {
339
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
340
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'FileServicesName' => file_services_name},
341
+ query_params: {'api-version' => @client.api_version},
342
+ headers: request_headers.merge(custom_headers || {}),
343
+ base_url: request_url
344
+ }
345
+ promise = @client.make_request_async(:get, path_template, options)
346
+
347
+ promise = promise.then do |result|
348
+ http_response = result.response
349
+ status_code = http_response.status
350
+ response_content = http_response.body
351
+ unless status_code == 200
352
+ error_model = JSON.load(response_content)
353
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
354
+ end
355
+
356
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
357
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
358
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
359
+ # Deserialize Response
360
+ if status_code == 200
361
+ begin
362
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
363
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::FileServiceProperties.mapper()
364
+ result.body = @client.deserialize(result_mapper, parsed_response)
365
+ rescue Exception => e
366
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
367
+ end
368
+ end
369
+
370
+ result
371
+ end
372
+
373
+ promise.execute
374
+ end
375
+
376
+ end
377
+ end
@@ -0,0 +1,940 @@
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::Storage::Mgmt::V2020_08_01_preview
7
+ #
8
+ # The Azure Storage Management API.
9
+ #
10
+ class FileShares
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the FileShares class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [StorageManagementClient] reference to the StorageManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists all shares.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group within the
28
+ # user's subscription. The name is case insensitive.
29
+ # @param account_name [String] The name of the storage account within the
30
+ # specified resource group. Storage account names must be between 3 and 24
31
+ # characters in length and use numbers and lower-case letters only.
32
+ # @param maxpagesize [String] Optional. Specified maximum number of shares that
33
+ # can be included in the list.
34
+ # @param filter [String] Optional. When specified, only share names starting
35
+ # with the filter will be listed.
36
+ # @param expand [ListSharesExpand] Optional, used to expand the properties
37
+ # within share's properties. Possible values include: 'deleted'
38
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
39
+ # will be added to the HTTP request.
40
+ #
41
+ # @return [Array<FileShareItem>] operation results.
42
+ #
43
+ def list(resource_group_name, account_name, maxpagesize:nil, filter:nil, expand:nil, custom_headers:nil)
44
+ first_page = list_as_lazy(resource_group_name, account_name, maxpagesize:maxpagesize, filter:filter, expand:expand, custom_headers:custom_headers)
45
+ first_page.get_all_items
46
+ end
47
+
48
+ #
49
+ # Lists all shares.
50
+ #
51
+ # @param resource_group_name [String] The name of the resource group within the
52
+ # user's subscription. The name is case insensitive.
53
+ # @param account_name [String] The name of the storage account within the
54
+ # specified resource group. Storage account names must be between 3 and 24
55
+ # characters in length and use numbers and lower-case letters only.
56
+ # @param maxpagesize [String] Optional. Specified maximum number of shares that
57
+ # can be included in the list.
58
+ # @param filter [String] Optional. When specified, only share names starting
59
+ # with the filter will be listed.
60
+ # @param expand [ListSharesExpand] Optional, used to expand the properties
61
+ # within share's properties. Possible values include: 'deleted'
62
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
63
+ # will be added to the HTTP request.
64
+ #
65
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
66
+ #
67
+ def list_with_http_info(resource_group_name, account_name, maxpagesize:nil, filter:nil, expand:nil, custom_headers:nil)
68
+ list_async(resource_group_name, account_name, maxpagesize:maxpagesize, filter:filter, expand:expand, custom_headers:custom_headers).value!
69
+ end
70
+
71
+ #
72
+ # Lists all shares.
73
+ #
74
+ # @param resource_group_name [String] The name of the resource group within the
75
+ # user's subscription. The name is case insensitive.
76
+ # @param account_name [String] The name of the storage account within the
77
+ # specified resource group. Storage account names must be between 3 and 24
78
+ # characters in length and use numbers and lower-case letters only.
79
+ # @param maxpagesize [String] Optional. Specified maximum number of shares that
80
+ # can be included in the list.
81
+ # @param filter [String] Optional. When specified, only share names starting
82
+ # with the filter will be listed.
83
+ # @param expand [ListSharesExpand] Optional, used to expand the properties
84
+ # within share's properties. Possible values include: 'deleted'
85
+ # @param [Hash{String => String}] A hash of custom headers that will be added
86
+ # to the HTTP request.
87
+ #
88
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
89
+ #
90
+ def list_async(resource_group_name, account_name, maxpagesize:nil, filter:nil, expand:nil, custom_headers:nil)
91
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
92
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
93
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
94
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
95
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
96
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
97
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
98
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
99
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
100
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
101
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
102
+
103
+
104
+ request_headers = {}
105
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
106
+
107
+ # Set Headers
108
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
109
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
110
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares'
111
+
112
+ request_url = @base_url || @client.base_url
113
+
114
+ options = {
115
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
116
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
117
+ query_params: {'api-version' => @client.api_version,'$maxpagesize' => maxpagesize,'$filter' => filter,'$expand' => expand},
118
+ headers: request_headers.merge(custom_headers || {}),
119
+ base_url: request_url
120
+ }
121
+ promise = @client.make_request_async(:get, path_template, options)
122
+
123
+ promise = promise.then do |result|
124
+ http_response = result.response
125
+ status_code = http_response.status
126
+ response_content = http_response.body
127
+ unless status_code == 200
128
+ error_model = JSON.load(response_content)
129
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
130
+ end
131
+
132
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
133
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
134
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
135
+ # Deserialize Response
136
+ if status_code == 200
137
+ begin
138
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
139
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::FileShareItems.mapper()
140
+ result.body = @client.deserialize(result_mapper, parsed_response)
141
+ rescue Exception => e
142
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
143
+ end
144
+ end
145
+
146
+ result
147
+ end
148
+
149
+ promise.execute
150
+ end
151
+
152
+ #
153
+ # Creates a new share under the specified account as described by request body.
154
+ # The share resource includes metadata and properties for that share. It does
155
+ # not include a list of the files contained by the share.
156
+ #
157
+ # @param resource_group_name [String] The name of the resource group within the
158
+ # user's subscription. The name is case insensitive.
159
+ # @param account_name [String] The name of the storage account within the
160
+ # specified resource group. Storage account names must be between 3 and 24
161
+ # characters in length and use numbers and lower-case letters only.
162
+ # @param share_name [String] The name of the file share within the specified
163
+ # storage account. File share names must be between 3 and 63 characters in
164
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
165
+ # character must be immediately preceded and followed by a letter or number.
166
+ # @param file_share [FileShare] Properties of the file share to create.
167
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
168
+ # will be added to the HTTP request.
169
+ #
170
+ # @return [FileShare] operation results.
171
+ #
172
+ def create(resource_group_name, account_name, share_name, file_share, custom_headers:nil)
173
+ response = create_async(resource_group_name, account_name, share_name, file_share, custom_headers:custom_headers).value!
174
+ response.body unless response.nil?
175
+ end
176
+
177
+ #
178
+ # Creates a new share under the specified account as described by request body.
179
+ # The share resource includes metadata and properties for that share. It does
180
+ # not include a list of the files contained by the share.
181
+ #
182
+ # @param resource_group_name [String] The name of the resource group within the
183
+ # user's subscription. The name is case insensitive.
184
+ # @param account_name [String] The name of the storage account within the
185
+ # specified resource group. Storage account names must be between 3 and 24
186
+ # characters in length and use numbers and lower-case letters only.
187
+ # @param share_name [String] The name of the file share within the specified
188
+ # storage account. File share names must be between 3 and 63 characters in
189
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
190
+ # character must be immediately preceded and followed by a letter or number.
191
+ # @param file_share [FileShare] Properties of the file share to create.
192
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
193
+ # will be added to the HTTP request.
194
+ #
195
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
196
+ #
197
+ def create_with_http_info(resource_group_name, account_name, share_name, file_share, custom_headers:nil)
198
+ create_async(resource_group_name, account_name, share_name, file_share, custom_headers:custom_headers).value!
199
+ end
200
+
201
+ #
202
+ # Creates a new share under the specified account as described by request body.
203
+ # The share resource includes metadata and properties for that share. It does
204
+ # not include a list of the files contained by the share.
205
+ #
206
+ # @param resource_group_name [String] The name of the resource group within the
207
+ # user's subscription. The name is case insensitive.
208
+ # @param account_name [String] The name of the storage account within the
209
+ # specified resource group. Storage account names must be between 3 and 24
210
+ # characters in length and use numbers and lower-case letters only.
211
+ # @param share_name [String] The name of the file share within the specified
212
+ # storage account. File share names must be between 3 and 63 characters in
213
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
214
+ # character must be immediately preceded and followed by a letter or number.
215
+ # @param file_share [FileShare] Properties of the file share to create.
216
+ # @param [Hash{String => String}] A hash of custom headers that will be added
217
+ # to the HTTP request.
218
+ #
219
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
220
+ #
221
+ def create_async(resource_group_name, account_name, share_name, file_share, custom_headers:nil)
222
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
223
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
224
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
225
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
226
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
227
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
228
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
229
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
230
+ fail ArgumentError, "'share_name' should satisfy the constraint - 'MaxLength': '63'" if !share_name.nil? && share_name.length > 63
231
+ fail ArgumentError, "'share_name' should satisfy the constraint - 'MinLength': '3'" if !share_name.nil? && share_name.length < 3
232
+ fail ArgumentError, 'file_share is nil' if file_share.nil?
233
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
234
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
235
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
236
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
237
+
238
+
239
+ request_headers = {}
240
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
241
+
242
+ # Set Headers
243
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
244
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
245
+
246
+ # Serialize Request
247
+ request_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::FileShare.mapper()
248
+ request_content = @client.serialize(request_mapper, file_share)
249
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
250
+
251
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'
252
+
253
+ request_url = @base_url || @client.base_url
254
+
255
+ options = {
256
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
257
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name,'subscriptionId' => @client.subscription_id},
258
+ query_params: {'api-version' => @client.api_version},
259
+ body: request_content,
260
+ headers: request_headers.merge(custom_headers || {}),
261
+ base_url: request_url
262
+ }
263
+ promise = @client.make_request_async(:put, path_template, options)
264
+
265
+ promise = promise.then do |result|
266
+ http_response = result.response
267
+ status_code = http_response.status
268
+ response_content = http_response.body
269
+ unless status_code == 201 || status_code == 200
270
+ error_model = JSON.load(response_content)
271
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
272
+ end
273
+
274
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
275
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
276
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
277
+ # Deserialize Response
278
+ if status_code == 201
279
+ begin
280
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
281
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::FileShare.mapper()
282
+ result.body = @client.deserialize(result_mapper, parsed_response)
283
+ rescue Exception => e
284
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
285
+ end
286
+ end
287
+ # Deserialize Response
288
+ if status_code == 200
289
+ begin
290
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
291
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::FileShare.mapper()
292
+ result.body = @client.deserialize(result_mapper, parsed_response)
293
+ rescue Exception => e
294
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
295
+ end
296
+ end
297
+
298
+ result
299
+ end
300
+
301
+ promise.execute
302
+ end
303
+
304
+ #
305
+ # Updates share properties as specified in request body. Properties not
306
+ # mentioned in the request will not be changed. Update fails if the specified
307
+ # share does not already exist.
308
+ #
309
+ # @param resource_group_name [String] The name of the resource group within the
310
+ # user's subscription. The name is case insensitive.
311
+ # @param account_name [String] The name of the storage account within the
312
+ # specified resource group. Storage account names must be between 3 and 24
313
+ # characters in length and use numbers and lower-case letters only.
314
+ # @param share_name [String] The name of the file share within the specified
315
+ # storage account. File share names must be between 3 and 63 characters in
316
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
317
+ # character must be immediately preceded and followed by a letter or number.
318
+ # @param file_share [FileShare] Properties to update for the file share.
319
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
320
+ # will be added to the HTTP request.
321
+ #
322
+ # @return [FileShare] operation results.
323
+ #
324
+ def update(resource_group_name, account_name, share_name, file_share, custom_headers:nil)
325
+ response = update_async(resource_group_name, account_name, share_name, file_share, custom_headers:custom_headers).value!
326
+ response.body unless response.nil?
327
+ end
328
+
329
+ #
330
+ # Updates share properties as specified in request body. Properties not
331
+ # mentioned in the request will not be changed. Update fails if the specified
332
+ # share does not already exist.
333
+ #
334
+ # @param resource_group_name [String] The name of the resource group within the
335
+ # user's subscription. The name is case insensitive.
336
+ # @param account_name [String] The name of the storage account within the
337
+ # specified resource group. Storage account names must be between 3 and 24
338
+ # characters in length and use numbers and lower-case letters only.
339
+ # @param share_name [String] The name of the file share within the specified
340
+ # storage account. File share names must be between 3 and 63 characters in
341
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
342
+ # character must be immediately preceded and followed by a letter or number.
343
+ # @param file_share [FileShare] Properties to update for the file share.
344
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
345
+ # will be added to the HTTP request.
346
+ #
347
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
348
+ #
349
+ def update_with_http_info(resource_group_name, account_name, share_name, file_share, custom_headers:nil)
350
+ update_async(resource_group_name, account_name, share_name, file_share, custom_headers:custom_headers).value!
351
+ end
352
+
353
+ #
354
+ # Updates share properties as specified in request body. Properties not
355
+ # mentioned in the request will not be changed. Update fails if the specified
356
+ # share does not already exist.
357
+ #
358
+ # @param resource_group_name [String] The name of the resource group within the
359
+ # user's subscription. The name is case insensitive.
360
+ # @param account_name [String] The name of the storage account within the
361
+ # specified resource group. Storage account names must be between 3 and 24
362
+ # characters in length and use numbers and lower-case letters only.
363
+ # @param share_name [String] The name of the file share within the specified
364
+ # storage account. File share names must be between 3 and 63 characters in
365
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
366
+ # character must be immediately preceded and followed by a letter or number.
367
+ # @param file_share [FileShare] Properties to update for the file share.
368
+ # @param [Hash{String => String}] A hash of custom headers that will be added
369
+ # to the HTTP request.
370
+ #
371
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
372
+ #
373
+ def update_async(resource_group_name, account_name, share_name, file_share, custom_headers:nil)
374
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
375
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
376
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
377
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
378
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
379
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
380
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
381
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
382
+ fail ArgumentError, "'share_name' should satisfy the constraint - 'MaxLength': '63'" if !share_name.nil? && share_name.length > 63
383
+ fail ArgumentError, "'share_name' should satisfy the constraint - 'MinLength': '3'" if !share_name.nil? && share_name.length < 3
384
+ fail ArgumentError, 'file_share is nil' if file_share.nil?
385
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
386
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
387
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
388
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
389
+
390
+
391
+ request_headers = {}
392
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
393
+
394
+ # Set Headers
395
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
396
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
397
+
398
+ # Serialize Request
399
+ request_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::FileShare.mapper()
400
+ request_content = @client.serialize(request_mapper, file_share)
401
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
402
+
403
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'
404
+
405
+ request_url = @base_url || @client.base_url
406
+
407
+ options = {
408
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
409
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name,'subscriptionId' => @client.subscription_id},
410
+ query_params: {'api-version' => @client.api_version},
411
+ body: request_content,
412
+ headers: request_headers.merge(custom_headers || {}),
413
+ base_url: request_url
414
+ }
415
+ promise = @client.make_request_async(:patch, path_template, options)
416
+
417
+ promise = promise.then do |result|
418
+ http_response = result.response
419
+ status_code = http_response.status
420
+ response_content = http_response.body
421
+ unless status_code == 200
422
+ error_model = JSON.load(response_content)
423
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
424
+ end
425
+
426
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
427
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
428
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
429
+ # Deserialize Response
430
+ if status_code == 200
431
+ begin
432
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
433
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::FileShare.mapper()
434
+ result.body = @client.deserialize(result_mapper, parsed_response)
435
+ rescue Exception => e
436
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
437
+ end
438
+ end
439
+
440
+ result
441
+ end
442
+
443
+ promise.execute
444
+ end
445
+
446
+ #
447
+ # Gets properties of a specified share.
448
+ #
449
+ # @param resource_group_name [String] The name of the resource group within the
450
+ # user's subscription. The name is case insensitive.
451
+ # @param account_name [String] The name of the storage account within the
452
+ # specified resource group. Storage account names must be between 3 and 24
453
+ # characters in length and use numbers and lower-case letters only.
454
+ # @param share_name [String] The name of the file share within the specified
455
+ # storage account. File share names must be between 3 and 63 characters in
456
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
457
+ # character must be immediately preceded and followed by a letter or number.
458
+ # @param expand [GetShareExpand] Optional, used to expand the properties within
459
+ # share's properties. Possible values include: 'stats'
460
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
461
+ # will be added to the HTTP request.
462
+ #
463
+ # @return [FileShare] operation results.
464
+ #
465
+ def get(resource_group_name, account_name, share_name, expand:nil, custom_headers:nil)
466
+ response = get_async(resource_group_name, account_name, share_name, expand:expand, custom_headers:custom_headers).value!
467
+ response.body unless response.nil?
468
+ end
469
+
470
+ #
471
+ # Gets properties of a specified share.
472
+ #
473
+ # @param resource_group_name [String] The name of the resource group within the
474
+ # user's subscription. The name is case insensitive.
475
+ # @param account_name [String] The name of the storage account within the
476
+ # specified resource group. Storage account names must be between 3 and 24
477
+ # characters in length and use numbers and lower-case letters only.
478
+ # @param share_name [String] The name of the file share within the specified
479
+ # storage account. File share names must be between 3 and 63 characters in
480
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
481
+ # character must be immediately preceded and followed by a letter or number.
482
+ # @param expand [GetShareExpand] Optional, used to expand the properties within
483
+ # share's properties. Possible values include: 'stats'
484
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
485
+ # will be added to the HTTP request.
486
+ #
487
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
488
+ #
489
+ def get_with_http_info(resource_group_name, account_name, share_name, expand:nil, custom_headers:nil)
490
+ get_async(resource_group_name, account_name, share_name, expand:expand, custom_headers:custom_headers).value!
491
+ end
492
+
493
+ #
494
+ # Gets properties of a specified share.
495
+ #
496
+ # @param resource_group_name [String] The name of the resource group within the
497
+ # user's subscription. The name is case insensitive.
498
+ # @param account_name [String] The name of the storage account within the
499
+ # specified resource group. Storage account names must be between 3 and 24
500
+ # characters in length and use numbers and lower-case letters only.
501
+ # @param share_name [String] The name of the file share within the specified
502
+ # storage account. File share names must be between 3 and 63 characters in
503
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
504
+ # character must be immediately preceded and followed by a letter or number.
505
+ # @param expand [GetShareExpand] Optional, used to expand the properties within
506
+ # share's properties. Possible values include: 'stats'
507
+ # @param [Hash{String => String}] A hash of custom headers that will be added
508
+ # to the HTTP request.
509
+ #
510
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
511
+ #
512
+ def get_async(resource_group_name, account_name, share_name, expand:nil, custom_headers:nil)
513
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
514
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
515
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
516
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
517
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
518
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
519
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
520
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
521
+ fail ArgumentError, "'share_name' should satisfy the constraint - 'MaxLength': '63'" if !share_name.nil? && share_name.length > 63
522
+ fail ArgumentError, "'share_name' should satisfy the constraint - 'MinLength': '3'" if !share_name.nil? && share_name.length < 3
523
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
524
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
525
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
526
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
527
+
528
+
529
+ request_headers = {}
530
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
531
+
532
+ # Set Headers
533
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
534
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
535
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'
536
+
537
+ request_url = @base_url || @client.base_url
538
+
539
+ options = {
540
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
541
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name,'subscriptionId' => @client.subscription_id},
542
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
543
+ headers: request_headers.merge(custom_headers || {}),
544
+ base_url: request_url
545
+ }
546
+ promise = @client.make_request_async(:get, path_template, options)
547
+
548
+ promise = promise.then do |result|
549
+ http_response = result.response
550
+ status_code = http_response.status
551
+ response_content = http_response.body
552
+ unless status_code == 200
553
+ error_model = JSON.load(response_content)
554
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
555
+ end
556
+
557
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
558
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
559
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
560
+ # Deserialize Response
561
+ if status_code == 200
562
+ begin
563
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
564
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::FileShare.mapper()
565
+ result.body = @client.deserialize(result_mapper, parsed_response)
566
+ rescue Exception => e
567
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
568
+ end
569
+ end
570
+
571
+ result
572
+ end
573
+
574
+ promise.execute
575
+ end
576
+
577
+ #
578
+ # Deletes specified share under its account.
579
+ #
580
+ # @param resource_group_name [String] The name of the resource group within the
581
+ # user's subscription. The name is case insensitive.
582
+ # @param account_name [String] The name of the storage account within the
583
+ # specified resource group. Storage account names must be between 3 and 24
584
+ # characters in length and use numbers and lower-case letters only.
585
+ # @param share_name [String] The name of the file share within the specified
586
+ # storage account. File share names must be between 3 and 63 characters in
587
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
588
+ # character must be immediately preceded and followed by a letter or number.
589
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
590
+ # will be added to the HTTP request.
591
+ #
592
+ #
593
+ def delete(resource_group_name, account_name, share_name, custom_headers:nil)
594
+ response = delete_async(resource_group_name, account_name, share_name, custom_headers:custom_headers).value!
595
+ nil
596
+ end
597
+
598
+ #
599
+ # Deletes specified share under its account.
600
+ #
601
+ # @param resource_group_name [String] The name of the resource group within the
602
+ # user's subscription. The name is case insensitive.
603
+ # @param account_name [String] The name of the storage account within the
604
+ # specified resource group. Storage account names must be between 3 and 24
605
+ # characters in length and use numbers and lower-case letters only.
606
+ # @param share_name [String] The name of the file share within the specified
607
+ # storage account. File share names must be between 3 and 63 characters in
608
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
609
+ # character must be immediately preceded and followed by a letter or number.
610
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
611
+ # will be added to the HTTP request.
612
+ #
613
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
614
+ #
615
+ def delete_with_http_info(resource_group_name, account_name, share_name, custom_headers:nil)
616
+ delete_async(resource_group_name, account_name, share_name, custom_headers:custom_headers).value!
617
+ end
618
+
619
+ #
620
+ # Deletes specified share under its account.
621
+ #
622
+ # @param resource_group_name [String] The name of the resource group within the
623
+ # user's subscription. The name is case insensitive.
624
+ # @param account_name [String] The name of the storage account within the
625
+ # specified resource group. Storage account names must be between 3 and 24
626
+ # characters in length and use numbers and lower-case letters only.
627
+ # @param share_name [String] The name of the file share within the specified
628
+ # storage account. File share names must be between 3 and 63 characters in
629
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
630
+ # character must be immediately preceded and followed by a letter or number.
631
+ # @param [Hash{String => String}] A hash of custom headers that will be added
632
+ # to the HTTP request.
633
+ #
634
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
635
+ #
636
+ def delete_async(resource_group_name, account_name, share_name, custom_headers:nil)
637
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
638
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
639
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
640
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
641
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
642
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
643
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
644
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
645
+ fail ArgumentError, "'share_name' should satisfy the constraint - 'MaxLength': '63'" if !share_name.nil? && share_name.length > 63
646
+ fail ArgumentError, "'share_name' should satisfy the constraint - 'MinLength': '3'" if !share_name.nil? && share_name.length < 3
647
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
648
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
649
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
650
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
651
+
652
+
653
+ request_headers = {}
654
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
655
+
656
+ # Set Headers
657
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
658
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
659
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'
660
+
661
+ request_url = @base_url || @client.base_url
662
+
663
+ options = {
664
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
665
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name,'subscriptionId' => @client.subscription_id},
666
+ query_params: {'api-version' => @client.api_version},
667
+ headers: request_headers.merge(custom_headers || {}),
668
+ base_url: request_url
669
+ }
670
+ promise = @client.make_request_async(:delete, path_template, options)
671
+
672
+ promise = promise.then do |result|
673
+ http_response = result.response
674
+ status_code = http_response.status
675
+ response_content = http_response.body
676
+ unless status_code == 200 || status_code == 204
677
+ error_model = JSON.load(response_content)
678
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
679
+ end
680
+
681
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
682
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
683
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
684
+
685
+ result
686
+ end
687
+
688
+ promise.execute
689
+ end
690
+
691
+ #
692
+ # Restore a file share within a valid retention days if share soft delete is
693
+ # enabled
694
+ #
695
+ # @param resource_group_name [String] The name of the resource group within the
696
+ # user's subscription. The name is case insensitive.
697
+ # @param account_name [String] The name of the storage account within the
698
+ # specified resource group. Storage account names must be between 3 and 24
699
+ # characters in length and use numbers and lower-case letters only.
700
+ # @param share_name [String] The name of the file share within the specified
701
+ # storage account. File share names must be between 3 and 63 characters in
702
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
703
+ # character must be immediately preceded and followed by a letter or number.
704
+ # @param deleted_share [DeletedShare]
705
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
706
+ # will be added to the HTTP request.
707
+ #
708
+ #
709
+ def restore(resource_group_name, account_name, share_name, deleted_share, custom_headers:nil)
710
+ response = restore_async(resource_group_name, account_name, share_name, deleted_share, custom_headers:custom_headers).value!
711
+ nil
712
+ end
713
+
714
+ #
715
+ # Restore a file share within a valid retention days if share soft delete is
716
+ # enabled
717
+ #
718
+ # @param resource_group_name [String] The name of the resource group within the
719
+ # user's subscription. The name is case insensitive.
720
+ # @param account_name [String] The name of the storage account within the
721
+ # specified resource group. Storage account names must be between 3 and 24
722
+ # characters in length and use numbers and lower-case letters only.
723
+ # @param share_name [String] The name of the file share within the specified
724
+ # storage account. File share names must be between 3 and 63 characters in
725
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
726
+ # character must be immediately preceded and followed by a letter or number.
727
+ # @param deleted_share [DeletedShare]
728
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
729
+ # will be added to the HTTP request.
730
+ #
731
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
732
+ #
733
+ def restore_with_http_info(resource_group_name, account_name, share_name, deleted_share, custom_headers:nil)
734
+ restore_async(resource_group_name, account_name, share_name, deleted_share, custom_headers:custom_headers).value!
735
+ end
736
+
737
+ #
738
+ # Restore a file share within a valid retention days if share soft delete is
739
+ # enabled
740
+ #
741
+ # @param resource_group_name [String] The name of the resource group within the
742
+ # user's subscription. The name is case insensitive.
743
+ # @param account_name [String] The name of the storage account within the
744
+ # specified resource group. Storage account names must be between 3 and 24
745
+ # characters in length and use numbers and lower-case letters only.
746
+ # @param share_name [String] The name of the file share within the specified
747
+ # storage account. File share names must be between 3 and 63 characters in
748
+ # length and use numbers, lower-case letters and dash (-) only. Every dash (-)
749
+ # character must be immediately preceded and followed by a letter or number.
750
+ # @param deleted_share [DeletedShare]
751
+ # @param [Hash{String => String}] A hash of custom headers that will be added
752
+ # to the HTTP request.
753
+ #
754
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
755
+ #
756
+ def restore_async(resource_group_name, account_name, share_name, deleted_share, custom_headers:nil)
757
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
758
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
759
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
760
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
761
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
762
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
763
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
764
+ fail ArgumentError, 'share_name is nil' if share_name.nil?
765
+ fail ArgumentError, "'share_name' should satisfy the constraint - 'MaxLength': '63'" if !share_name.nil? && share_name.length > 63
766
+ fail ArgumentError, "'share_name' should satisfy the constraint - 'MinLength': '3'" if !share_name.nil? && share_name.length < 3
767
+ fail ArgumentError, 'deleted_share is nil' if deleted_share.nil?
768
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
769
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
770
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
771
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
772
+
773
+
774
+ request_headers = {}
775
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
776
+
777
+ # Set Headers
778
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
779
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
780
+
781
+ # Serialize Request
782
+ request_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::DeletedShare.mapper()
783
+ request_content = @client.serialize(request_mapper, deleted_share)
784
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
785
+
786
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore'
787
+
788
+ request_url = @base_url || @client.base_url
789
+
790
+ options = {
791
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
792
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'shareName' => share_name,'subscriptionId' => @client.subscription_id},
793
+ query_params: {'api-version' => @client.api_version},
794
+ body: request_content,
795
+ headers: request_headers.merge(custom_headers || {}),
796
+ base_url: request_url
797
+ }
798
+ promise = @client.make_request_async(:post, path_template, options)
799
+
800
+ promise = promise.then do |result|
801
+ http_response = result.response
802
+ status_code = http_response.status
803
+ response_content = http_response.body
804
+ unless status_code == 200
805
+ error_model = JSON.load(response_content)
806
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
807
+ end
808
+
809
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
810
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
811
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
812
+
813
+ result
814
+ end
815
+
816
+ promise.execute
817
+ end
818
+
819
+ #
820
+ # Lists all shares.
821
+ #
822
+ # @param next_page_link [String] The NextLink from the previous successful call
823
+ # to List operation.
824
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
825
+ # will be added to the HTTP request.
826
+ #
827
+ # @return [FileShareItems] operation results.
828
+ #
829
+ def list_next(next_page_link, custom_headers:nil)
830
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
831
+ response.body unless response.nil?
832
+ end
833
+
834
+ #
835
+ # Lists all shares.
836
+ #
837
+ # @param next_page_link [String] The NextLink from the previous successful call
838
+ # to List operation.
839
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
840
+ # will be added to the HTTP request.
841
+ #
842
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
843
+ #
844
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
845
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
846
+ end
847
+
848
+ #
849
+ # Lists all shares.
850
+ #
851
+ # @param next_page_link [String] The NextLink from the previous successful call
852
+ # to List operation.
853
+ # @param [Hash{String => String}] A hash of custom headers that will be added
854
+ # to the HTTP request.
855
+ #
856
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
857
+ #
858
+ def list_next_async(next_page_link, custom_headers:nil)
859
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
860
+
861
+
862
+ request_headers = {}
863
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
864
+
865
+ # Set Headers
866
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
867
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
868
+ path_template = '{nextLink}'
869
+
870
+ request_url = @base_url || @client.base_url
871
+
872
+ options = {
873
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
874
+ skip_encoding_path_params: {'nextLink' => next_page_link},
875
+ headers: request_headers.merge(custom_headers || {}),
876
+ base_url: request_url
877
+ }
878
+ promise = @client.make_request_async(:get, path_template, options)
879
+
880
+ promise = promise.then do |result|
881
+ http_response = result.response
882
+ status_code = http_response.status
883
+ response_content = http_response.body
884
+ unless status_code == 200
885
+ error_model = JSON.load(response_content)
886
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
887
+ end
888
+
889
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
890
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
891
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
892
+ # Deserialize Response
893
+ if status_code == 200
894
+ begin
895
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
896
+ result_mapper = Azure::Storage::Mgmt::V2020_08_01_preview::Models::FileShareItems.mapper()
897
+ result.body = @client.deserialize(result_mapper, parsed_response)
898
+ rescue Exception => e
899
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
900
+ end
901
+ end
902
+
903
+ result
904
+ end
905
+
906
+ promise.execute
907
+ end
908
+
909
+ #
910
+ # Lists all shares.
911
+ #
912
+ # @param resource_group_name [String] The name of the resource group within the
913
+ # user's subscription. The name is case insensitive.
914
+ # @param account_name [String] The name of the storage account within the
915
+ # specified resource group. Storage account names must be between 3 and 24
916
+ # characters in length and use numbers and lower-case letters only.
917
+ # @param maxpagesize [String] Optional. Specified maximum number of shares that
918
+ # can be included in the list.
919
+ # @param filter [String] Optional. When specified, only share names starting
920
+ # with the filter will be listed.
921
+ # @param expand [ListSharesExpand] Optional, used to expand the properties
922
+ # within share's properties. Possible values include: 'deleted'
923
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
924
+ # will be added to the HTTP request.
925
+ #
926
+ # @return [FileShareItems] which provide lazy access to pages of the response.
927
+ #
928
+ def list_as_lazy(resource_group_name, account_name, maxpagesize:nil, filter:nil, expand:nil, custom_headers:nil)
929
+ response = list_async(resource_group_name, account_name, maxpagesize:maxpagesize, filter:filter, expand:expand, custom_headers:custom_headers).value!
930
+ unless response.nil?
931
+ page = response.body
932
+ page.next_method = Proc.new do |next_page_link|
933
+ list_next_async(next_page_link, custom_headers:custom_headers)
934
+ end
935
+ page
936
+ end
937
+ end
938
+
939
+ end
940
+ end