azure_mgmt_security 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 (133) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-06-01-preview/generated/azure_mgmt_security/security_center.rb +1 -1
  3. data/lib/2017-08-01-preview/generated/azure_mgmt_security/security_center.rb +1 -1
  4. data/lib/2017-08-01/generated/azure_mgmt_security/security_center.rb +1 -1
  5. data/lib/2018-06-01/generated/azure_mgmt_security/security_center.rb +1 -1
  6. data/lib/2019-01-01-preview/generated/azure_mgmt_security/security_center.rb +1 -1
  7. data/lib/2019-01-01/generated/azure_mgmt_security/security_center.rb +1 -1
  8. data/lib/2019-08-01/generated/azure_mgmt_security/security_center.rb +1 -1
  9. data/lib/2020-01-01-preview/generated/azure_mgmt_security.rb +48 -0
  10. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/asc_location.rb +73 -0
  11. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/azure_resource_link.rb +47 -0
  12. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/control_type.rb +16 -0
  13. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/etag.rb +48 -0
  14. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/expand_controls_enum.rb +15 -0
  15. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/kind.rb +46 -0
  16. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/location.rb +47 -0
  17. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/resource.rb +80 -0
  18. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_item.rb +141 -0
  19. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_list.rb +101 -0
  20. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_definition_source.rb +47 -0
  21. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_details.rb +153 -0
  22. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_list.rb +101 -0
  23. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_control_score.rb +69 -0
  24. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_score_item.rb +104 -0
  25. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/secure_scores_list.rb +101 -0
  26. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/tags.rb +55 -0
  27. data/lib/2020-01-01-preview/generated/azure_mgmt_security/models/tracked_resource.rb +126 -0
  28. data/lib/2020-01-01-preview/generated/azure_mgmt_security/module_definition.rb +9 -0
  29. data/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_score_control_definitions.rb +423 -0
  30. data/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_score_controls.rb +444 -0
  31. data/lib/2020-01-01-preview/generated/azure_mgmt_security/secure_scores.rb +326 -0
  32. data/lib/2020-01-01-preview/generated/azure_mgmt_security/security_center.rb +139 -0
  33. data/lib/2020-01-01/generated/azure_mgmt_security.rb +121 -0
  34. data/lib/2020-01-01/generated/azure_mgmt_security/adaptive_application_controls.rb +394 -0
  35. data/lib/2020-01-01/generated/azure_mgmt_security/adaptive_network_hardenings.rb +539 -0
  36. data/lib/2020-01-01/generated/azure_mgmt_security/allowed_connections.rb +535 -0
  37. data/lib/2020-01-01/generated/azure_mgmt_security/assessments.rb +555 -0
  38. data/lib/2020-01-01/generated/azure_mgmt_security/assessments_metadata.rb +799 -0
  39. data/lib/2020-01-01/generated/azure_mgmt_security/discovered_security_solutions.rb +532 -0
  40. data/lib/2020-01-01/generated/azure_mgmt_security/external_security_solutions.rb +525 -0
  41. data/lib/2020-01-01/generated/azure_mgmt_security/jit_network_access_policies.rb +1295 -0
  42. data/lib/2020-01-01/generated/azure_mgmt_security/models/aad_connectivity_state.rb +17 -0
  43. data/lib/2020-01-01/generated/azure_mgmt_security/models/aad_connectivity_state1.rb +48 -0
  44. data/lib/2020-01-01/generated/azure_mgmt_security/models/aad_external_security_solution.rb +99 -0
  45. data/lib/2020-01-01/generated/azure_mgmt_security/models/aad_solution_properties.rb +83 -0
  46. data/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardening.rb +116 -0
  47. data/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardening_enforce_request.rb +77 -0
  48. data/lib/2020-01-01/generated/azure_mgmt_security/models/adaptive_network_hardenings_list.rb +99 -0
  49. data/lib/2020-01-01/generated/azure_mgmt_security/models/allowed_connections_list.rb +100 -0
  50. data/lib/2020-01-01/generated/azure_mgmt_security/models/allowed_connections_resource.rb +118 -0
  51. data/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_group.rb +207 -0
  52. data/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_groups.rb +56 -0
  53. data/lib/2020-01-01/generated/azure_mgmt_security/models/app_whitelisting_issue_summary.rb +61 -0
  54. data/lib/2020-01-01/generated/azure_mgmt_security/models/asc_location.rb +73 -0
  55. data/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_links.rb +47 -0
  56. data/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_status.rb +71 -0
  57. data/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_status_code.rb +17 -0
  58. data/lib/2020-01-01/generated/azure_mgmt_security/models/assessment_type.rb +18 -0
  59. data/lib/2020-01-01/generated/azure_mgmt_security/models/ata_external_security_solution.rb +98 -0
  60. data/lib/2020-01-01/generated/azure_mgmt_security/models/ata_solution_properties.rb +87 -0
  61. data/lib/2020-01-01/generated/azure_mgmt_security/models/azure_resource_details.rb +62 -0
  62. data/lib/2020-01-01/generated/azure_mgmt_security/models/category.rb +19 -0
  63. data/lib/2020-01-01/generated/azure_mgmt_security/models/cef_external_security_solution.rb +98 -0
  64. data/lib/2020-01-01/generated/azure_mgmt_security/models/cef_solution_properties.rb +109 -0
  65. data/lib/2020-01-01/generated/azure_mgmt_security/models/connectable_resource.rb +91 -0
  66. data/lib/2020-01-01/generated/azure_mgmt_security/models/connected_resource.rb +71 -0
  67. data/lib/2020-01-01/generated/azure_mgmt_security/models/connected_workspace.rb +47 -0
  68. data/lib/2020-01-01/generated/azure_mgmt_security/models/connection_type.rb +16 -0
  69. data/lib/2020-01-01/generated/azure_mgmt_security/models/direction.rb +16 -0
  70. data/lib/2020-01-01/generated/azure_mgmt_security/models/discovered_security_solution.rb +129 -0
  71. data/lib/2020-01-01/generated/azure_mgmt_security/models/discovered_security_solution_list.rb +99 -0
  72. data/lib/2020-01-01/generated/azure_mgmt_security/models/effective_network_security_groups.rb +66 -0
  73. data/lib/2020-01-01/generated/azure_mgmt_security/models/etag.rb +48 -0
  74. data/lib/2020-01-01/generated/azure_mgmt_security/models/expand_enum.rb +16 -0
  75. data/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution.rb +98 -0
  76. data/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_kind.rb +17 -0
  77. data/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_kind1.rb +47 -0
  78. data/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_list.rb +101 -0
  79. data/lib/2020-01-01/generated/azure_mgmt_security/models/external_security_solution_properties.rb +88 -0
  80. data/lib/2020-01-01/generated/azure_mgmt_security/models/implementation_effort.rb +17 -0
  81. data/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policies_list.rb +99 -0
  82. data/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy.rb +149 -0
  83. data/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_port.rb +70 -0
  84. data/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_request.rb +68 -0
  85. data/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_initiate_virtual_machine.rb +70 -0
  86. data/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_policy_virtual_machine.rb +81 -0
  87. data/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_port_rule.rb +103 -0
  88. data/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request.rb +89 -0
  89. data/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request_port.rb +128 -0
  90. data/lib/2020-01-01/generated/azure_mgmt_security/models/jit_network_access_request_virtual_machine.rb +69 -0
  91. data/lib/2020-01-01/generated/azure_mgmt_security/models/kind.rb +46 -0
  92. data/lib/2020-01-01/generated/azure_mgmt_security/models/location.rb +47 -0
  93. data/lib/2020-01-01/generated/azure_mgmt_security/models/on_premise_resource_details.rb +95 -0
  94. data/lib/2020-01-01/generated/azure_mgmt_security/models/path_recommendation.rb +156 -0
  95. data/lib/2020-01-01/generated/azure_mgmt_security/models/protection_mode.rb +80 -0
  96. data/lib/2020-01-01/generated/azure_mgmt_security/models/protocol.rb +17 -0
  97. data/lib/2020-01-01/generated/azure_mgmt_security/models/publisher_info.rb +84 -0
  98. data/lib/2020-01-01/generated/azure_mgmt_security/models/resource.rb +80 -0
  99. data/lib/2020-01-01/generated/azure_mgmt_security/models/resource_details.rb +47 -0
  100. data/lib/2020-01-01/generated/azure_mgmt_security/models/rule.rb +111 -0
  101. data/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment.rb +156 -0
  102. data/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_list.rb +101 -0
  103. data/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata.rb +221 -0
  104. data/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_list.rb +100 -0
  105. data/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_partner_data.rb +70 -0
  106. data/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_metadata_properties.rb +194 -0
  107. data/lib/2020-01-01/generated/azure_mgmt_security/models/security_assessment_partner_data.rb +57 -0
  108. data/lib/2020-01-01/generated/azure_mgmt_security/models/security_family.rb +18 -0
  109. data/lib/2020-01-01/generated/azure_mgmt_security/models/server_vulnerability_assessment.rb +76 -0
  110. data/lib/2020-01-01/generated/azure_mgmt_security/models/server_vulnerability_assessments_list.rb +55 -0
  111. data/lib/2020-01-01/generated/azure_mgmt_security/models/severity.rb +17 -0
  112. data/lib/2020-01-01/generated/azure_mgmt_security/models/status.rb +16 -0
  113. data/lib/2020-01-01/generated/azure_mgmt_security/models/status_reason.rb +17 -0
  114. data/lib/2020-01-01/generated/azure_mgmt_security/models/tags.rb +55 -0
  115. data/lib/2020-01-01/generated/azure_mgmt_security/models/threats.rb +22 -0
  116. data/lib/2020-01-01/generated/azure_mgmt_security/models/topology_list.rb +100 -0
  117. data/lib/2020-01-01/generated/azure_mgmt_security/models/topology_resource.rb +118 -0
  118. data/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource.rb +154 -0
  119. data/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource_child.rb +49 -0
  120. data/lib/2020-01-01/generated/azure_mgmt_security/models/topology_single_resource_parent.rb +49 -0
  121. data/lib/2020-01-01/generated/azure_mgmt_security/models/tracked_resource.rb +126 -0
  122. data/lib/2020-01-01/generated/azure_mgmt_security/models/transport_protocol.rb +16 -0
  123. data/lib/2020-01-01/generated/azure_mgmt_security/models/user_impact.rb +17 -0
  124. data/lib/2020-01-01/generated/azure_mgmt_security/models/user_recommendation.rb +58 -0
  125. data/lib/2020-01-01/generated/azure_mgmt_security/models/vm_recommendation.rb +81 -0
  126. data/lib/2020-01-01/generated/azure_mgmt_security/module_definition.rb +9 -0
  127. data/lib/2020-01-01/generated/azure_mgmt_security/security_center.rb +172 -0
  128. data/lib/2020-01-01/generated/azure_mgmt_security/server_vulnerability_assessment_operations.rb +462 -0
  129. data/lib/2020-01-01/generated/azure_mgmt_security/topology.rb +530 -0
  130. data/lib/azure_mgmt_security.rb +2 -0
  131. data/lib/profiles/latest/modules/security_profile_module.rb +366 -258
  132. data/lib/version.rb +1 -1
  133. metadata +123 -2
