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
@@ -156,7 +156,7 @@ module Azure::Storage::Mgmt::V2019_04_01
156
156
  #
157
157
  def add_telemetry
158
158
  sdk_information = 'azure_mgmt_storage'
159
- sdk_information = "#{sdk_information}/0.18.1"
159
+ sdk_information = "#{sdk_information}/0.18.2"
160
160
  add_user_agent_information(sdk_information)
161
161
  end
162
162
  end
@@ -0,0 +1,152 @@
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
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2019-06-01/generated/azure_mgmt_storage/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Storage::Mgmt::V2019_06_01
23
+ autoload :Operations, '2019-06-01/generated/azure_mgmt_storage/operations.rb'
24
+ autoload :Skus, '2019-06-01/generated/azure_mgmt_storage/skus.rb'
25
+ autoload :StorageAccounts, '2019-06-01/generated/azure_mgmt_storage/storage_accounts.rb'
26
+ autoload :Usages, '2019-06-01/generated/azure_mgmt_storage/usages.rb'
27
+ autoload :ManagementPolicies, '2019-06-01/generated/azure_mgmt_storage/management_policies.rb'
28
+ autoload :PrivateEndpointConnections, '2019-06-01/generated/azure_mgmt_storage/private_endpoint_connections.rb'
29
+ autoload :PrivateLinkResources, '2019-06-01/generated/azure_mgmt_storage/private_link_resources.rb'
30
+ autoload :BlobServices, '2019-06-01/generated/azure_mgmt_storage/blob_services.rb'
31
+ autoload :BlobContainers, '2019-06-01/generated/azure_mgmt_storage/blob_containers.rb'
32
+ autoload :FileServices, '2019-06-01/generated/azure_mgmt_storage/file_services.rb'
33
+ autoload :FileShares, '2019-06-01/generated/azure_mgmt_storage/file_shares.rb'
34
+ autoload :StorageManagementClient, '2019-06-01/generated/azure_mgmt_storage/storage_management_client.rb'
35
+
36
+ module Models
37
+ autoload :ListServiceSasResponse, '2019-06-01/generated/azure_mgmt_storage/models/list_service_sas_response.rb'
38
+ autoload :OperationDisplay, '2019-06-01/generated/azure_mgmt_storage/models/operation_display.rb'
39
+ autoload :DateAfterModification, '2019-06-01/generated/azure_mgmt_storage/models/date_after_modification.rb'
40
+ autoload :MetricSpecification, '2019-06-01/generated/azure_mgmt_storage/models/metric_specification.rb'
41
+ autoload :ManagementPolicyBaseBlob, '2019-06-01/generated/azure_mgmt_storage/models/management_policy_base_blob.rb'
42
+ autoload :Operation, '2019-06-01/generated/azure_mgmt_storage/models/operation.rb'
43
+ autoload :DateAfterCreation, '2019-06-01/generated/azure_mgmt_storage/models/date_after_creation.rb'
44
+ autoload :StorageAccountCheckNameAvailabilityParameters, '2019-06-01/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb'
45
+ autoload :ManagementPolicySnapShot, '2019-06-01/generated/azure_mgmt_storage/models/management_policy_snap_shot.rb'
46
+ autoload :Restriction, '2019-06-01/generated/azure_mgmt_storage/models/restriction.rb'
47
+ autoload :ManagementPolicyAction, '2019-06-01/generated/azure_mgmt_storage/models/management_policy_action.rb'
48
+ autoload :StorageSkuListResult, '2019-06-01/generated/azure_mgmt_storage/models/storage_sku_list_result.rb'
49
+ autoload :ManagementPolicyFilter, '2019-06-01/generated/azure_mgmt_storage/models/management_policy_filter.rb'
50
+ autoload :CustomDomain, '2019-06-01/generated/azure_mgmt_storage/models/custom_domain.rb'
51
+ autoload :ManagementPolicyDefinition, '2019-06-01/generated/azure_mgmt_storage/models/management_policy_definition.rb'
52
+ autoload :EncryptionServices, '2019-06-01/generated/azure_mgmt_storage/models/encryption_services.rb'
53
+ autoload :ManagementPolicyRule, '2019-06-01/generated/azure_mgmt_storage/models/management_policy_rule.rb'
54
+ autoload :Encryption, '2019-06-01/generated/azure_mgmt_storage/models/encryption.rb'
55
+ autoload :ManagementPolicySchema, '2019-06-01/generated/azure_mgmt_storage/models/management_policy_schema.rb'
56
+ autoload :IPRule, '2019-06-01/generated/azure_mgmt_storage/models/iprule.rb'
57
+ autoload :Sku, '2019-06-01/generated/azure_mgmt_storage/models/sku.rb'
58
+ autoload :ActiveDirectoryProperties, '2019-06-01/generated/azure_mgmt_storage/models/active_directory_properties.rb'
59
+ autoload :CheckNameAvailabilityResult, '2019-06-01/generated/azure_mgmt_storage/models/check_name_availability_result.rb'
60
+ autoload :Identity, '2019-06-01/generated/azure_mgmt_storage/models/identity.rb'
61
+ autoload :EncryptionService, '2019-06-01/generated/azure_mgmt_storage/models/encryption_service.rb'
62
+ autoload :Endpoints, '2019-06-01/generated/azure_mgmt_storage/models/endpoints.rb'
63
+ autoload :KeyVaultProperties, '2019-06-01/generated/azure_mgmt_storage/models/key_vault_properties.rb'
64
+ autoload :PrivateEndpoint, '2019-06-01/generated/azure_mgmt_storage/models/private_endpoint.rb'
65
+ autoload :VirtualNetworkRule, '2019-06-01/generated/azure_mgmt_storage/models/virtual_network_rule.rb'
66
+ autoload :PrivateLinkServiceConnectionState, '2019-06-01/generated/azure_mgmt_storage/models/private_link_service_connection_state.rb'
67
+ autoload :CorsRules, '2019-06-01/generated/azure_mgmt_storage/models/cors_rules.rb'
68
+ autoload :StorageAccountKey, '2019-06-01/generated/azure_mgmt_storage/models/storage_account_key.rb'
69
+ autoload :NetworkRuleSet, '2019-06-01/generated/azure_mgmt_storage/models/network_rule_set.rb'
70
+ autoload :StorageAccountListKeysResult, '2019-06-01/generated/azure_mgmt_storage/models/storage_account_list_keys_result.rb'
71
+ autoload :StorageAccountUpdateParameters, '2019-06-01/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb'
72
+ autoload :Usage, '2019-06-01/generated/azure_mgmt_storage/models/usage.rb'
73
+ autoload :PrivateLinkResourceListResult, '2019-06-01/generated/azure_mgmt_storage/models/private_link_resource_list_result.rb'
74
+ autoload :AccountSasParameters, '2019-06-01/generated/azure_mgmt_storage/models/account_sas_parameters.rb'
75
+ autoload :ErrorResponse, '2019-06-01/generated/azure_mgmt_storage/models/error_response.rb'
76
+ autoload :ServiceSasParameters, '2019-06-01/generated/azure_mgmt_storage/models/service_sas_parameters.rb'
77
+ autoload :FileShareItems, '2019-06-01/generated/azure_mgmt_storage/models/file_share_items.rb'
78
+ autoload :ServiceSpecification, '2019-06-01/generated/azure_mgmt_storage/models/service_specification.rb'
79
+ autoload :FileServiceItems, '2019-06-01/generated/azure_mgmt_storage/models/file_service_items.rb'
80
+ autoload :SKUCapability, '2019-06-01/generated/azure_mgmt_storage/models/skucapability.rb'
81
+ autoload :LeaseContainerResponse, '2019-06-01/generated/azure_mgmt_storage/models/lease_container_response.rb'
82
+ autoload :StorageAccountCreateParameters, '2019-06-01/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb'
83
+ autoload :Resource, '2019-06-01/generated/azure_mgmt_storage/models/resource.rb'
84
+ autoload :DeleteRetentionPolicy, '2019-06-01/generated/azure_mgmt_storage/models/delete_retention_policy.rb'
85
+ autoload :UpdateHistoryProperty, '2019-06-01/generated/azure_mgmt_storage/models/update_history_property.rb'
86
+ autoload :StorageAccountRegenerateKeyParameters, '2019-06-01/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb'
87
+ autoload :ImmutabilityPolicyProperties, '2019-06-01/generated/azure_mgmt_storage/models/immutability_policy_properties.rb'
88
+ autoload :UsageListResult, '2019-06-01/generated/azure_mgmt_storage/models/usage_list_result.rb'
89
+ autoload :TagProperty, '2019-06-01/generated/azure_mgmt_storage/models/tag_property.rb'
90
+ autoload :Dimension, '2019-06-01/generated/azure_mgmt_storage/models/dimension.rb'
91
+ autoload :LegalHoldProperties, '2019-06-01/generated/azure_mgmt_storage/models/legal_hold_properties.rb'
92
+ autoload :AzureFilesIdentityBasedAuthentication, '2019-06-01/generated/azure_mgmt_storage/models/azure_files_identity_based_authentication.rb'
93
+ autoload :LeaseContainerRequest, '2019-06-01/generated/azure_mgmt_storage/models/lease_container_request.rb'
94
+ autoload :StorageAccountListResult, '2019-06-01/generated/azure_mgmt_storage/models/storage_account_list_result.rb'
95
+ autoload :BlobServiceItems, '2019-06-01/generated/azure_mgmt_storage/models/blob_service_items.rb'
96
+ autoload :ListAccountSasResponse, '2019-06-01/generated/azure_mgmt_storage/models/list_account_sas_response.rb'
97
+ autoload :LegalHold, '2019-06-01/generated/azure_mgmt_storage/models/legal_hold.rb'
98
+ autoload :GeoReplicationStats, '2019-06-01/generated/azure_mgmt_storage/models/geo_replication_stats.rb'
99
+ autoload :ChangeFeed, '2019-06-01/generated/azure_mgmt_storage/models/change_feed.rb'
100
+ autoload :OperationListResult, '2019-06-01/generated/azure_mgmt_storage/models/operation_list_result.rb'
101
+ autoload :ListContainerItems, '2019-06-01/generated/azure_mgmt_storage/models/list_container_items.rb'
102
+ autoload :UsageName, '2019-06-01/generated/azure_mgmt_storage/models/usage_name.rb'
103
+ autoload :CorsRule, '2019-06-01/generated/azure_mgmt_storage/models/cors_rule.rb'
104
+ autoload :PrivateEndpointConnection, '2019-06-01/generated/azure_mgmt_storage/models/private_endpoint_connection.rb'
105
+ autoload :StorageAccount, '2019-06-01/generated/azure_mgmt_storage/models/storage_account.rb'
106
+ autoload :ManagementPolicy, '2019-06-01/generated/azure_mgmt_storage/models/management_policy.rb'
107
+ autoload :PrivateLinkResource, '2019-06-01/generated/azure_mgmt_storage/models/private_link_resource.rb'
108
+ autoload :ProxyResource, '2019-06-01/generated/azure_mgmt_storage/models/proxy_resource.rb'
109
+ autoload :TrackedResource, '2019-06-01/generated/azure_mgmt_storage/models/tracked_resource.rb'
110
+ autoload :AzureEntityResource, '2019-06-01/generated/azure_mgmt_storage/models/azure_entity_resource.rb'
111
+ autoload :BlobContainer, '2019-06-01/generated/azure_mgmt_storage/models/blob_container.rb'
112
+ autoload :ImmutabilityPolicy, '2019-06-01/generated/azure_mgmt_storage/models/immutability_policy.rb'
113
+ autoload :ListContainerItem, '2019-06-01/generated/azure_mgmt_storage/models/list_container_item.rb'
114
+ autoload :BlobServiceProperties, '2019-06-01/generated/azure_mgmt_storage/models/blob_service_properties.rb'
115
+ autoload :FileServiceProperties, '2019-06-01/generated/azure_mgmt_storage/models/file_service_properties.rb'
116
+ autoload :FileShare, '2019-06-01/generated/azure_mgmt_storage/models/file_share.rb'
117
+ autoload :FileShareItem, '2019-06-01/generated/azure_mgmt_storage/models/file_share_item.rb'
118
+ autoload :ReasonCode, '2019-06-01/generated/azure_mgmt_storage/models/reason_code.rb'
119
+ autoload :SkuName, '2019-06-01/generated/azure_mgmt_storage/models/sku_name.rb'
120
+ autoload :SkuTier, '2019-06-01/generated/azure_mgmt_storage/models/sku_tier.rb'
121
+ autoload :Kind, '2019-06-01/generated/azure_mgmt_storage/models/kind.rb'
122
+ autoload :Reason, '2019-06-01/generated/azure_mgmt_storage/models/reason.rb'
123
+ autoload :KeySource, '2019-06-01/generated/azure_mgmt_storage/models/key_source.rb'
124
+ autoload :Action, '2019-06-01/generated/azure_mgmt_storage/models/action.rb'
125
+ autoload :State, '2019-06-01/generated/azure_mgmt_storage/models/state.rb'
126
+ autoload :Bypass, '2019-06-01/generated/azure_mgmt_storage/models/bypass.rb'
127
+ autoload :DefaultAction, '2019-06-01/generated/azure_mgmt_storage/models/default_action.rb'
128
+ autoload :DirectoryServiceOptions, '2019-06-01/generated/azure_mgmt_storage/models/directory_service_options.rb'
129
+ autoload :AccessTier, '2019-06-01/generated/azure_mgmt_storage/models/access_tier.rb'
130
+ autoload :LargeFileSharesState, '2019-06-01/generated/azure_mgmt_storage/models/large_file_shares_state.rb'
131
+ autoload :GeoReplicationStatus, '2019-06-01/generated/azure_mgmt_storage/models/geo_replication_status.rb'
132
+ autoload :ProvisioningState, '2019-06-01/generated/azure_mgmt_storage/models/provisioning_state.rb'
133
+ autoload :AccountStatus, '2019-06-01/generated/azure_mgmt_storage/models/account_status.rb'
134
+ autoload :PrivateEndpointServiceConnectionStatus, '2019-06-01/generated/azure_mgmt_storage/models/private_endpoint_service_connection_status.rb'
135
+ autoload :PrivateEndpointConnectionProvisioningState, '2019-06-01/generated/azure_mgmt_storage/models/private_endpoint_connection_provisioning_state.rb'
136
+ autoload :KeyPermission, '2019-06-01/generated/azure_mgmt_storage/models/key_permission.rb'
137
+ autoload :UsageUnit, '2019-06-01/generated/azure_mgmt_storage/models/usage_unit.rb'
138
+ autoload :Services, '2019-06-01/generated/azure_mgmt_storage/models/services.rb'
139
+ autoload :SignedResourceTypes, '2019-06-01/generated/azure_mgmt_storage/models/signed_resource_types.rb'
140
+ autoload :Permissions, '2019-06-01/generated/azure_mgmt_storage/models/permissions.rb'
141
+ autoload :HttpProtocol, '2019-06-01/generated/azure_mgmt_storage/models/http_protocol.rb'
142
+ autoload :SignedResource, '2019-06-01/generated/azure_mgmt_storage/models/signed_resource.rb'
143
+ autoload :PublicAccess, '2019-06-01/generated/azure_mgmt_storage/models/public_access.rb'
144
+ autoload :LeaseStatus, '2019-06-01/generated/azure_mgmt_storage/models/lease_status.rb'
145
+ autoload :LeaseState, '2019-06-01/generated/azure_mgmt_storage/models/lease_state.rb'
146
+ autoload :LeaseDuration, '2019-06-01/generated/azure_mgmt_storage/models/lease_duration.rb'
147
+ autoload :ImmutabilityPolicyState, '2019-06-01/generated/azure_mgmt_storage/models/immutability_policy_state.rb'
148
+ autoload :ImmutabilityPolicyUpdateType, '2019-06-01/generated/azure_mgmt_storage/models/immutability_policy_update_type.rb'
149
+ autoload :StorageAccountExpand, '2019-06-01/generated/azure_mgmt_storage/models/storage_account_expand.rb'
150
+ autoload :ListKeyExpand, '2019-06-01/generated/azure_mgmt_storage/models/list_key_expand.rb'
151
+ end
152
+ end
@@ -0,0 +1,2034 @@
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 BlobContainers
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the BlobContainers 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 containers and does not support a prefix like data plane. Also SRP
26
+ # today does not return continuation token.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group within the
29
+ # user's subscription. The name is case insensitive.
30
+ # @param account_name [String] The name of the storage account within the
31
+ # specified resource group. Storage account names must be between 3 and 24
32
+ # characters in length and use numbers and lower-case letters only.
33
+ # @param maxpagesize [String] Optional. Specified maximum number of containers
34
+ # that can be included in the list.
35
+ # @param filter [String] Optional. When specified, only container names
36
+ # starting with the filter will be listed.
37
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
+ # will be added to the HTTP request.
39
+ #
40
+ # @return [Array<ListContainerItem>] operation results.
41
+ #
42
+ def list(resource_group_name, account_name, maxpagesize:nil, filter:nil, custom_headers:nil)
43
+ first_page = list_as_lazy(resource_group_name, account_name, maxpagesize:maxpagesize, filter:filter, custom_headers:custom_headers)
44
+ first_page.get_all_items
45
+ end
46
+
47
+ #
48
+ # Lists all containers and does not support a prefix like data plane. Also SRP
49
+ # today does not return continuation token.
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 containers
57
+ # that can be included in the list.
58
+ # @param filter [String] Optional. When specified, only container names
59
+ # starting with the filter will be listed.
60
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
61
+ # will be added to the HTTP request.
62
+ #
63
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
64
+ #
65
+ def list_with_http_info(resource_group_name, account_name, maxpagesize:nil, filter:nil, custom_headers:nil)
66
+ list_async(resource_group_name, account_name, maxpagesize:maxpagesize, filter:filter, custom_headers:custom_headers).value!
67
+ end
68
+
69
+ #
70
+ # Lists all containers and does not support a prefix like data plane. Also SRP
71
+ # today does not return continuation token.
72
+ #
73
+ # @param resource_group_name [String] The name of the resource group within the
74
+ # user's subscription. The name is case insensitive.
75
+ # @param account_name [String] The name of the storage account within the
76
+ # specified resource group. Storage account names must be between 3 and 24
77
+ # characters in length and use numbers and lower-case letters only.
78
+ # @param maxpagesize [String] Optional. Specified maximum number of containers
79
+ # that can be included in the list.
80
+ # @param filter [String] Optional. When specified, only container names
81
+ # starting with the filter will be listed.
82
+ # @param [Hash{String => String}] A hash of custom headers that will be added
83
+ # to the HTTP request.
84
+ #
85
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
86
+ #
87
+ def list_async(resource_group_name, account_name, maxpagesize:nil, filter:nil, custom_headers:nil)
88
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
89
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
90
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
91
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
92
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
93
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
94
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
95
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
96
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
97
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
98
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
99
+
100
+
101
+ request_headers = {}
102
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
103
+
104
+ # Set Headers
105
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
106
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
107
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'
108
+
109
+ request_url = @base_url || @client.base_url
110
+
111
+ options = {
112
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
113
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
114
+ query_params: {'api-version' => @client.api_version,'$maxpagesize' => maxpagesize,'$filter' => filter},
115
+ headers: request_headers.merge(custom_headers || {}),
116
+ base_url: request_url
117
+ }
118
+ promise = @client.make_request_async(:get, path_template, options)
119
+
120
+ promise = promise.then do |result|
121
+ http_response = result.response
122
+ status_code = http_response.status
123
+ response_content = http_response.body
124
+ unless status_code == 200
125
+ error_model = JSON.load(response_content)
126
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
127
+ end
128
+
129
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
130
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
131
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
132
+ # Deserialize Response
133
+ if status_code == 200
134
+ begin
135
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
136
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ListContainerItems.mapper()
137
+ result.body = @client.deserialize(result_mapper, parsed_response)
138
+ rescue Exception => e
139
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
140
+ end
141
+ end
142
+
143
+ result
144
+ end
145
+
146
+ promise.execute
147
+ end
148
+
149
+ #
150
+ # Creates a new container under the specified account as described by request
151
+ # body. The container resource includes metadata and properties for that
152
+ # container. It does not include a list of the blobs contained by the
153
+ # container.
154
+ #
155
+ # @param resource_group_name [String] The name of the resource group within the
156
+ # user's subscription. The name is case insensitive.
157
+ # @param account_name [String] The name of the storage account within the
158
+ # specified resource group. Storage account names must be between 3 and 24
159
+ # characters in length and use numbers and lower-case letters only.
160
+ # @param container_name [String] The name of the blob container within the
161
+ # specified storage account. Blob container names must be between 3 and 63
162
+ # characters in length and use numbers, lower-case letters and dash (-) only.
163
+ # Every dash (-) character must be immediately preceded and followed by a
164
+ # letter or number.
165
+ # @param blob_container [BlobContainer] Properties of the blob container to
166
+ # 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 [BlobContainer] operation results.
171
+ #
172
+ def create(resource_group_name, account_name, container_name, blob_container, custom_headers:nil)
173
+ response = create_async(resource_group_name, account_name, container_name, blob_container, custom_headers:custom_headers).value!
174
+ response.body unless response.nil?
175
+ end
176
+
177
+ #
178
+ # Creates a new container under the specified account as described by request
179
+ # body. The container resource includes metadata and properties for that
180
+ # container. It does not include a list of the blobs contained by the
181
+ # container.
182
+ #
183
+ # @param resource_group_name [String] The name of the resource group within the
184
+ # user's subscription. The name is case insensitive.
185
+ # @param account_name [String] The name of the storage account within the
186
+ # specified resource group. Storage account names must be between 3 and 24
187
+ # characters in length and use numbers and lower-case letters only.
188
+ # @param container_name [String] The name of the blob container within the
189
+ # specified storage account. Blob container names must be between 3 and 63
190
+ # characters in length and use numbers, lower-case letters and dash (-) only.
191
+ # Every dash (-) character must be immediately preceded and followed by a
192
+ # letter or number.
193
+ # @param blob_container [BlobContainer] Properties of the blob container to
194
+ # create.
195
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
196
+ # will be added to the HTTP request.
197
+ #
198
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
199
+ #
200
+ def create_with_http_info(resource_group_name, account_name, container_name, blob_container, custom_headers:nil)
201
+ create_async(resource_group_name, account_name, container_name, blob_container, custom_headers:custom_headers).value!
202
+ end
203
+
204
+ #
205
+ # Creates a new container under the specified account as described by request
206
+ # body. The container resource includes metadata and properties for that
207
+ # container. It does not include a list of the blobs contained by the
208
+ # container.
209
+ #
210
+ # @param resource_group_name [String] The name of the resource group within the
211
+ # user's subscription. The name is case insensitive.
212
+ # @param account_name [String] The name of the storage account within the
213
+ # specified resource group. Storage account names must be between 3 and 24
214
+ # characters in length and use numbers and lower-case letters only.
215
+ # @param container_name [String] The name of the blob container within the
216
+ # specified storage account. Blob container names must be between 3 and 63
217
+ # characters in length and use numbers, lower-case letters and dash (-) only.
218
+ # Every dash (-) character must be immediately preceded and followed by a
219
+ # letter or number.
220
+ # @param blob_container [BlobContainer] Properties of the blob container to
221
+ # create.
222
+ # @param [Hash{String => String}] A hash of custom headers that will be added
223
+ # to the HTTP request.
224
+ #
225
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
226
+ #
227
+ def create_async(resource_group_name, account_name, container_name, blob_container, custom_headers:nil)
228
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
229
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
230
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
231
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
232
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
233
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
234
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
235
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
236
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
237
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
238
+ fail ArgumentError, 'blob_container is nil' if blob_container.nil?
239
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
240
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
241
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
242
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
243
+
244
+
245
+ request_headers = {}
246
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
247
+
248
+ # Set Headers
249
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
250
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
251
+
252
+ # Serialize Request
253
+ request_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::BlobContainer.mapper()
254
+ request_content = @client.serialize(request_mapper, blob_container)
255
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
256
+
257
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'
258
+
259
+ request_url = @base_url || @client.base_url
260
+
261
+ options = {
262
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
263
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
264
+ query_params: {'api-version' => @client.api_version},
265
+ body: request_content,
266
+ headers: request_headers.merge(custom_headers || {}),
267
+ base_url: request_url
268
+ }
269
+ promise = @client.make_request_async(:put, path_template, options)
270
+
271
+ promise = promise.then do |result|
272
+ http_response = result.response
273
+ status_code = http_response.status
274
+ response_content = http_response.body
275
+ unless status_code == 201 || status_code == 200
276
+ error_model = JSON.load(response_content)
277
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
278
+ end
279
+
280
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
281
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
282
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
283
+ # Deserialize Response
284
+ if status_code == 201
285
+ begin
286
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
287
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::BlobContainer.mapper()
288
+ result.body = @client.deserialize(result_mapper, parsed_response)
289
+ rescue Exception => e
290
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
291
+ end
292
+ end
293
+ # Deserialize Response
294
+ if status_code == 200
295
+ begin
296
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
297
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::BlobContainer.mapper()
298
+ result.body = @client.deserialize(result_mapper, parsed_response)
299
+ rescue Exception => e
300
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
301
+ end
302
+ end
303
+
304
+ result
305
+ end
306
+
307
+ promise.execute
308
+ end
309
+
310
+ #
311
+ # Updates container properties as specified in request body. Properties not
312
+ # mentioned in the request will be unchanged. Update fails if the specified
313
+ # container doesn't already exist.
314
+ #
315
+ # @param resource_group_name [String] The name of the resource group within the
316
+ # user's subscription. The name is case insensitive.
317
+ # @param account_name [String] The name of the storage account within the
318
+ # specified resource group. Storage account names must be between 3 and 24
319
+ # characters in length and use numbers and lower-case letters only.
320
+ # @param container_name [String] The name of the blob container within the
321
+ # specified storage account. Blob container names must be between 3 and 63
322
+ # characters in length and use numbers, lower-case letters and dash (-) only.
323
+ # Every dash (-) character must be immediately preceded and followed by a
324
+ # letter or number.
325
+ # @param blob_container [BlobContainer] Properties to update for the blob
326
+ # container.
327
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
328
+ # will be added to the HTTP request.
329
+ #
330
+ # @return [BlobContainer] operation results.
331
+ #
332
+ def update(resource_group_name, account_name, container_name, blob_container, custom_headers:nil)
333
+ response = update_async(resource_group_name, account_name, container_name, blob_container, custom_headers:custom_headers).value!
334
+ response.body unless response.nil?
335
+ end
336
+
337
+ #
338
+ # Updates container properties as specified in request body. Properties not
339
+ # mentioned in the request will be unchanged. Update fails if the specified
340
+ # container doesn't already exist.
341
+ #
342
+ # @param resource_group_name [String] The name of the resource group within the
343
+ # user's subscription. The name is case insensitive.
344
+ # @param account_name [String] The name of the storage account within the
345
+ # specified resource group. Storage account names must be between 3 and 24
346
+ # characters in length and use numbers and lower-case letters only.
347
+ # @param container_name [String] The name of the blob container within the
348
+ # specified storage account. Blob container names must be between 3 and 63
349
+ # characters in length and use numbers, lower-case letters and dash (-) only.
350
+ # Every dash (-) character must be immediately preceded and followed by a
351
+ # letter or number.
352
+ # @param blob_container [BlobContainer] Properties to update for the blob
353
+ # container.
354
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
355
+ # will be added to the HTTP request.
356
+ #
357
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
358
+ #
359
+ def update_with_http_info(resource_group_name, account_name, container_name, blob_container, custom_headers:nil)
360
+ update_async(resource_group_name, account_name, container_name, blob_container, custom_headers:custom_headers).value!
361
+ end
362
+
363
+ #
364
+ # Updates container properties as specified in request body. Properties not
365
+ # mentioned in the request will be unchanged. Update fails if the specified
366
+ # container doesn't already exist.
367
+ #
368
+ # @param resource_group_name [String] The name of the resource group within the
369
+ # user's subscription. The name is case insensitive.
370
+ # @param account_name [String] The name of the storage account within the
371
+ # specified resource group. Storage account names must be between 3 and 24
372
+ # characters in length and use numbers and lower-case letters only.
373
+ # @param container_name [String] The name of the blob container within the
374
+ # specified storage account. Blob container names must be between 3 and 63
375
+ # characters in length and use numbers, lower-case letters and dash (-) only.
376
+ # Every dash (-) character must be immediately preceded and followed by a
377
+ # letter or number.
378
+ # @param blob_container [BlobContainer] Properties to update for the blob
379
+ # container.
380
+ # @param [Hash{String => String}] A hash of custom headers that will be added
381
+ # to the HTTP request.
382
+ #
383
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
384
+ #
385
+ def update_async(resource_group_name, account_name, container_name, blob_container, custom_headers:nil)
386
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
387
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
388
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
389
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
390
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
391
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
392
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
393
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
394
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
395
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
396
+ fail ArgumentError, 'blob_container is nil' if blob_container.nil?
397
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
398
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
399
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
400
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
401
+
402
+
403
+ request_headers = {}
404
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
405
+
406
+ # Set Headers
407
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
408
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
409
+
410
+ # Serialize Request
411
+ request_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::BlobContainer.mapper()
412
+ request_content = @client.serialize(request_mapper, blob_container)
413
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
414
+
415
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'
416
+
417
+ request_url = @base_url || @client.base_url
418
+
419
+ options = {
420
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
421
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
422
+ query_params: {'api-version' => @client.api_version},
423
+ body: request_content,
424
+ headers: request_headers.merge(custom_headers || {}),
425
+ base_url: request_url
426
+ }
427
+ promise = @client.make_request_async(:patch, path_template, options)
428
+
429
+ promise = promise.then do |result|
430
+ http_response = result.response
431
+ status_code = http_response.status
432
+ response_content = http_response.body
433
+ unless status_code == 200
434
+ error_model = JSON.load(response_content)
435
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
436
+ end
437
+
438
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
439
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
440
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
441
+ # Deserialize Response
442
+ if status_code == 200
443
+ begin
444
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
445
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::BlobContainer.mapper()
446
+ result.body = @client.deserialize(result_mapper, parsed_response)
447
+ rescue Exception => e
448
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
449
+ end
450
+ end
451
+
452
+ result
453
+ end
454
+
455
+ promise.execute
456
+ end
457
+
458
+ #
459
+ # Gets properties of a specified container.
460
+ #
461
+ # @param resource_group_name [String] The name of the resource group within the
462
+ # user's subscription. The name is case insensitive.
463
+ # @param account_name [String] The name of the storage account within the
464
+ # specified resource group. Storage account names must be between 3 and 24
465
+ # characters in length and use numbers and lower-case letters only.
466
+ # @param container_name [String] The name of the blob container within the
467
+ # specified storage account. Blob container names must be between 3 and 63
468
+ # characters in length and use numbers, lower-case letters and dash (-) only.
469
+ # Every dash (-) character must be immediately preceded and followed by a
470
+ # letter or number.
471
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
472
+ # will be added to the HTTP request.
473
+ #
474
+ # @return [BlobContainer] operation results.
475
+ #
476
+ def get(resource_group_name, account_name, container_name, custom_headers:nil)
477
+ response = get_async(resource_group_name, account_name, container_name, custom_headers:custom_headers).value!
478
+ response.body unless response.nil?
479
+ end
480
+
481
+ #
482
+ # Gets properties of a specified container.
483
+ #
484
+ # @param resource_group_name [String] The name of the resource group within the
485
+ # user's subscription. The name is case insensitive.
486
+ # @param account_name [String] The name of the storage account within the
487
+ # specified resource group. Storage account names must be between 3 and 24
488
+ # characters in length and use numbers and lower-case letters only.
489
+ # @param container_name [String] The name of the blob container within the
490
+ # specified storage account. Blob container names must be between 3 and 63
491
+ # characters in length and use numbers, lower-case letters and dash (-) only.
492
+ # Every dash (-) character must be immediately preceded and followed by a
493
+ # letter or number.
494
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
495
+ # will be added to the HTTP request.
496
+ #
497
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
498
+ #
499
+ def get_with_http_info(resource_group_name, account_name, container_name, custom_headers:nil)
500
+ get_async(resource_group_name, account_name, container_name, custom_headers:custom_headers).value!
501
+ end
502
+
503
+ #
504
+ # Gets properties of a specified container.
505
+ #
506
+ # @param resource_group_name [String] The name of the resource group within the
507
+ # user's subscription. The name is case insensitive.
508
+ # @param account_name [String] The name of the storage account within the
509
+ # specified resource group. Storage account names must be between 3 and 24
510
+ # characters in length and use numbers and lower-case letters only.
511
+ # @param container_name [String] The name of the blob container within the
512
+ # specified storage account. Blob container names must be between 3 and 63
513
+ # characters in length and use numbers, lower-case letters and dash (-) only.
514
+ # Every dash (-) character must be immediately preceded and followed by a
515
+ # letter or number.
516
+ # @param [Hash{String => String}] A hash of custom headers that will be added
517
+ # to the HTTP request.
518
+ #
519
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
520
+ #
521
+ def get_async(resource_group_name, account_name, container_name, custom_headers:nil)
522
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
523
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
524
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
525
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
526
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
527
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
528
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
529
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
530
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
531
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
532
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
533
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
534
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
535
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
536
+
537
+
538
+ request_headers = {}
539
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
540
+
541
+ # Set Headers
542
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
543
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
544
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'
545
+
546
+ request_url = @base_url || @client.base_url
547
+
548
+ options = {
549
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
550
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
551
+ query_params: {'api-version' => @client.api_version},
552
+ headers: request_headers.merge(custom_headers || {}),
553
+ base_url: request_url
554
+ }
555
+ promise = @client.make_request_async(:get, path_template, options)
556
+
557
+ promise = promise.then do |result|
558
+ http_response = result.response
559
+ status_code = http_response.status
560
+ response_content = http_response.body
561
+ unless status_code == 200
562
+ error_model = JSON.load(response_content)
563
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
564
+ end
565
+
566
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
567
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
568
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
569
+ # Deserialize Response
570
+ if status_code == 200
571
+ begin
572
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
573
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::BlobContainer.mapper()
574
+ result.body = @client.deserialize(result_mapper, parsed_response)
575
+ rescue Exception => e
576
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
577
+ end
578
+ end
579
+
580
+ result
581
+ end
582
+
583
+ promise.execute
584
+ end
585
+
586
+ #
587
+ # Deletes specified container 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 container_name [String] The name of the blob container within the
595
+ # specified storage account. Blob container names must be between 3 and 63
596
+ # characters in length and use numbers, lower-case letters and dash (-) only.
597
+ # Every dash (-) character must be immediately preceded and followed by a
598
+ # letter or number.
599
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
600
+ # will be added to the HTTP request.
601
+ #
602
+ #
603
+ def delete(resource_group_name, account_name, container_name, custom_headers:nil)
604
+ response = delete_async(resource_group_name, account_name, container_name, custom_headers:custom_headers).value!
605
+ nil
606
+ end
607
+
608
+ #
609
+ # Deletes specified container under its account.
610
+ #
611
+ # @param resource_group_name [String] The name of the resource group within the
612
+ # user's subscription. The name is case insensitive.
613
+ # @param account_name [String] The name of the storage account within the
614
+ # specified resource group. Storage account names must be between 3 and 24
615
+ # characters in length and use numbers and lower-case letters only.
616
+ # @param container_name [String] The name of the blob container within the
617
+ # specified storage account. Blob container names must be between 3 and 63
618
+ # characters in length and use numbers, lower-case letters and dash (-) only.
619
+ # Every dash (-) character must be immediately preceded and followed by a
620
+ # letter or number.
621
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
622
+ # will be added to the HTTP request.
623
+ #
624
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
625
+ #
626
+ def delete_with_http_info(resource_group_name, account_name, container_name, custom_headers:nil)
627
+ delete_async(resource_group_name, account_name, container_name, custom_headers:custom_headers).value!
628
+ end
629
+
630
+ #
631
+ # Deletes specified container under its account.
632
+ #
633
+ # @param resource_group_name [String] The name of the resource group within the
634
+ # user's subscription. The name is case insensitive.
635
+ # @param account_name [String] The name of the storage account within the
636
+ # specified resource group. Storage account names must be between 3 and 24
637
+ # characters in length and use numbers and lower-case letters only.
638
+ # @param container_name [String] The name of the blob container within the
639
+ # specified storage account. Blob container names must be between 3 and 63
640
+ # characters in length and use numbers, lower-case letters and dash (-) only.
641
+ # Every dash (-) character must be immediately preceded and followed by a
642
+ # letter or number.
643
+ # @param [Hash{String => String}] A hash of custom headers that will be added
644
+ # to the HTTP request.
645
+ #
646
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
647
+ #
648
+ def delete_async(resource_group_name, account_name, container_name, custom_headers:nil)
649
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
650
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
651
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
652
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
653
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
654
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
655
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
656
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
657
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
658
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
659
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
660
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
661
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
662
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
663
+
664
+
665
+ request_headers = {}
666
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
667
+
668
+ # Set Headers
669
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
670
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
671
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'
672
+
673
+ request_url = @base_url || @client.base_url
674
+
675
+ options = {
676
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
677
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
678
+ query_params: {'api-version' => @client.api_version},
679
+ headers: request_headers.merge(custom_headers || {}),
680
+ base_url: request_url
681
+ }
682
+ promise = @client.make_request_async(:delete, path_template, options)
683
+
684
+ promise = promise.then do |result|
685
+ http_response = result.response
686
+ status_code = http_response.status
687
+ response_content = http_response.body
688
+ unless status_code == 200 || status_code == 204
689
+ error_model = JSON.load(response_content)
690
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
691
+ end
692
+
693
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
694
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
695
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
696
+
697
+ result
698
+ end
699
+
700
+ promise.execute
701
+ end
702
+
703
+ #
704
+ # Sets legal hold tags. Setting the same tag results in an idempotent
705
+ # operation. SetLegalHold follows an append pattern and does not clear out the
706
+ # existing tags that are not specified in the request.
707
+ #
708
+ # @param resource_group_name [String] The name of the resource group within the
709
+ # user's subscription. The name is case insensitive.
710
+ # @param account_name [String] The name of the storage account within the
711
+ # specified resource group. Storage account names must be between 3 and 24
712
+ # characters in length and use numbers and lower-case letters only.
713
+ # @param container_name [String] The name of the blob container within the
714
+ # specified storage account. Blob container names must be between 3 and 63
715
+ # characters in length and use numbers, lower-case letters and dash (-) only.
716
+ # Every dash (-) character must be immediately preceded and followed by a
717
+ # letter or number.
718
+ # @param legal_hold [LegalHold] The LegalHold property that will be set to a
719
+ # blob container.
720
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
721
+ # will be added to the HTTP request.
722
+ #
723
+ # @return [LegalHold] operation results.
724
+ #
725
+ def set_legal_hold(resource_group_name, account_name, container_name, legal_hold, custom_headers:nil)
726
+ response = set_legal_hold_async(resource_group_name, account_name, container_name, legal_hold, custom_headers:custom_headers).value!
727
+ response.body unless response.nil?
728
+ end
729
+
730
+ #
731
+ # Sets legal hold tags. Setting the same tag results in an idempotent
732
+ # operation. SetLegalHold follows an append pattern and does not clear out the
733
+ # existing tags that are not specified in the request.
734
+ #
735
+ # @param resource_group_name [String] The name of the resource group within the
736
+ # user's subscription. The name is case insensitive.
737
+ # @param account_name [String] The name of the storage account within the
738
+ # specified resource group. Storage account names must be between 3 and 24
739
+ # characters in length and use numbers and lower-case letters only.
740
+ # @param container_name [String] The name of the blob container within the
741
+ # specified storage account. Blob container names must be between 3 and 63
742
+ # characters in length and use numbers, lower-case letters and dash (-) only.
743
+ # Every dash (-) character must be immediately preceded and followed by a
744
+ # letter or number.
745
+ # @param legal_hold [LegalHold] The LegalHold property that will be set to a
746
+ # blob container.
747
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
748
+ # will be added to the HTTP request.
749
+ #
750
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
751
+ #
752
+ def set_legal_hold_with_http_info(resource_group_name, account_name, container_name, legal_hold, custom_headers:nil)
753
+ set_legal_hold_async(resource_group_name, account_name, container_name, legal_hold, custom_headers:custom_headers).value!
754
+ end
755
+
756
+ #
757
+ # Sets legal hold tags. Setting the same tag results in an idempotent
758
+ # operation. SetLegalHold follows an append pattern and does not clear out the
759
+ # existing tags that are not specified in the request.
760
+ #
761
+ # @param resource_group_name [String] The name of the resource group within the
762
+ # user's subscription. The name is case insensitive.
763
+ # @param account_name [String] The name of the storage account within the
764
+ # specified resource group. Storage account names must be between 3 and 24
765
+ # characters in length and use numbers and lower-case letters only.
766
+ # @param container_name [String] The name of the blob container within the
767
+ # specified storage account. Blob container names must be between 3 and 63
768
+ # characters in length and use numbers, lower-case letters and dash (-) only.
769
+ # Every dash (-) character must be immediately preceded and followed by a
770
+ # letter or number.
771
+ # @param legal_hold [LegalHold] The LegalHold property that will be set to a
772
+ # blob container.
773
+ # @param [Hash{String => String}] A hash of custom headers that will be added
774
+ # to the HTTP request.
775
+ #
776
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
777
+ #
778
+ def set_legal_hold_async(resource_group_name, account_name, container_name, legal_hold, custom_headers:nil)
779
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
780
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
781
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
782
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
783
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
784
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
785
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
786
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
787
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
788
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
789
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
790
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
791
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
792
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
793
+ fail ArgumentError, 'legal_hold is nil' if legal_hold.nil?
794
+
795
+
796
+ request_headers = {}
797
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
798
+
799
+ # Set Headers
800
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
801
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
802
+
803
+ # Serialize Request
804
+ request_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::LegalHold.mapper()
805
+ request_content = @client.serialize(request_mapper, legal_hold)
806
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
807
+
808
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'
809
+
810
+ request_url = @base_url || @client.base_url
811
+
812
+ options = {
813
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
814
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
815
+ query_params: {'api-version' => @client.api_version},
816
+ body: request_content,
817
+ headers: request_headers.merge(custom_headers || {}),
818
+ base_url: request_url
819
+ }
820
+ promise = @client.make_request_async(:post, path_template, options)
821
+
822
+ promise = promise.then do |result|
823
+ http_response = result.response
824
+ status_code = http_response.status
825
+ response_content = http_response.body
826
+ unless status_code == 200
827
+ error_model = JSON.load(response_content)
828
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
829
+ end
830
+
831
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
832
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
833
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
834
+ # Deserialize Response
835
+ if status_code == 200
836
+ begin
837
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
838
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::LegalHold.mapper()
839
+ result.body = @client.deserialize(result_mapper, parsed_response)
840
+ rescue Exception => e
841
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
842
+ end
843
+ end
844
+
845
+ result
846
+ end
847
+
848
+ promise.execute
849
+ end
850
+
851
+ #
852
+ # Clears legal hold tags. Clearing the same or non-existent tag results in an
853
+ # idempotent operation. ClearLegalHold clears out only the specified tags in
854
+ # the request.
855
+ #
856
+ # @param resource_group_name [String] The name of the resource group within the
857
+ # user's subscription. The name is case insensitive.
858
+ # @param account_name [String] The name of the storage account within the
859
+ # specified resource group. Storage account names must be between 3 and 24
860
+ # characters in length and use numbers and lower-case letters only.
861
+ # @param container_name [String] The name of the blob container within the
862
+ # specified storage account. Blob container names must be between 3 and 63
863
+ # characters in length and use numbers, lower-case letters and dash (-) only.
864
+ # Every dash (-) character must be immediately preceded and followed by a
865
+ # letter or number.
866
+ # @param legal_hold [LegalHold] The LegalHold property that will be clear from
867
+ # a blob container.
868
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
869
+ # will be added to the HTTP request.
870
+ #
871
+ # @return [LegalHold] operation results.
872
+ #
873
+ def clear_legal_hold(resource_group_name, account_name, container_name, legal_hold, custom_headers:nil)
874
+ response = clear_legal_hold_async(resource_group_name, account_name, container_name, legal_hold, custom_headers:custom_headers).value!
875
+ response.body unless response.nil?
876
+ end
877
+
878
+ #
879
+ # Clears legal hold tags. Clearing the same or non-existent tag results in an
880
+ # idempotent operation. ClearLegalHold clears out only the specified tags in
881
+ # the request.
882
+ #
883
+ # @param resource_group_name [String] The name of the resource group within the
884
+ # user's subscription. The name is case insensitive.
885
+ # @param account_name [String] The name of the storage account within the
886
+ # specified resource group. Storage account names must be between 3 and 24
887
+ # characters in length and use numbers and lower-case letters only.
888
+ # @param container_name [String] The name of the blob container within the
889
+ # specified storage account. Blob container names must be between 3 and 63
890
+ # characters in length and use numbers, lower-case letters and dash (-) only.
891
+ # Every dash (-) character must be immediately preceded and followed by a
892
+ # letter or number.
893
+ # @param legal_hold [LegalHold] The LegalHold property that will be clear from
894
+ # a blob container.
895
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
896
+ # will be added to the HTTP request.
897
+ #
898
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
899
+ #
900
+ def clear_legal_hold_with_http_info(resource_group_name, account_name, container_name, legal_hold, custom_headers:nil)
901
+ clear_legal_hold_async(resource_group_name, account_name, container_name, legal_hold, custom_headers:custom_headers).value!
902
+ end
903
+
904
+ #
905
+ # Clears legal hold tags. Clearing the same or non-existent tag results in an
906
+ # idempotent operation. ClearLegalHold clears out only the specified tags in
907
+ # the request.
908
+ #
909
+ # @param resource_group_name [String] The name of the resource group within the
910
+ # user's subscription. The name is case insensitive.
911
+ # @param account_name [String] The name of the storage account within the
912
+ # specified resource group. Storage account names must be between 3 and 24
913
+ # characters in length and use numbers and lower-case letters only.
914
+ # @param container_name [String] The name of the blob container within the
915
+ # specified storage account. Blob container names must be between 3 and 63
916
+ # characters in length and use numbers, lower-case letters and dash (-) only.
917
+ # Every dash (-) character must be immediately preceded and followed by a
918
+ # letter or number.
919
+ # @param legal_hold [LegalHold] The LegalHold property that will be clear from
920
+ # a blob container.
921
+ # @param [Hash{String => String}] A hash of custom headers that will be added
922
+ # to the HTTP request.
923
+ #
924
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
925
+ #
926
+ def clear_legal_hold_async(resource_group_name, account_name, container_name, legal_hold, custom_headers:nil)
927
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
928
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
929
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
930
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
931
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
932
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
933
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
934
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
935
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
936
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
937
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
938
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
939
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
940
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
941
+ fail ArgumentError, 'legal_hold is nil' if legal_hold.nil?
942
+
943
+
944
+ request_headers = {}
945
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
946
+
947
+ # Set Headers
948
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
949
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
950
+
951
+ # Serialize Request
952
+ request_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::LegalHold.mapper()
953
+ request_content = @client.serialize(request_mapper, legal_hold)
954
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
955
+
956
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'
957
+
958
+ request_url = @base_url || @client.base_url
959
+
960
+ options = {
961
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
962
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
963
+ query_params: {'api-version' => @client.api_version},
964
+ body: request_content,
965
+ headers: request_headers.merge(custom_headers || {}),
966
+ base_url: request_url
967
+ }
968
+ promise = @client.make_request_async(:post, path_template, options)
969
+
970
+ promise = promise.then do |result|
971
+ http_response = result.response
972
+ status_code = http_response.status
973
+ response_content = http_response.body
974
+ unless status_code == 200
975
+ error_model = JSON.load(response_content)
976
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
977
+ end
978
+
979
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
980
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
981
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
982
+ # Deserialize Response
983
+ if status_code == 200
984
+ begin
985
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
986
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::LegalHold.mapper()
987
+ result.body = @client.deserialize(result_mapper, parsed_response)
988
+ rescue Exception => e
989
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
990
+ end
991
+ end
992
+
993
+ result
994
+ end
995
+
996
+ promise.execute
997
+ end
998
+
999
+ #
1000
+ # Creates or updates an unlocked immutability policy. ETag in If-Match is
1001
+ # honored if given but not required for this operation.
1002
+ #
1003
+ # @param resource_group_name [String] The name of the resource group within the
1004
+ # user's subscription. The name is case insensitive.
1005
+ # @param account_name [String] The name of the storage account within the
1006
+ # specified resource group. Storage account names must be between 3 and 24
1007
+ # characters in length and use numbers and lower-case letters only.
1008
+ # @param container_name [String] The name of the blob container within the
1009
+ # specified storage account. Blob container names must be between 3 and 63
1010
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1011
+ # Every dash (-) character must be immediately preceded and followed by a
1012
+ # letter or number.
1013
+ # @param parameters [ImmutabilityPolicy] The ImmutabilityPolicy Properties that
1014
+ # will be created or updated to a blob container.
1015
+ # @param if_match [String] The entity state (ETag) version of the immutability
1016
+ # policy to update. A value of "*" can be used to apply the operation only if
1017
+ # the immutability policy already exists. If omitted, this operation will
1018
+ # always be applied.
1019
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1020
+ # will be added to the HTTP request.
1021
+ #
1022
+ # @return [ImmutabilityPolicy] operation results.
1023
+ #
1024
+ def create_or_update_immutability_policy(resource_group_name, account_name, container_name, parameters:nil, if_match:nil, custom_headers:nil)
1025
+ response = create_or_update_immutability_policy_async(resource_group_name, account_name, container_name, parameters:parameters, if_match:if_match, custom_headers:custom_headers).value!
1026
+ response.body unless response.nil?
1027
+ end
1028
+
1029
+ #
1030
+ # Creates or updates an unlocked immutability policy. ETag in If-Match is
1031
+ # honored if given but not required for this operation.
1032
+ #
1033
+ # @param resource_group_name [String] The name of the resource group within the
1034
+ # user's subscription. The name is case insensitive.
1035
+ # @param account_name [String] The name of the storage account within the
1036
+ # specified resource group. Storage account names must be between 3 and 24
1037
+ # characters in length and use numbers and lower-case letters only.
1038
+ # @param container_name [String] The name of the blob container within the
1039
+ # specified storage account. Blob container names must be between 3 and 63
1040
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1041
+ # Every dash (-) character must be immediately preceded and followed by a
1042
+ # letter or number.
1043
+ # @param parameters [ImmutabilityPolicy] The ImmutabilityPolicy Properties that
1044
+ # will be created or updated to a blob container.
1045
+ # @param if_match [String] The entity state (ETag) version of the immutability
1046
+ # policy to update. A value of "*" can be used to apply the operation only if
1047
+ # the immutability policy already exists. If omitted, this operation will
1048
+ # always be applied.
1049
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1050
+ # will be added to the HTTP request.
1051
+ #
1052
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1053
+ #
1054
+ def create_or_update_immutability_policy_with_http_info(resource_group_name, account_name, container_name, parameters:nil, if_match:nil, custom_headers:nil)
1055
+ create_or_update_immutability_policy_async(resource_group_name, account_name, container_name, parameters:parameters, if_match:if_match, custom_headers:custom_headers).value!
1056
+ end
1057
+
1058
+ #
1059
+ # Creates or updates an unlocked immutability policy. ETag in If-Match is
1060
+ # honored if given but not required for this operation.
1061
+ #
1062
+ # @param resource_group_name [String] The name of the resource group within the
1063
+ # user's subscription. The name is case insensitive.
1064
+ # @param account_name [String] The name of the storage account within the
1065
+ # specified resource group. Storage account names must be between 3 and 24
1066
+ # characters in length and use numbers and lower-case letters only.
1067
+ # @param container_name [String] The name of the blob container within the
1068
+ # specified storage account. Blob container names must be between 3 and 63
1069
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1070
+ # Every dash (-) character must be immediately preceded and followed by a
1071
+ # letter or number.
1072
+ # @param parameters [ImmutabilityPolicy] The ImmutabilityPolicy Properties that
1073
+ # will be created or updated to a blob container.
1074
+ # @param if_match [String] The entity state (ETag) version of the immutability
1075
+ # policy to update. A value of "*" can be used to apply the operation only if
1076
+ # the immutability policy already exists. If omitted, this operation will
1077
+ # always be applied.
1078
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1079
+ # to the HTTP request.
1080
+ #
1081
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1082
+ #
1083
+ def create_or_update_immutability_policy_async(resource_group_name, account_name, container_name, parameters:nil, if_match:nil, custom_headers:nil)
1084
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1085
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1086
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1087
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1088
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1089
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1090
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1091
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
1092
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
1093
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
1094
+ immutability_policy_name = 'default'
1095
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1096
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1097
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1098
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1099
+
1100
+
1101
+ request_headers = {}
1102
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1103
+
1104
+ # Set Headers
1105
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1106
+ request_headers['If-Match'] = if_match unless if_match.nil?
1107
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1108
+
1109
+ # Serialize Request
1110
+ request_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ImmutabilityPolicy.mapper()
1111
+ request_content = @client.serialize(request_mapper, parameters)
1112
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1113
+
1114
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'
1115
+
1116
+ request_url = @base_url || @client.base_url
1117
+
1118
+ options = {
1119
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1120
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'containerName' => container_name,'immutabilityPolicyName' => immutability_policy_name,'subscriptionId' => @client.subscription_id},
1121
+ query_params: {'api-version' => @client.api_version},
1122
+ body: request_content,
1123
+ headers: request_headers.merge(custom_headers || {}),
1124
+ base_url: request_url
1125
+ }
1126
+ promise = @client.make_request_async(:put, path_template, options)
1127
+
1128
+ promise = promise.then do |result|
1129
+ http_response = result.response
1130
+ status_code = http_response.status
1131
+ response_content = http_response.body
1132
+ unless status_code == 200
1133
+ error_model = JSON.load(response_content)
1134
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1135
+ end
1136
+
1137
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1138
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1139
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1140
+ # Deserialize Response
1141
+ if status_code == 200
1142
+ begin
1143
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1144
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ImmutabilityPolicy.mapper()
1145
+ result.body = @client.deserialize(result_mapper, parsed_response)
1146
+ rescue Exception => e
1147
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1148
+ end
1149
+ end
1150
+
1151
+ result
1152
+ end
1153
+
1154
+ promise.execute
1155
+ end
1156
+
1157
+ #
1158
+ # Gets the existing immutability policy along with the corresponding ETag in
1159
+ # response headers and body.
1160
+ #
1161
+ # @param resource_group_name [String] The name of the resource group within the
1162
+ # user's subscription. The name is case insensitive.
1163
+ # @param account_name [String] The name of the storage account within the
1164
+ # specified resource group. Storage account names must be between 3 and 24
1165
+ # characters in length and use numbers and lower-case letters only.
1166
+ # @param container_name [String] The name of the blob container within the
1167
+ # specified storage account. Blob container names must be between 3 and 63
1168
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1169
+ # Every dash (-) character must be immediately preceded and followed by a
1170
+ # letter or number.
1171
+ # @param if_match [String] The entity state (ETag) version of the immutability
1172
+ # policy to update. A value of "*" can be used to apply the operation only if
1173
+ # the immutability policy already exists. If omitted, this operation will
1174
+ # always be applied.
1175
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1176
+ # will be added to the HTTP request.
1177
+ #
1178
+ # @return [ImmutabilityPolicy] operation results.
1179
+ #
1180
+ def get_immutability_policy(resource_group_name, account_name, container_name, if_match:nil, custom_headers:nil)
1181
+ response = get_immutability_policy_async(resource_group_name, account_name, container_name, if_match:if_match, custom_headers:custom_headers).value!
1182
+ response.body unless response.nil?
1183
+ end
1184
+
1185
+ #
1186
+ # Gets the existing immutability policy along with the corresponding ETag in
1187
+ # response headers and body.
1188
+ #
1189
+ # @param resource_group_name [String] The name of the resource group within the
1190
+ # user's subscription. The name is case insensitive.
1191
+ # @param account_name [String] The name of the storage account within the
1192
+ # specified resource group. Storage account names must be between 3 and 24
1193
+ # characters in length and use numbers and lower-case letters only.
1194
+ # @param container_name [String] The name of the blob container within the
1195
+ # specified storage account. Blob container names must be between 3 and 63
1196
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1197
+ # Every dash (-) character must be immediately preceded and followed by a
1198
+ # letter or number.
1199
+ # @param if_match [String] The entity state (ETag) version of the immutability
1200
+ # policy to update. A value of "*" can be used to apply the operation only if
1201
+ # the immutability policy already exists. If omitted, this operation will
1202
+ # always be applied.
1203
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1204
+ # will be added to the HTTP request.
1205
+ #
1206
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1207
+ #
1208
+ def get_immutability_policy_with_http_info(resource_group_name, account_name, container_name, if_match:nil, custom_headers:nil)
1209
+ get_immutability_policy_async(resource_group_name, account_name, container_name, if_match:if_match, custom_headers:custom_headers).value!
1210
+ end
1211
+
1212
+ #
1213
+ # Gets the existing immutability policy along with the corresponding ETag in
1214
+ # response headers and body.
1215
+ #
1216
+ # @param resource_group_name [String] The name of the resource group within the
1217
+ # user's subscription. The name is case insensitive.
1218
+ # @param account_name [String] The name of the storage account within the
1219
+ # specified resource group. Storage account names must be between 3 and 24
1220
+ # characters in length and use numbers and lower-case letters only.
1221
+ # @param container_name [String] The name of the blob container within the
1222
+ # specified storage account. Blob container names must be between 3 and 63
1223
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1224
+ # Every dash (-) character must be immediately preceded and followed by a
1225
+ # letter or number.
1226
+ # @param if_match [String] The entity state (ETag) version of the immutability
1227
+ # policy to update. A value of "*" can be used to apply the operation only if
1228
+ # the immutability policy already exists. If omitted, this operation will
1229
+ # always be applied.
1230
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1231
+ # to the HTTP request.
1232
+ #
1233
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1234
+ #
1235
+ def get_immutability_policy_async(resource_group_name, account_name, container_name, if_match:nil, custom_headers:nil)
1236
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1237
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1238
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1239
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1240
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1241
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1242
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1243
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
1244
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
1245
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
1246
+ immutability_policy_name = 'default'
1247
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1248
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1249
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1250
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1251
+
1252
+
1253
+ request_headers = {}
1254
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1255
+
1256
+ # Set Headers
1257
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1258
+ request_headers['If-Match'] = if_match unless if_match.nil?
1259
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1260
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'
1261
+
1262
+ request_url = @base_url || @client.base_url
1263
+
1264
+ options = {
1265
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1266
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'containerName' => container_name,'immutabilityPolicyName' => immutability_policy_name,'subscriptionId' => @client.subscription_id},
1267
+ query_params: {'api-version' => @client.api_version},
1268
+ headers: request_headers.merge(custom_headers || {}),
1269
+ base_url: request_url
1270
+ }
1271
+ promise = @client.make_request_async(:get, path_template, options)
1272
+
1273
+ promise = promise.then do |result|
1274
+ http_response = result.response
1275
+ status_code = http_response.status
1276
+ response_content = http_response.body
1277
+ unless status_code == 200
1278
+ error_model = JSON.load(response_content)
1279
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1280
+ end
1281
+
1282
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1283
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1284
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1285
+ # Deserialize Response
1286
+ if status_code == 200
1287
+ begin
1288
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1289
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ImmutabilityPolicy.mapper()
1290
+ result.body = @client.deserialize(result_mapper, parsed_response)
1291
+ rescue Exception => e
1292
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1293
+ end
1294
+ end
1295
+
1296
+ result
1297
+ end
1298
+
1299
+ promise.execute
1300
+ end
1301
+
1302
+ #
1303
+ # Aborts an unlocked immutability policy. The response of delete has
1304
+ # immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required
1305
+ # for this operation. Deleting a locked immutability policy is not allowed,
1306
+ # only way is to delete the container after deleting all blobs inside the
1307
+ # container.
1308
+ #
1309
+ # @param resource_group_name [String] The name of the resource group within the
1310
+ # user's subscription. The name is case insensitive.
1311
+ # @param account_name [String] The name of the storage account within the
1312
+ # specified resource group. Storage account names must be between 3 and 24
1313
+ # characters in length and use numbers and lower-case letters only.
1314
+ # @param container_name [String] The name of the blob container within the
1315
+ # specified storage account. Blob container names must be between 3 and 63
1316
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1317
+ # Every dash (-) character must be immediately preceded and followed by a
1318
+ # letter or number.
1319
+ # @param if_match [String] The entity state (ETag) version of the immutability
1320
+ # policy to update. A value of "*" can be used to apply the operation only if
1321
+ # the immutability policy already exists. If omitted, this operation will
1322
+ # always be applied.
1323
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1324
+ # will be added to the HTTP request.
1325
+ #
1326
+ # @return [ImmutabilityPolicy] operation results.
1327
+ #
1328
+ def delete_immutability_policy(resource_group_name, account_name, container_name, if_match, custom_headers:nil)
1329
+ response = delete_immutability_policy_async(resource_group_name, account_name, container_name, if_match, custom_headers:custom_headers).value!
1330
+ response.body unless response.nil?
1331
+ end
1332
+
1333
+ #
1334
+ # Aborts an unlocked immutability policy. The response of delete has
1335
+ # immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required
1336
+ # for this operation. Deleting a locked immutability policy is not allowed,
1337
+ # only way is to delete the container after deleting all blobs inside the
1338
+ # container.
1339
+ #
1340
+ # @param resource_group_name [String] The name of the resource group within the
1341
+ # user's subscription. The name is case insensitive.
1342
+ # @param account_name [String] The name of the storage account within the
1343
+ # specified resource group. Storage account names must be between 3 and 24
1344
+ # characters in length and use numbers and lower-case letters only.
1345
+ # @param container_name [String] The name of the blob container within the
1346
+ # specified storage account. Blob container names must be between 3 and 63
1347
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1348
+ # Every dash (-) character must be immediately preceded and followed by a
1349
+ # letter or number.
1350
+ # @param if_match [String] The entity state (ETag) version of the immutability
1351
+ # policy to update. A value of "*" can be used to apply the operation only if
1352
+ # the immutability policy already exists. If omitted, this operation will
1353
+ # always be applied.
1354
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1355
+ # will be added to the HTTP request.
1356
+ #
1357
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1358
+ #
1359
+ def delete_immutability_policy_with_http_info(resource_group_name, account_name, container_name, if_match, custom_headers:nil)
1360
+ delete_immutability_policy_async(resource_group_name, account_name, container_name, if_match, custom_headers:custom_headers).value!
1361
+ end
1362
+
1363
+ #
1364
+ # Aborts an unlocked immutability policy. The response of delete has
1365
+ # immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required
1366
+ # for this operation. Deleting a locked immutability policy is not allowed,
1367
+ # only way is to delete the container after deleting all blobs inside the
1368
+ # container.
1369
+ #
1370
+ # @param resource_group_name [String] The name of the resource group within the
1371
+ # user's subscription. The name is case insensitive.
1372
+ # @param account_name [String] The name of the storage account within the
1373
+ # specified resource group. Storage account names must be between 3 and 24
1374
+ # characters in length and use numbers and lower-case letters only.
1375
+ # @param container_name [String] The name of the blob container within the
1376
+ # specified storage account. Blob container names must be between 3 and 63
1377
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1378
+ # Every dash (-) character must be immediately preceded and followed by a
1379
+ # letter or number.
1380
+ # @param if_match [String] The entity state (ETag) version of the immutability
1381
+ # policy to update. A value of "*" can be used to apply the operation only if
1382
+ # the immutability policy already exists. If omitted, this operation will
1383
+ # always be applied.
1384
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1385
+ # to the HTTP request.
1386
+ #
1387
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1388
+ #
1389
+ def delete_immutability_policy_async(resource_group_name, account_name, container_name, if_match, custom_headers:nil)
1390
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1391
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1392
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1393
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1394
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1395
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1396
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1397
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
1398
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
1399
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
1400
+ immutability_policy_name = 'default'
1401
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1402
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1403
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1404
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1405
+ fail ArgumentError, 'if_match is nil' if if_match.nil?
1406
+
1407
+
1408
+ request_headers = {}
1409
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1410
+
1411
+ # Set Headers
1412
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1413
+ request_headers['If-Match'] = if_match unless if_match.nil?
1414
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1415
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'
1416
+
1417
+ request_url = @base_url || @client.base_url
1418
+
1419
+ options = {
1420
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1421
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'containerName' => container_name,'immutabilityPolicyName' => immutability_policy_name,'subscriptionId' => @client.subscription_id},
1422
+ query_params: {'api-version' => @client.api_version},
1423
+ headers: request_headers.merge(custom_headers || {}),
1424
+ base_url: request_url
1425
+ }
1426
+ promise = @client.make_request_async(:delete, path_template, options)
1427
+
1428
+ promise = promise.then do |result|
1429
+ http_response = result.response
1430
+ status_code = http_response.status
1431
+ response_content = http_response.body
1432
+ unless status_code == 200
1433
+ error_model = JSON.load(response_content)
1434
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1435
+ end
1436
+
1437
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1438
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1439
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1440
+ # Deserialize Response
1441
+ if status_code == 200
1442
+ begin
1443
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1444
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ImmutabilityPolicy.mapper()
1445
+ result.body = @client.deserialize(result_mapper, parsed_response)
1446
+ rescue Exception => e
1447
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1448
+ end
1449
+ end
1450
+
1451
+ result
1452
+ end
1453
+
1454
+ promise.execute
1455
+ end
1456
+
1457
+ #
1458
+ # Sets the ImmutabilityPolicy to Locked state. The only action allowed on a
1459
+ # Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is
1460
+ # required for this operation.
1461
+ #
1462
+ # @param resource_group_name [String] The name of the resource group within the
1463
+ # user's subscription. The name is case insensitive.
1464
+ # @param account_name [String] The name of the storage account within the
1465
+ # specified resource group. Storage account names must be between 3 and 24
1466
+ # characters in length and use numbers and lower-case letters only.
1467
+ # @param container_name [String] The name of the blob container within the
1468
+ # specified storage account. Blob container names must be between 3 and 63
1469
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1470
+ # Every dash (-) character must be immediately preceded and followed by a
1471
+ # letter or number.
1472
+ # @param if_match [String] The entity state (ETag) version of the immutability
1473
+ # policy to update. A value of "*" can be used to apply the operation only if
1474
+ # the immutability policy already exists. If omitted, this operation will
1475
+ # always be applied.
1476
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1477
+ # will be added to the HTTP request.
1478
+ #
1479
+ # @return [ImmutabilityPolicy] operation results.
1480
+ #
1481
+ def lock_immutability_policy(resource_group_name, account_name, container_name, if_match, custom_headers:nil)
1482
+ response = lock_immutability_policy_async(resource_group_name, account_name, container_name, if_match, custom_headers:custom_headers).value!
1483
+ response.body unless response.nil?
1484
+ end
1485
+
1486
+ #
1487
+ # Sets the ImmutabilityPolicy to Locked state. The only action allowed on a
1488
+ # Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is
1489
+ # required for this operation.
1490
+ #
1491
+ # @param resource_group_name [String] The name of the resource group within the
1492
+ # user's subscription. The name is case insensitive.
1493
+ # @param account_name [String] The name of the storage account within the
1494
+ # specified resource group. Storage account names must be between 3 and 24
1495
+ # characters in length and use numbers and lower-case letters only.
1496
+ # @param container_name [String] The name of the blob container within the
1497
+ # specified storage account. Blob container names must be between 3 and 63
1498
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1499
+ # Every dash (-) character must be immediately preceded and followed by a
1500
+ # letter or number.
1501
+ # @param if_match [String] The entity state (ETag) version of the immutability
1502
+ # policy to update. A value of "*" can be used to apply the operation only if
1503
+ # the immutability policy already exists. If omitted, this operation will
1504
+ # always be applied.
1505
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1506
+ # will be added to the HTTP request.
1507
+ #
1508
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1509
+ #
1510
+ def lock_immutability_policy_with_http_info(resource_group_name, account_name, container_name, if_match, custom_headers:nil)
1511
+ lock_immutability_policy_async(resource_group_name, account_name, container_name, if_match, custom_headers:custom_headers).value!
1512
+ end
1513
+
1514
+ #
1515
+ # Sets the ImmutabilityPolicy to Locked state. The only action allowed on a
1516
+ # Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is
1517
+ # required for this operation.
1518
+ #
1519
+ # @param resource_group_name [String] The name of the resource group within the
1520
+ # user's subscription. The name is case insensitive.
1521
+ # @param account_name [String] The name of the storage account within the
1522
+ # specified resource group. Storage account names must be between 3 and 24
1523
+ # characters in length and use numbers and lower-case letters only.
1524
+ # @param container_name [String] The name of the blob container within the
1525
+ # specified storage account. Blob container names must be between 3 and 63
1526
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1527
+ # Every dash (-) character must be immediately preceded and followed by a
1528
+ # letter or number.
1529
+ # @param if_match [String] The entity state (ETag) version of the immutability
1530
+ # policy to update. A value of "*" can be used to apply the operation only if
1531
+ # the immutability policy already exists. If omitted, this operation will
1532
+ # always be applied.
1533
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1534
+ # to the HTTP request.
1535
+ #
1536
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1537
+ #
1538
+ def lock_immutability_policy_async(resource_group_name, account_name, container_name, if_match, custom_headers:nil)
1539
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1540
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1541
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1542
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1543
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1544
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1545
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1546
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
1547
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
1548
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
1549
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1550
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1551
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1552
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1553
+ fail ArgumentError, 'if_match is nil' if if_match.nil?
1554
+
1555
+
1556
+ request_headers = {}
1557
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1558
+
1559
+ # Set Headers
1560
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1561
+ request_headers['If-Match'] = if_match unless if_match.nil?
1562
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1563
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'
1564
+
1565
+ request_url = @base_url || @client.base_url
1566
+
1567
+ options = {
1568
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1569
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
1570
+ query_params: {'api-version' => @client.api_version},
1571
+ headers: request_headers.merge(custom_headers || {}),
1572
+ base_url: request_url
1573
+ }
1574
+ promise = @client.make_request_async(:post, path_template, options)
1575
+
1576
+ promise = promise.then do |result|
1577
+ http_response = result.response
1578
+ status_code = http_response.status
1579
+ response_content = http_response.body
1580
+ unless status_code == 200
1581
+ error_model = JSON.load(response_content)
1582
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1583
+ end
1584
+
1585
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1586
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1587
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1588
+ # Deserialize Response
1589
+ if status_code == 200
1590
+ begin
1591
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1592
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ImmutabilityPolicy.mapper()
1593
+ result.body = @client.deserialize(result_mapper, parsed_response)
1594
+ rescue Exception => e
1595
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1596
+ end
1597
+ end
1598
+
1599
+ result
1600
+ end
1601
+
1602
+ promise.execute
1603
+ end
1604
+
1605
+ #
1606
+ # Extends the immutabilityPeriodSinceCreationInDays of a locked
1607
+ # immutabilityPolicy. The only action allowed on a Locked policy will be this
1608
+ # action. ETag in If-Match is required for this operation.
1609
+ #
1610
+ # @param resource_group_name [String] The name of the resource group within the
1611
+ # user's subscription. The name is case insensitive.
1612
+ # @param account_name [String] The name of the storage account within the
1613
+ # specified resource group. Storage account names must be between 3 and 24
1614
+ # characters in length and use numbers and lower-case letters only.
1615
+ # @param container_name [String] The name of the blob container within the
1616
+ # specified storage account. Blob container names must be between 3 and 63
1617
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1618
+ # Every dash (-) character must be immediately preceded and followed by a
1619
+ # letter or number.
1620
+ # @param if_match [String] The entity state (ETag) version of the immutability
1621
+ # policy to update. A value of "*" can be used to apply the operation only if
1622
+ # the immutability policy already exists. If omitted, this operation will
1623
+ # always be applied.
1624
+ # @param parameters [ImmutabilityPolicy] The ImmutabilityPolicy Properties that
1625
+ # will be extended for a blob container.
1626
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1627
+ # will be added to the HTTP request.
1628
+ #
1629
+ # @return [ImmutabilityPolicy] operation results.
1630
+ #
1631
+ def extend_immutability_policy(resource_group_name, account_name, container_name, if_match, parameters:nil, custom_headers:nil)
1632
+ response = extend_immutability_policy_async(resource_group_name, account_name, container_name, if_match, parameters:parameters, custom_headers:custom_headers).value!
1633
+ response.body unless response.nil?
1634
+ end
1635
+
1636
+ #
1637
+ # Extends the immutabilityPeriodSinceCreationInDays of a locked
1638
+ # immutabilityPolicy. The only action allowed on a Locked policy will be this
1639
+ # action. ETag in If-Match is required for this operation.
1640
+ #
1641
+ # @param resource_group_name [String] The name of the resource group within the
1642
+ # user's subscription. The name is case insensitive.
1643
+ # @param account_name [String] The name of the storage account within the
1644
+ # specified resource group. Storage account names must be between 3 and 24
1645
+ # characters in length and use numbers and lower-case letters only.
1646
+ # @param container_name [String] The name of the blob container within the
1647
+ # specified storage account. Blob container names must be between 3 and 63
1648
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1649
+ # Every dash (-) character must be immediately preceded and followed by a
1650
+ # letter or number.
1651
+ # @param if_match [String] The entity state (ETag) version of the immutability
1652
+ # policy to update. A value of "*" can be used to apply the operation only if
1653
+ # the immutability policy already exists. If omitted, this operation will
1654
+ # always be applied.
1655
+ # @param parameters [ImmutabilityPolicy] The ImmutabilityPolicy Properties that
1656
+ # will be extended for a blob container.
1657
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1658
+ # will be added to the HTTP request.
1659
+ #
1660
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1661
+ #
1662
+ def extend_immutability_policy_with_http_info(resource_group_name, account_name, container_name, if_match, parameters:nil, custom_headers:nil)
1663
+ extend_immutability_policy_async(resource_group_name, account_name, container_name, if_match, parameters:parameters, custom_headers:custom_headers).value!
1664
+ end
1665
+
1666
+ #
1667
+ # Extends the immutabilityPeriodSinceCreationInDays of a locked
1668
+ # immutabilityPolicy. The only action allowed on a Locked policy will be this
1669
+ # action. ETag in If-Match is required for this operation.
1670
+ #
1671
+ # @param resource_group_name [String] The name of the resource group within the
1672
+ # user's subscription. The name is case insensitive.
1673
+ # @param account_name [String] The name of the storage account within the
1674
+ # specified resource group. Storage account names must be between 3 and 24
1675
+ # characters in length and use numbers and lower-case letters only.
1676
+ # @param container_name [String] The name of the blob container within the
1677
+ # specified storage account. Blob container names must be between 3 and 63
1678
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1679
+ # Every dash (-) character must be immediately preceded and followed by a
1680
+ # letter or number.
1681
+ # @param if_match [String] The entity state (ETag) version of the immutability
1682
+ # policy to update. A value of "*" can be used to apply the operation only if
1683
+ # the immutability policy already exists. If omitted, this operation will
1684
+ # always be applied.
1685
+ # @param parameters [ImmutabilityPolicy] The ImmutabilityPolicy Properties that
1686
+ # will be extended for a blob container.
1687
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1688
+ # to the HTTP request.
1689
+ #
1690
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1691
+ #
1692
+ def extend_immutability_policy_async(resource_group_name, account_name, container_name, if_match, parameters:nil, custom_headers:nil)
1693
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1694
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1695
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1696
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1697
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1698
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1699
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1700
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
1701
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
1702
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
1703
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1704
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1705
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1706
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1707
+ fail ArgumentError, 'if_match is nil' if if_match.nil?
1708
+
1709
+
1710
+ request_headers = {}
1711
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1712
+
1713
+ # Set Headers
1714
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1715
+ request_headers['If-Match'] = if_match unless if_match.nil?
1716
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1717
+
1718
+ # Serialize Request
1719
+ request_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ImmutabilityPolicy.mapper()
1720
+ request_content = @client.serialize(request_mapper, parameters)
1721
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1722
+
1723
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'
1724
+
1725
+ request_url = @base_url || @client.base_url
1726
+
1727
+ options = {
1728
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1729
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
1730
+ query_params: {'api-version' => @client.api_version},
1731
+ body: request_content,
1732
+ headers: request_headers.merge(custom_headers || {}),
1733
+ base_url: request_url
1734
+ }
1735
+ promise = @client.make_request_async(:post, path_template, options)
1736
+
1737
+ promise = promise.then do |result|
1738
+ http_response = result.response
1739
+ status_code = http_response.status
1740
+ response_content = http_response.body
1741
+ unless status_code == 200
1742
+ error_model = JSON.load(response_content)
1743
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1744
+ end
1745
+
1746
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1747
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1748
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1749
+ # Deserialize Response
1750
+ if status_code == 200
1751
+ begin
1752
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1753
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ImmutabilityPolicy.mapper()
1754
+ result.body = @client.deserialize(result_mapper, parsed_response)
1755
+ rescue Exception => e
1756
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1757
+ end
1758
+ end
1759
+
1760
+ result
1761
+ end
1762
+
1763
+ promise.execute
1764
+ end
1765
+
1766
+ #
1767
+ # The Lease Container operation establishes and manages a lock on a container
1768
+ # for delete operations. The lock duration can be 15 to 60 seconds, or can be
1769
+ # infinite.
1770
+ #
1771
+ # @param resource_group_name [String] The name of the resource group within the
1772
+ # user's subscription. The name is case insensitive.
1773
+ # @param account_name [String] The name of the storage account within the
1774
+ # specified resource group. Storage account names must be between 3 and 24
1775
+ # characters in length and use numbers and lower-case letters only.
1776
+ # @param container_name [String] The name of the blob container within the
1777
+ # specified storage account. Blob container names must be between 3 and 63
1778
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1779
+ # Every dash (-) character must be immediately preceded and followed by a
1780
+ # letter or number.
1781
+ # @param parameters [LeaseContainerRequest] Lease Container request body.
1782
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1783
+ # will be added to the HTTP request.
1784
+ #
1785
+ # @return [LeaseContainerResponse] operation results.
1786
+ #
1787
+ def lease(resource_group_name, account_name, container_name, parameters:nil, custom_headers:nil)
1788
+ response = lease_async(resource_group_name, account_name, container_name, parameters:parameters, custom_headers:custom_headers).value!
1789
+ response.body unless response.nil?
1790
+ end
1791
+
1792
+ #
1793
+ # The Lease Container operation establishes and manages a lock on a container
1794
+ # for delete operations. The lock duration can be 15 to 60 seconds, or can be
1795
+ # infinite.
1796
+ #
1797
+ # @param resource_group_name [String] The name of the resource group within the
1798
+ # user's subscription. The name is case insensitive.
1799
+ # @param account_name [String] The name of the storage account within the
1800
+ # specified resource group. Storage account names must be between 3 and 24
1801
+ # characters in length and use numbers and lower-case letters only.
1802
+ # @param container_name [String] The name of the blob container within the
1803
+ # specified storage account. Blob container names must be between 3 and 63
1804
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1805
+ # Every dash (-) character must be immediately preceded and followed by a
1806
+ # letter or number.
1807
+ # @param parameters [LeaseContainerRequest] Lease Container request body.
1808
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1809
+ # will be added to the HTTP request.
1810
+ #
1811
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1812
+ #
1813
+ def lease_with_http_info(resource_group_name, account_name, container_name, parameters:nil, custom_headers:nil)
1814
+ lease_async(resource_group_name, account_name, container_name, parameters:parameters, custom_headers:custom_headers).value!
1815
+ end
1816
+
1817
+ #
1818
+ # The Lease Container operation establishes and manages a lock on a container
1819
+ # for delete operations. The lock duration can be 15 to 60 seconds, or can be
1820
+ # infinite.
1821
+ #
1822
+ # @param resource_group_name [String] The name of the resource group within the
1823
+ # user's subscription. The name is case insensitive.
1824
+ # @param account_name [String] The name of the storage account within the
1825
+ # specified resource group. Storage account names must be between 3 and 24
1826
+ # characters in length and use numbers and lower-case letters only.
1827
+ # @param container_name [String] The name of the blob container within the
1828
+ # specified storage account. Blob container names must be between 3 and 63
1829
+ # characters in length and use numbers, lower-case letters and dash (-) only.
1830
+ # Every dash (-) character must be immediately preceded and followed by a
1831
+ # letter or number.
1832
+ # @param parameters [LeaseContainerRequest] Lease Container request body.
1833
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1834
+ # to the HTTP request.
1835
+ #
1836
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1837
+ #
1838
+ def lease_async(resource_group_name, account_name, container_name, parameters:nil, custom_headers:nil)
1839
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1840
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1841
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1842
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1843
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
1844
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
1845
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
1846
+ fail ArgumentError, 'container_name is nil' if container_name.nil?
1847
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MaxLength': '63'" if !container_name.nil? && container_name.length > 63
1848
+ fail ArgumentError, "'container_name' should satisfy the constraint - 'MinLength': '3'" if !container_name.nil? && container_name.length < 3
1849
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1850
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
1851
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1852
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
1853
+
1854
+
1855
+ request_headers = {}
1856
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1857
+
1858
+ # Set Headers
1859
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1860
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1861
+
1862
+ # Serialize Request
1863
+ request_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::LeaseContainerRequest.mapper()
1864
+ request_content = @client.serialize(request_mapper, parameters)
1865
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1866
+
1867
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'
1868
+
1869
+ request_url = @base_url || @client.base_url
1870
+
1871
+ options = {
1872
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1873
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'containerName' => container_name,'subscriptionId' => @client.subscription_id},
1874
+ query_params: {'api-version' => @client.api_version},
1875
+ body: request_content,
1876
+ headers: request_headers.merge(custom_headers || {}),
1877
+ base_url: request_url
1878
+ }
1879
+ promise = @client.make_request_async(:post, path_template, options)
1880
+
1881
+ promise = promise.then do |result|
1882
+ http_response = result.response
1883
+ status_code = http_response.status
1884
+ response_content = http_response.body
1885
+ unless status_code == 200
1886
+ error_model = JSON.load(response_content)
1887
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1888
+ end
1889
+
1890
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1891
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1892
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1893
+ # Deserialize Response
1894
+ if status_code == 200
1895
+ begin
1896
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1897
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::LeaseContainerResponse.mapper()
1898
+ result.body = @client.deserialize(result_mapper, parsed_response)
1899
+ rescue Exception => e
1900
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1901
+ end
1902
+ end
1903
+
1904
+ result
1905
+ end
1906
+
1907
+ promise.execute
1908
+ end
1909
+
1910
+ #
1911
+ # Lists all containers and does not support a prefix like data plane. Also SRP
1912
+ # today does not return continuation token.
1913
+ #
1914
+ # @param next_page_link [String] The NextLink from the previous successful call
1915
+ # to List operation.
1916
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1917
+ # will be added to the HTTP request.
1918
+ #
1919
+ # @return [ListContainerItems] operation results.
1920
+ #
1921
+ def list_next(next_page_link, custom_headers:nil)
1922
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
1923
+ response.body unless response.nil?
1924
+ end
1925
+
1926
+ #
1927
+ # Lists all containers and does not support a prefix like data plane. Also SRP
1928
+ # today does not return continuation token.
1929
+ #
1930
+ # @param next_page_link [String] The NextLink from the previous successful call
1931
+ # to List operation.
1932
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1933
+ # will be added to the HTTP request.
1934
+ #
1935
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1936
+ #
1937
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
1938
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
1939
+ end
1940
+
1941
+ #
1942
+ # Lists all containers and does not support a prefix like data plane. Also SRP
1943
+ # today does not return continuation token.
1944
+ #
1945
+ # @param next_page_link [String] The NextLink from the previous successful call
1946
+ # to List operation.
1947
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1948
+ # to the HTTP request.
1949
+ #
1950
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1951
+ #
1952
+ def list_next_async(next_page_link, custom_headers:nil)
1953
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1954
+
1955
+
1956
+ request_headers = {}
1957
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1958
+
1959
+ # Set Headers
1960
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1961
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1962
+ path_template = '{nextLink}'
1963
+
1964
+ request_url = @base_url || @client.base_url
1965
+
1966
+ options = {
1967
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1968
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1969
+ headers: request_headers.merge(custom_headers || {}),
1970
+ base_url: request_url
1971
+ }
1972
+ promise = @client.make_request_async(:get, path_template, options)
1973
+
1974
+ promise = promise.then do |result|
1975
+ http_response = result.response
1976
+ status_code = http_response.status
1977
+ response_content = http_response.body
1978
+ unless status_code == 200
1979
+ error_model = JSON.load(response_content)
1980
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1981
+ end
1982
+
1983
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1984
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1985
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1986
+ # Deserialize Response
1987
+ if status_code == 200
1988
+ begin
1989
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1990
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ListContainerItems.mapper()
1991
+ result.body = @client.deserialize(result_mapper, parsed_response)
1992
+ rescue Exception => e
1993
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1994
+ end
1995
+ end
1996
+
1997
+ result
1998
+ end
1999
+
2000
+ promise.execute
2001
+ end
2002
+
2003
+ #
2004
+ # Lists all containers and does not support a prefix like data plane. Also SRP
2005
+ # today does not return continuation token.
2006
+ #
2007
+ # @param resource_group_name [String] The name of the resource group within the
2008
+ # user's subscription. The name is case insensitive.
2009
+ # @param account_name [String] The name of the storage account within the
2010
+ # specified resource group. Storage account names must be between 3 and 24
2011
+ # characters in length and use numbers and lower-case letters only.
2012
+ # @param maxpagesize [String] Optional. Specified maximum number of containers
2013
+ # that can be included in the list.
2014
+ # @param filter [String] Optional. When specified, only container names
2015
+ # starting with the filter will be listed.
2016
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2017
+ # will be added to the HTTP request.
2018
+ #
2019
+ # @return [ListContainerItems] which provide lazy access to pages of the
2020
+ # response.
2021
+ #
2022
+ def list_as_lazy(resource_group_name, account_name, maxpagesize:nil, filter:nil, custom_headers:nil)
2023
+ response = list_async(resource_group_name, account_name, maxpagesize:maxpagesize, filter:filter, custom_headers:custom_headers).value!
2024
+ unless response.nil?
2025
+ page = response.body
2026
+ page.next_method = Proc.new do |next_page_link|
2027
+ list_next_async(next_page_link, custom_headers:custom_headers)
2028
+ end
2029
+ page
2030
+ end
2031
+ end
2032
+
2033
+ end
2034
+ end