azure_mgmt_storage 0.18.1 → 0.18.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  3. data/lib/2015-06-15/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  4. data/lib/2016-01-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  5. data/lib/2016-12-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  6. data/lib/2017-06-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  7. data/lib/2017-10-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  8. data/lib/2018-02-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  9. data/lib/2018-03-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  10. data/lib/2018-07-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  11. data/lib/2018-11-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  12. data/lib/2019-04-01/generated/azure_mgmt_storage.rb +22 -20
  13. data/lib/2019-04-01/generated/azure_mgmt_storage/models/active_directory_properties.rb +103 -0
  14. data/lib/2019-04-01/generated/azure_mgmt_storage/models/azure_files_identity_based_authentication.rb +13 -1
  15. data/lib/2019-04-01/generated/azure_mgmt_storage/models/directory_service_options.rb +1 -0
  16. data/lib/2019-04-01/generated/azure_mgmt_storage/models/list_key_expand.rb +15 -0
  17. data/lib/2019-04-01/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +1 -1
  18. data/lib/2019-04-01/generated/azure_mgmt_storage/storage_accounts.rb +27 -15
  19. data/lib/2019-04-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  20. data/lib/2019-06-01/generated/azure_mgmt_storage.rb +152 -0
  21. data/lib/2019-06-01/generated/azure_mgmt_storage/blob_containers.rb +2034 -0
  22. data/lib/2019-06-01/generated/azure_mgmt_storage/blob_services.rb +383 -0
  23. data/lib/2019-06-01/generated/azure_mgmt_storage/file_services.rb +377 -0
  24. data/lib/2019-06-01/generated/azure_mgmt_storage/file_shares.rb +798 -0
  25. data/lib/2019-06-01/generated/azure_mgmt_storage/management_policies.rb +361 -0
  26. data/lib/2019-06-01/generated/azure_mgmt_storage/models/access_tier.rb +16 -0
  27. data/lib/2019-06-01/generated/azure_mgmt_storage/models/account_sas_parameters.rb +136 -0
  28. data/lib/2019-06-01/generated/azure_mgmt_storage/models/account_status.rb +16 -0
  29. data/lib/2019-06-01/generated/azure_mgmt_storage/models/action.rb +15 -0
  30. data/lib/2019-06-01/generated/azure_mgmt_storage/models/active_directory_properties.rb +103 -0
  31. data/lib/2019-06-01/generated/azure_mgmt_storage/models/azure_entity_resource.rb +75 -0
  32. data/lib/2019-06-01/generated/azure_mgmt_storage/models/azure_files_identity_based_authentication.rb +59 -0
  33. data/lib/2019-06-01/generated/azure_mgmt_storage/models/blob_container.rb +217 -0
  34. data/lib/2019-06-01/generated/azure_mgmt_storage/models/blob_service_items.rb +57 -0
  35. data/lib/2019-06-01/generated/azure_mgmt_storage/models/blob_service_properties.rb +141 -0
  36. data/lib/2019-06-01/generated/azure_mgmt_storage/models/bypass.rb +18 -0
  37. data/lib/2019-06-01/generated/azure_mgmt_storage/models/change_feed.rb +47 -0
  38. data/lib/2019-06-01/generated/azure_mgmt_storage/models/check_name_availability_result.rb +77 -0
  39. data/lib/2019-06-01/generated/azure_mgmt_storage/models/cors_rule.rb +128 -0
  40. data/lib/2019-06-01/generated/azure_mgmt_storage/models/cors_rules.rb +57 -0
  41. data/lib/2019-06-01/generated/azure_mgmt_storage/models/custom_domain.rb +60 -0
  42. data/lib/2019-06-01/generated/azure_mgmt_storage/models/date_after_creation.rb +50 -0
  43. data/lib/2019-06-01/generated/azure_mgmt_storage/models/date_after_modification.rb +51 -0
  44. data/lib/2019-06-01/generated/azure_mgmt_storage/models/default_action.rb +16 -0
  45. data/lib/2019-06-01/generated/azure_mgmt_storage/models/delete_retention_policy.rb +64 -0
  46. data/lib/2019-06-01/generated/azure_mgmt_storage/models/dimension.rb +57 -0
  47. data/lib/2019-06-01/generated/azure_mgmt_storage/models/directory_service_options.rb +17 -0
  48. data/lib/2019-06-01/generated/azure_mgmt_storage/models/encryption.rb +74 -0
  49. data/lib/2019-06-01/generated/azure_mgmt_storage/models/encryption_service.rb +62 -0
  50. data/lib/2019-06-01/generated/azure_mgmt_storage/models/encryption_services.rb +89 -0
  51. data/lib/2019-06-01/generated/azure_mgmt_storage/models/endpoints.rb +108 -0
  52. data/lib/2019-06-01/generated/azure_mgmt_storage/models/error_response.rb +59 -0
  53. data/lib/2019-06-01/generated/azure_mgmt_storage/models/file_service_items.rb +57 -0
  54. data/lib/2019-06-01/generated/azure_mgmt_storage/models/file_service_properties.rb +90 -0
  55. data/lib/2019-06-01/generated/azure_mgmt_storage/models/file_share.rb +121 -0
  56. data/lib/2019-06-01/generated/azure_mgmt_storage/models/file_share_item.rb +120 -0
  57. data/lib/2019-06-01/generated/azure_mgmt_storage/models/file_share_items.rb +103 -0
  58. data/lib/2019-06-01/generated/azure_mgmt_storage/models/geo_replication_stats.rb +85 -0
  59. data/lib/2019-06-01/generated/azure_mgmt_storage/models/geo_replication_status.rb +17 -0
  60. data/lib/2019-06-01/generated/azure_mgmt_storage/models/http_protocol.rb +16 -0
  61. data/lib/2019-06-01/generated/azure_mgmt_storage/models/identity.rb +72 -0
  62. data/lib/2019-06-01/generated/azure_mgmt_storage/models/immutability_policy.rb +98 -0
  63. data/lib/2019-06-01/generated/azure_mgmt_storage/models/immutability_policy_properties.rb +95 -0
  64. data/lib/2019-06-01/generated/azure_mgmt_storage/models/immutability_policy_state.rb +16 -0
  65. data/lib/2019-06-01/generated/azure_mgmt_storage/models/immutability_policy_update_type.rb +17 -0
  66. data/lib/2019-06-01/generated/azure_mgmt_storage/models/iprule.rb +61 -0
  67. data/lib/2019-06-01/generated/azure_mgmt_storage/models/key_permission.rb +16 -0
  68. data/lib/2019-06-01/generated/azure_mgmt_storage/models/key_source.rb +16 -0
  69. data/lib/2019-06-01/generated/azure_mgmt_storage/models/key_vault_properties.rb +68 -0
  70. data/lib/2019-06-01/generated/azure_mgmt_storage/models/kind.rb +19 -0
  71. data/lib/2019-06-01/generated/azure_mgmt_storage/models/large_file_shares_state.rb +16 -0
  72. data/lib/2019-06-01/generated/azure_mgmt_storage/models/lease_container_request.rb +97 -0
  73. data/lib/2019-06-01/generated/azure_mgmt_storage/models/lease_container_response.rb +60 -0
  74. data/lib/2019-06-01/generated/azure_mgmt_storage/models/lease_duration.rb +16 -0
  75. data/lib/2019-06-01/generated/azure_mgmt_storage/models/lease_state.rb +19 -0
  76. data/lib/2019-06-01/generated/azure_mgmt_storage/models/lease_status.rb +16 -0
  77. data/lib/2019-06-01/generated/azure_mgmt_storage/models/legal_hold.rb +71 -0
  78. data/lib/2019-06-01/generated/azure_mgmt_storage/models/legal_hold_properties.rb +72 -0
  79. data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_account_sas_response.rb +47 -0
  80. data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_container_item.rb +216 -0
  81. data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_container_items.rb +103 -0
  82. data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_key_expand.rb +15 -0
  83. data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_service_sas_response.rb +47 -0
  84. data/lib/2019-06-01/generated/azure_mgmt_storage/models/management_policy.rb +89 -0
  85. data/lib/2019-06-01/generated/azure_mgmt_storage/models/management_policy_action.rb +62 -0
  86. data/lib/2019-06-01/generated/azure_mgmt_storage/models/management_policy_base_blob.rb +73 -0
  87. data/lib/2019-06-01/generated/azure_mgmt_storage/models/management_policy_definition.rb +60 -0
  88. data/lib/2019-06-01/generated/azure_mgmt_storage/models/management_policy_filter.rb +76 -0
  89. data/lib/2019-06-01/generated/azure_mgmt_storage/models/management_policy_rule.rb +87 -0
  90. data/lib/2019-06-01/generated/azure_mgmt_storage/models/management_policy_schema.rb +58 -0
  91. data/lib/2019-06-01/generated/azure_mgmt_storage/models/management_policy_snap_shot.rb +47 -0
  92. data/lib/2019-06-01/generated/azure_mgmt_storage/models/metric_specification.rb +145 -0
  93. data/lib/2019-06-01/generated/azure_mgmt_storage/models/network_rule_set.rb +106 -0
  94. data/lib/2019-06-01/generated/azure_mgmt_storage/models/operation.rb +83 -0
  95. data/lib/2019-06-01/generated/azure_mgmt_storage/models/operation_display.rb +79 -0
  96. data/lib/2019-06-01/generated/azure_mgmt_storage/models/operation_list_result.rb +57 -0
  97. data/lib/2019-06-01/generated/azure_mgmt_storage/models/permissions.rb +22 -0
  98. data/lib/2019-06-01/generated/azure_mgmt_storage/models/private_endpoint.rb +47 -0
  99. data/lib/2019-06-01/generated/azure_mgmt_storage/models/private_endpoint_connection.rb +101 -0
  100. data/lib/2019-06-01/generated/azure_mgmt_storage/models/private_endpoint_connection_provisioning_state.rb +18 -0
  101. data/lib/2019-06-01/generated/azure_mgmt_storage/models/private_endpoint_service_connection_status.rb +17 -0
  102. data/lib/2019-06-01/generated/azure_mgmt_storage/models/private_link_resource.rb +115 -0
  103. data/lib/2019-06-01/generated/azure_mgmt_storage/models/private_link_resource_list_result.rb +55 -0
  104. data/lib/2019-06-01/generated/azure_mgmt_storage/models/private_link_service_connection_state.rb +72 -0
  105. data/lib/2019-06-01/generated/azure_mgmt_storage/models/provisioning_state.rb +17 -0
  106. data/lib/2019-06-01/generated/azure_mgmt_storage/models/proxy_resource.rb +63 -0
  107. data/lib/2019-06-01/generated/azure_mgmt_storage/models/public_access.rb +17 -0
  108. data/lib/2019-06-01/generated/azure_mgmt_storage/models/reason.rb +16 -0
  109. data/lib/2019-06-01/generated/azure_mgmt_storage/models/reason_code.rb +16 -0
  110. data/lib/2019-06-01/generated/azure_mgmt_storage/models/resource.rb +83 -0
  111. data/lib/2019-06-01/generated/azure_mgmt_storage/models/restriction.rb +85 -0
  112. data/lib/2019-06-01/generated/azure_mgmt_storage/models/service_sas_parameters.rb +247 -0
  113. data/lib/2019-06-01/generated/azure_mgmt_storage/models/service_specification.rb +56 -0
  114. data/lib/2019-06-01/generated/azure_mgmt_storage/models/services.rb +18 -0
  115. data/lib/2019-06-01/generated/azure_mgmt_storage/models/signed_resource.rb +18 -0
  116. data/lib/2019-06-01/generated/azure_mgmt_storage/models/signed_resource_types.rb +17 -0
  117. data/lib/2019-06-01/generated/azure_mgmt_storage/models/sku.rb +157 -0
  118. data/lib/2019-06-01/generated/azure_mgmt_storage/models/sku_name.rb +22 -0
  119. data/lib/2019-06-01/generated/azure_mgmt_storage/models/sku_tier.rb +16 -0
  120. data/lib/2019-06-01/generated/azure_mgmt_storage/models/skucapability.rb +63 -0
  121. data/lib/2019-06-01/generated/azure_mgmt_storage/models/state.rb +19 -0
  122. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account.rb +410 -0
  123. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account_check_name_availability_parameters.rb +63 -0
  124. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +215 -0
  125. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account_expand.rb +15 -0
  126. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account_key.rb +73 -0
  127. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account_list_keys_result.rb +57 -0
  128. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account_list_result.rb +103 -0
  129. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account_regenerate_key_parameters.rb +47 -0
  130. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +192 -0
  131. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_sku_list_result.rb +57 -0
  132. data/lib/2019-06-01/generated/azure_mgmt_storage/models/tag_property.rb +97 -0
  133. data/lib/2019-06-01/generated/azure_mgmt_storage/models/tracked_resource.rb +92 -0
  134. data/lib/2019-06-01/generated/azure_mgmt_storage/models/update_history_property.rb +114 -0
  135. data/lib/2019-06-01/generated/azure_mgmt_storage/models/usage.rb +89 -0
  136. data/lib/2019-06-01/generated/azure_mgmt_storage/models/usage_list_result.rb +56 -0
  137. data/lib/2019-06-01/generated/azure_mgmt_storage/models/usage_name.rb +59 -0
  138. data/lib/2019-06-01/generated/azure_mgmt_storage/models/usage_unit.rb +20 -0
  139. data/lib/2019-06-01/generated/azure_mgmt_storage/models/virtual_network_rule.rb +75 -0
  140. data/lib/2019-06-01/generated/azure_mgmt_storage/module_definition.rb +9 -0
  141. data/lib/2019-06-01/generated/azure_mgmt_storage/operations.rb +110 -0
  142. data/lib/2019-06-01/generated/azure_mgmt_storage/private_endpoint_connections.rb +388 -0
  143. data/lib/2019-06-01/generated/azure_mgmt_storage/private_link_resources.rb +138 -0
  144. data/lib/2019-06-01/generated/azure_mgmt_storage/skus.rb +116 -0
  145. data/lib/2019-06-01/generated/azure_mgmt_storage/storage_accounts.rb +1754 -0
  146. data/lib/2019-06-01/generated/azure_mgmt_storage/storage_management_client.rb +171 -0
  147. data/lib/2019-06-01/generated/azure_mgmt_storage/usages.rb +120 -0
  148. data/lib/azure_mgmt_storage.rb +1 -0
  149. data/lib/profiles/latest/modules/storage_profile_module.rb +305 -261
  150. data/lib/version.rb +1 -1
  151. metadata +132 -2