@@ -0,0 +1,535 @@
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::Security::Mgmt::V2020_01_01
7
+ #
8
+ # API spec for Microsoft.Security (Azure Security Center) resource provider
9
+ #
10
+ class AllowedConnections
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the AllowedConnections class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [SecurityCenter] reference to the SecurityCenter
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets the list of all possible traffic between resources for the subscription
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [Array<AllowedConnectionsResource>] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ first_page = list_as_lazy(custom_headers:custom_headers)
34
+ first_page.get_all_items
35
+ end
36
+
37
+ #
38
+ # Gets the list of all possible traffic between resources for the subscription
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Gets the list of all possible traffic between resources for the subscription
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers:nil)
58
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
59
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
60
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
61
+
62
+
63
+ request_headers = {}
64
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
65
+
66
+ # Set Headers
67
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
68
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
69
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections'
70
+
71
+ request_url = @base_url || @client.base_url
72
+
73
+ options = {
74
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
75
+ path_params: {'subscriptionId' => @client.subscription_id},
76
+ query_params: {'api-version' => @client.api_version},
77
+ headers: request_headers.merge(custom_headers || {}),
78
+ base_url: request_url
79
+ }
80
+ promise = @client.make_request_async(:get, path_template, options)
81
+
82
+ promise = promise.then do |result|
83
+ http_response = result.response
84
+ status_code = http_response.status
85
+ response_content = http_response.body
86
+ unless status_code == 200
87
+ error_model = JSON.load(response_content)
88
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
89
+ end
90
+
91
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
92
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
93
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
94
+ # Deserialize Response
95
+ if status_code == 200
96
+ begin
97
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
98
+ result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsList.mapper()
99
+ result.body = @client.deserialize(result_mapper, parsed_response)
100
+ rescue Exception => e
101
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
102
+ end
103
+ end
104
+
105
+ result
106
+ end
107
+
108
+ promise.execute
109
+ end
110
+
111
+ #
112
+ # Gets the list of all possible traffic between resources for the subscription
113
+ # and location.
114
+ #
115
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
116
+ # will be added to the HTTP request.
117
+ #
118
+ # @return [Array<AllowedConnectionsResource>] operation results.
119
+ #
120
+ def list_by_home_region(custom_headers:nil)
121
+ first_page = list_by_home_region_as_lazy(custom_headers:custom_headers)
122
+ first_page.get_all_items
123
+ end
124
+
125
+ #
126
+ # Gets the list of all possible traffic between resources for the subscription
127
+ # and location.
128
+ #
129
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
130
+ # will be added to the HTTP request.
131
+ #
132
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
133
+ #
134
+ def list_by_home_region_with_http_info(custom_headers:nil)
135
+ list_by_home_region_async(custom_headers:custom_headers).value!
136
+ end
137
+
138
+ #
139
+ # Gets the list of all possible traffic between resources for the subscription
140
+ # and location.
141
+ #
142
+ # @param [Hash{String => String}] A hash of custom headers that will be added
143
+ # to the HTTP request.
144
+ #
145
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
146
+ #
147
+ def list_by_home_region_async(custom_headers:nil)
148
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
149
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
150
+ fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil?
151
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
152
+
153
+
154
+ request_headers = {}
155
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
156
+
157
+ # Set Headers
158
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
159
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
160
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections'
161
+
162
+ request_url = @base_url || @client.base_url
163
+
164
+ options = {
165
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
166
+ path_params: {'subscriptionId' => @client.subscription_id,'ascLocation' => @client.asc_location},
167
+ query_params: {'api-version' => @client.api_version},
168
+ headers: request_headers.merge(custom_headers || {}),
169
+ base_url: request_url
170
+ }
171
+ promise = @client.make_request_async(:get, path_template, options)
172
+
173
+ promise = promise.then do |result|
174
+ http_response = result.response
175
+ status_code = http_response.status
176
+ response_content = http_response.body
177
+ unless status_code == 200
178
+ error_model = JSON.load(response_content)
179
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
180
+ end
181
+
182
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
183
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
184
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
185
+ # Deserialize Response
186
+ if status_code == 200
187
+ begin
188
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
189
+ result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsList.mapper()
190
+ result.body = @client.deserialize(result_mapper, parsed_response)
191
+ rescue Exception => e
192
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
193
+ end
194
+ end
195
+
196
+ result
197
+ end
198
+
199
+ promise.execute
200
+ end
201
+
202
+ #
203
+ # Gets the list of all possible traffic between resources for the subscription
204
+ # and location, based on connection type.
205
+ #
206
+ # @param resource_group_name [String] The name of the resource group within the
207
+ # user's subscription. The name is case insensitive.
208
+ # @param connection_type [ConnectionType] The type of allowed connections
209
+ # (Internal, External). Possible values include: 'Internal', 'External'
210
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
211
+ # will be added to the HTTP request.
212
+ #
213
+ # @return [AllowedConnectionsResource] operation results.
214
+ #
215
+ def get(resource_group_name, connection_type, custom_headers:nil)
216
+ response = get_async(resource_group_name, connection_type, custom_headers:custom_headers).value!
217
+ response.body unless response.nil?
218
+ end
219
+
220
+ #
221
+ # Gets the list of all possible traffic between resources for the subscription
222
+ # and location, based on connection type.
223
+ #
224
+ # @param resource_group_name [String] The name of the resource group within the
225
+ # user's subscription. The name is case insensitive.
226
+ # @param connection_type [ConnectionType] The type of allowed connections
227
+ # (Internal, External). Possible values include: 'Internal', 'External'
228
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
229
+ # will be added to the HTTP request.
230
+ #
231
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
232
+ #
233
+ def get_with_http_info(resource_group_name, connection_type, custom_headers:nil)
234
+ get_async(resource_group_name, connection_type, custom_headers:custom_headers).value!
235
+ end
236
+
237
+ #
238
+ # Gets the list of all possible traffic between resources for the subscription
239
+ # and location, based on connection type.
240
+ #
241
+ # @param resource_group_name [String] The name of the resource group within the
242
+ # user's subscription. The name is case insensitive.
243
+ # @param connection_type [ConnectionType] The type of allowed connections
244
+ # (Internal, External). Possible values include: 'Internal', 'External'
245
+ # @param [Hash{String => String}] A hash of custom headers that will be added
246
+ # to the HTTP request.
247
+ #
248
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
249
+ #
250
+ def get_async(resource_group_name, connection_type, custom_headers:nil)
251
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
252
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
253
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
254
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
255
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
256
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
257
+ fail ArgumentError, '@client.asc_location is nil' if @client.asc_location.nil?
258
+ fail ArgumentError, 'connection_type is nil' if connection_type.nil?
259
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
260
+
261
+
262
+ request_headers = {}
263
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
264
+
265
+ # Set Headers
266
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
267
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
268
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType}'
269
+
270
+ request_url = @base_url || @client.base_url
271
+
272
+ options = {
273
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
274
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'ascLocation' => @client.asc_location,'connectionType' => connection_type},
275
+ query_params: {'api-version' => @client.api_version},
276
+ headers: request_headers.merge(custom_headers || {}),
277
+ base_url: request_url
278
+ }
279
+ promise = @client.make_request_async(:get, path_template, options)
280
+
281
+ promise = promise.then do |result|
282
+ http_response = result.response
283
+ status_code = http_response.status
284
+ response_content = http_response.body
285
+ unless status_code == 200
286
+ error_model = JSON.load(response_content)
287
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
288
+ end
289
+
290
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
291
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
292
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
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::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsResource.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
+ # Gets the list of all possible traffic between resources for the subscription
312
+ #
313
+ # @param next_page_link [String] The NextLink from the previous successful call
314
+ # to List operation.
315
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
316
+ # will be added to the HTTP request.
317
+ #
318
+ # @return [AllowedConnectionsList] operation results.
319
+ #
320
+ def list_next(next_page_link, custom_headers:nil)
321
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
322
+ response.body unless response.nil?
323
+ end
324
+
325
+ #
326
+ # Gets the list of all possible traffic between resources for the subscription
327
+ #
328
+ # @param next_page_link [String] The NextLink from the previous successful call
329
+ # to List operation.
330
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
331
+ # will be added to the HTTP request.
332
+ #
333
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
334
+ #
335
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
336
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
337
+ end
338
+
339
+ #
340
+ # Gets the list of all possible traffic between resources for the subscription
341
+ #
342
+ # @param next_page_link [String] The NextLink from the previous successful call
343
+ # to List operation.
344
+ # @param [Hash{String => String}] A hash of custom headers that will be added
345
+ # to the HTTP request.
346
+ #
347
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
348
+ #
349
+ def list_next_async(next_page_link, custom_headers:nil)
350
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
351
+
352
+
353
+ request_headers = {}
354
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
355
+
356
+ # Set Headers
357
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
358
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
359
+ path_template = '{nextLink}'
360
+
361
+ request_url = @base_url || @client.base_url
362
+
363
+ options = {
364
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
365
+ skip_encoding_path_params: {'nextLink' => next_page_link},
366
+ headers: request_headers.merge(custom_headers || {}),
367
+ base_url: request_url
368
+ }
369
+ promise = @client.make_request_async(:get, path_template, options)
370
+
371
+ promise = promise.then do |result|
372
+ http_response = result.response
373
+ status_code = http_response.status
374
+ response_content = http_response.body
375
+ unless status_code == 200
376
+ error_model = JSON.load(response_content)
377
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
378
+ end
379
+
380
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
381
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
382
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
383
+ # Deserialize Response
384
+ if status_code == 200
385
+ begin
386
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
387
+ result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsList.mapper()
388
+ result.body = @client.deserialize(result_mapper, parsed_response)
389
+ rescue Exception => e
390
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
391
+ end
392
+ end
393
+
394
+ result
395
+ end
396
+
397
+ promise.execute
398
+ end
399
+
400
+ #
401
+ # Gets the list of all possible traffic between resources for the subscription
402
+ # and location.
403
+ #
404
+ # @param next_page_link [String] The NextLink from the previous successful call
405
+ # to List operation.
406
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
407
+ # will be added to the HTTP request.
408
+ #
409
+ # @return [AllowedConnectionsList] operation results.
410
+ #
411
+ def list_by_home_region_next(next_page_link, custom_headers:nil)
412
+ response = list_by_home_region_next_async(next_page_link, custom_headers:custom_headers).value!
413
+ response.body unless response.nil?
414
+ end
415
+
416
+ #
417
+ # Gets the list of all possible traffic between resources for the subscription
418
+ # and location.
419
+ #
420
+ # @param next_page_link [String] The NextLink from the previous successful call
421
+ # to List operation.
422
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
423
+ # will be added to the HTTP request.
424
+ #
425
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
426
+ #
427
+ def list_by_home_region_next_with_http_info(next_page_link, custom_headers:nil)
428
+ list_by_home_region_next_async(next_page_link, custom_headers:custom_headers).value!
429
+ end
430
+
431
+ #
432
+ # Gets the list of all possible traffic between resources for the subscription
433
+ # and location.
434
+ #
435
+ # @param next_page_link [String] The NextLink from the previous successful call
436
+ # to List operation.
437
+ # @param [Hash{String => String}] A hash of custom headers that will be added
438
+ # to the HTTP request.
439
+ #
440
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
441
+ #
442
+ def list_by_home_region_next_async(next_page_link, custom_headers:nil)
443
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
444
+
445
+
446
+ request_headers = {}
447
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
448
+
449
+ # Set Headers
450
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
451
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
452
+ path_template = '{nextLink}'
453
+
454
+ request_url = @base_url || @client.base_url
455
+
456
+ options = {
457
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
458
+ skip_encoding_path_params: {'nextLink' => next_page_link},
459
+ headers: request_headers.merge(custom_headers || {}),
460
+ base_url: request_url
461
+ }
462
+ promise = @client.make_request_async(:get, path_template, options)
463
+
464
+ promise = promise.then do |result|
465
+ http_response = result.response
466
+ status_code = http_response.status
467
+ response_content = http_response.body
468
+ unless status_code == 200
469
+ error_model = JSON.load(response_content)
470
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
471
+ end
472
+
473
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
474
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
475
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
476
+ # Deserialize Response
477
+ if status_code == 200
478
+ begin
479
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
480
+ result_mapper = Azure::Security::Mgmt::V2020_01_01::Models::AllowedConnectionsList.mapper()
481
+ result.body = @client.deserialize(result_mapper, parsed_response)
482
+ rescue Exception => e
483
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
484
+ end
485
+ end
486
+
487
+ result
488
+ end
489
+
490
+ promise.execute
491
+ end
492
+
493
+ #
494
+ # Gets the list of all possible traffic between resources for the subscription
495
+ #
496
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
497
+ # will be added to the HTTP request.
498
+ #
499
+ # @return [AllowedConnectionsList] which provide lazy access to pages of the
500
+ # response.
501
+ #
502
+ def list_as_lazy(custom_headers:nil)
503
+ response = list_async(custom_headers:custom_headers).value!
504
+ unless response.nil?
505
+ page = response.body
506
+ page.next_method = Proc.new do |next_page_link|
507
+ list_next_async(next_page_link, custom_headers:custom_headers)
508
+ end
509
+ page
510
+ end
511
+ end
512
+
513
+ #
514
+ # Gets the list of all possible traffic between resources for the subscription
515
+ # and location.
516
+ #
517
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
518
+ # will be added to the HTTP request.
519
+ #
520
+ # @return [AllowedConnectionsList] which provide lazy access to pages of the
521
+ # response.
522
+ #
523
+ def list_by_home_region_as_lazy(custom_headers:nil)
524
+ response = list_by_home_region_async(custom_headers:custom_headers).value!
525
+ unless response.nil?
526
+ page = response.body
527
+ page.next_method = Proc.new do |next_page_link|
528
+ list_by_home_region_next_async(next_page_link, custom_headers:custom_headers)
529
+ end
530
+ page
531
+ end
532
+ end
533
+
534
+ end
535
+ end