azure_mgmt_storage 0.18.1 → 0.18.2

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