@@ -0,0 +1,388 @@
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 PrivateEndpointConnections
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the PrivateEndpointConnections 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
+ # Gets the specified private endpoint connection associated with the storage
26
+ # account.
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 private_endpoint_connection_name [String] The name of the private
34
+ # endpoint connection associated with the Storage Account
35
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
36
+ # will be added to the HTTP request.
37
+ #
38
+ # @return [PrivateEndpointConnection] operation results.
39
+ #
40
+ def get(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
41
+ response = get_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
42
+ response.body unless response.nil?
43
+ end
44
+
45
+ #
46
+ # Gets the specified private endpoint connection associated with the storage
47
+ # account.
48
+ #
49
+ # @param resource_group_name [String] The name of the resource group within the
50
+ # user's subscription. The name is case insensitive.
51
+ # @param account_name [String] The name of the storage account within the
52
+ # specified resource group. Storage account names must be between 3 and 24
53
+ # characters in length and use numbers and lower-case letters only.
54
+ # @param private_endpoint_connection_name [String] The name of the private
55
+ # endpoint connection associated with the Storage Account
56
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
57
+ # will be added to the HTTP request.
58
+ #
59
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
60
+ #
61
+ def get_with_http_info(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
62
+ get_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
63
+ end
64
+
65
+ #
66
+ # Gets the specified private endpoint connection associated with the storage
67
+ # account.
68
+ #
69
+ # @param resource_group_name [String] The name of the resource group within the
70
+ # user's subscription. The name is case insensitive.
71
+ # @param account_name [String] The name of the storage account within the
72
+ # specified resource group. Storage account names must be between 3 and 24
73
+ # characters in length and use numbers and lower-case letters only.
74
+ # @param private_endpoint_connection_name [String] The name of the private
75
+ # endpoint connection associated with the Storage Account
76
+ # @param [Hash{String => String}] A hash of custom headers that will be added
77
+ # to the HTTP request.
78
+ #
79
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
80
+ #
81
+ def get_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
82
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
83
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
84
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
85
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
86
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
87
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
88
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
89
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
90
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
91
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
92
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
93
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
94
+
95
+
96
+ request_headers = {}
97
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
98
+
99
+ # Set Headers
100
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
101
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
102
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'
103
+
104
+ request_url = @base_url || @client.base_url
105
+
106
+ options = {
107
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
108
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'privateEndpointConnectionName' => private_endpoint_connection_name},
109
+ query_params: {'api-version' => @client.api_version},
110
+ headers: request_headers.merge(custom_headers || {}),
111
+ base_url: request_url
112
+ }
113
+ promise = @client.make_request_async(:get, path_template, options)
114
+
115
+ promise = promise.then do |result|
116
+ http_response = result.response
117
+ status_code = http_response.status
118
+ response_content = http_response.body
119
+ unless status_code == 200
120
+ error_model = JSON.load(response_content)
121
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
122
+ end
123
+
124
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
125
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
126
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
127
+ # Deserialize Response
128
+ if status_code == 200
129
+ begin
130
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
131
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::PrivateEndpointConnection.mapper()
132
+ result.body = @client.deserialize(result_mapper, parsed_response)
133
+ rescue Exception => e
134
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
135
+ end
136
+ end
137
+
138
+ result
139
+ end
140
+
141
+ promise.execute
142
+ end
143
+
144
+ #
145
+ # Update the state of specified private endpoint connection associated with the
146
+ # storage account.
147
+ #
148
+ # @param resource_group_name [String] The name of the resource group within the
149
+ # user's subscription. The name is case insensitive.
150
+ # @param account_name [String] The name of the storage account within the
151
+ # specified resource group. Storage account names must be between 3 and 24
152
+ # characters in length and use numbers and lower-case letters only.
153
+ # @param private_endpoint_connection_name [String] The name of the private
154
+ # endpoint connection associated with the Storage Account
155
+ # @param properties [PrivateEndpointConnection] The private endpoint connection
156
+ # properties.
157
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
158
+ # will be added to the HTTP request.
159
+ #
160
+ # @return [PrivateEndpointConnection] operation results.
161
+ #
162
+ def put(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:nil)
163
+ response = put_async(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:custom_headers).value!
164
+ response.body unless response.nil?
165
+ end
166
+
167
+ #
168
+ # Update the state of specified private endpoint connection associated with the
169
+ # storage account.
170
+ #
171
+ # @param resource_group_name [String] The name of the resource group within the
172
+ # user's subscription. The name is case insensitive.
173
+ # @param account_name [String] The name of the storage account within the
174
+ # specified resource group. Storage account names must be between 3 and 24
175
+ # characters in length and use numbers and lower-case letters only.
176
+ # @param private_endpoint_connection_name [String] The name of the private
177
+ # endpoint connection associated with the Storage Account
178
+ # @param properties [PrivateEndpointConnection] The private endpoint connection
179
+ # properties.
180
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
181
+ # will be added to the HTTP request.
182
+ #
183
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
184
+ #
185
+ def put_with_http_info(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:nil)
186
+ put_async(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:custom_headers).value!
187
+ end
188
+
189
+ #
190
+ # Update the state of specified private endpoint connection associated with the
191
+ # storage account.
192
+ #
193
+ # @param resource_group_name [String] The name of the resource group within the
194
+ # user's subscription. The name is case insensitive.
195
+ # @param account_name [String] The name of the storage account within the
196
+ # specified resource group. Storage account names must be between 3 and 24
197
+ # characters in length and use numbers and lower-case letters only.
198
+ # @param private_endpoint_connection_name [String] The name of the private
199
+ # endpoint connection associated with the Storage Account
200
+ # @param properties [PrivateEndpointConnection] The private endpoint connection
201
+ # properties.
202
+ # @param [Hash{String => String}] A hash of custom headers that will be added
203
+ # to the HTTP request.
204
+ #
205
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
206
+ #
207
+ def put_async(resource_group_name, account_name, private_endpoint_connection_name, properties, custom_headers:nil)
208
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
209
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
210
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
211
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
212
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
213
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
214
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
215
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
216
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
217
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
218
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
219
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
220
+ fail ArgumentError, 'properties is nil' if properties.nil?
221
+
222
+
223
+ request_headers = {}
224
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
225
+
226
+ # Set Headers
227
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
228
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
229
+
230
+ # Serialize Request
231
+ request_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::PrivateEndpointConnection.mapper()
232
+ request_content = @client.serialize(request_mapper, properties)
233
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
234
+
235
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'
236
+
237
+ request_url = @base_url || @client.base_url
238
+
239
+ options = {
240
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
241
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'privateEndpointConnectionName' => private_endpoint_connection_name},
242
+ query_params: {'api-version' => @client.api_version},
243
+ body: request_content,
244
+ headers: request_headers.merge(custom_headers || {}),
245
+ base_url: request_url
246
+ }
247
+ promise = @client.make_request_async(:put, path_template, options)
248
+
249
+ promise = promise.then do |result|
250
+ http_response = result.response
251
+ status_code = http_response.status
252
+ response_content = http_response.body
253
+ unless status_code == 200
254
+ error_model = JSON.load(response_content)
255
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
256
+ end
257
+
258
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
259
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
260
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
261
+ # Deserialize Response
262
+ if status_code == 200
263
+ begin
264
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
265
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::PrivateEndpointConnection.mapper()
266
+ result.body = @client.deserialize(result_mapper, parsed_response)
267
+ rescue Exception => e
268
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
269
+ end
270
+ end
271
+
272
+ result
273
+ end
274
+
275
+ promise.execute
276
+ end
277
+
278
+ #
279
+ # Deletes the specified private endpoint connection associated with the storage
280
+ # account.
281
+ #
282
+ # @param resource_group_name [String] The name of the resource group within the
283
+ # user's subscription. The name is case insensitive.
284
+ # @param account_name [String] The name of the storage account within the
285
+ # specified resource group. Storage account names must be between 3 and 24
286
+ # characters in length and use numbers and lower-case letters only.
287
+ # @param private_endpoint_connection_name [String] The name of the private
288
+ # endpoint connection associated with the Storage Account
289
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
290
+ # will be added to the HTTP request.
291
+ #
292
+ #
293
+ def delete(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
294
+ response = delete_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
295
+ nil
296
+ end
297
+
298
+ #
299
+ # Deletes the specified private endpoint connection associated with the storage
300
+ # account.
301
+ #
302
+ # @param resource_group_name [String] The name of the resource group within the
303
+ # user's subscription. The name is case insensitive.
304
+ # @param account_name [String] The name of the storage account within the
305
+ # specified resource group. Storage account names must be between 3 and 24
306
+ # characters in length and use numbers and lower-case letters only.
307
+ # @param private_endpoint_connection_name [String] The name of the private
308
+ # endpoint connection associated with the Storage Account
309
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
310
+ # will be added to the HTTP request.
311
+ #
312
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
313
+ #
314
+ def delete_with_http_info(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
315
+ delete_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:custom_headers).value!
316
+ end
317
+
318
+ #
319
+ # Deletes the specified private endpoint connection associated with the storage
320
+ # account.
321
+ #
322
+ # @param resource_group_name [String] The name of the resource group within the
323
+ # user's subscription. The name is case insensitive.
324
+ # @param account_name [String] The name of the storage account within the
325
+ # specified resource group. Storage account names must be between 3 and 24
326
+ # characters in length and use numbers and lower-case letters only.
327
+ # @param private_endpoint_connection_name [String] The name of the private
328
+ # endpoint connection associated with the Storage Account
329
+ # @param [Hash{String => String}] A hash of custom headers that will be added
330
+ # to the HTTP request.
331
+ #
332
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
333
+ #
334
+ def delete_async(resource_group_name, account_name, private_endpoint_connection_name, custom_headers:nil)
335
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
336
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
337
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
338
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
339
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
340
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
341
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
342
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
343
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
344
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
345
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
346
+ fail ArgumentError, 'private_endpoint_connection_name is nil' if private_endpoint_connection_name.nil?
347
+
348
+
349
+ request_headers = {}
350
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
351
+
352
+ # Set Headers
353
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
354
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
355
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'
356
+
357
+ request_url = @base_url || @client.base_url
358
+
359
+ options = {
360
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
361
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'privateEndpointConnectionName' => private_endpoint_connection_name},
362
+ query_params: {'api-version' => @client.api_version},
363
+ headers: request_headers.merge(custom_headers || {}),
364
+ base_url: request_url
365
+ }
366
+ promise = @client.make_request_async(:delete, path_template, options)
367
+
368
+ promise = promise.then do |result|
369
+ http_response = result.response
370
+ status_code = http_response.status
371
+ response_content = http_response.body
372
+ unless status_code == 200 || status_code == 204
373
+ error_model = JSON.load(response_content)
374
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
375
+ end
376
+
377
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
378
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
379
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
380
+
381
+ result
382
+ end
383
+
384
+ promise.execute
385
+ end
386
+
387
+ end
388
+ end
@@ -0,0 +1,138 @@
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 PrivateLinkResources
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the PrivateLinkResources 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
+ # Gets the private link resources that need to be created for a storage
26
+ # account.
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 custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [PrivateLinkResourceListResult] operation results.
37
+ #
38
+ def list_by_storage_account(resource_group_name, account_name, custom_headers:nil)
39
+ response = list_by_storage_account_async(resource_group_name, account_name, custom_headers:custom_headers).value!
40
+ response.body unless response.nil?
41
+ end
42
+
43
+ #
44
+ # Gets the private link resources that need to be created for a storage
45
+ # account.
46
+ #
47
+ # @param resource_group_name [String] The name of the resource group within the
48
+ # user's subscription. The name is case insensitive.
49
+ # @param account_name [String] The name of the storage account within the
50
+ # specified resource group. Storage account names must be between 3 and 24
51
+ # characters in length and use numbers and lower-case letters only.
52
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
53
+ # will be added to the HTTP request.
54
+ #
55
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
56
+ #
57
+ def list_by_storage_account_with_http_info(resource_group_name, account_name, custom_headers:nil)
58
+ list_by_storage_account_async(resource_group_name, account_name, custom_headers:custom_headers).value!
59
+ end
60
+
61
+ #
62
+ # Gets the private link resources that need to be created for a storage
63
+ # account.
64
+ #
65
+ # @param resource_group_name [String] The name of the resource group within the
66
+ # user's subscription. The name is case insensitive.
67
+ # @param account_name [String] The name of the storage account within the
68
+ # specified resource group. Storage account names must be between 3 and 24
69
+ # characters in length and use numbers and lower-case letters only.
70
+ # @param [Hash{String => String}] A hash of custom headers that will be added
71
+ # to the HTTP request.
72
+ #
73
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
74
+ #
75
+ def list_by_storage_account_async(resource_group_name, account_name, custom_headers:nil)
76
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
77
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
78
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
79
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
80
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
81
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
82
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
83
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
84
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
85
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
86
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
87
+
88
+
89
+ request_headers = {}
90
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
91
+
92
+ # Set Headers
93
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
94
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
95
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources'
96
+
97
+ request_url = @base_url || @client.base_url
98
+
99
+ options = {
100
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
101
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
102
+ query_params: {'api-version' => @client.api_version},
103
+ headers: request_headers.merge(custom_headers || {}),
104
+ base_url: request_url
105
+ }
106
+ promise = @client.make_request_async(:get, path_template, options)
107
+
108
+ promise = promise.then do |result|
109
+ http_response = result.response
110
+ status_code = http_response.status
111
+ response_content = http_response.body
112
+ unless status_code == 200
113
+ error_model = JSON.load(response_content)
114
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
115
+ end
116
+
117
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
118
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
119
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
120
+ # Deserialize Response
121
+ if status_code == 200
122
+ begin
123
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
124
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::PrivateLinkResourceListResult.mapper()
125
+ result.body = @client.deserialize(result_mapper, parsed_response)
126
+ rescue Exception => e
127
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
128
+ end
129
+ end
130
+
131
+ result
132
+ end
133
+
134
+ promise.execute
135
+ end
136
+
137
+ end
138
+ end