azure_mgmt_edgegateway 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-03-01/generated/azure_mgmt_edgegateway.rb +137 -0
  4. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/alerts.rb +322 -0
  5. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/bandwidth_schedules.rb +611 -0
  6. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/data_box_edge_management_client.rb +175 -0
  7. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/devices.rb +1879 -0
  8. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/jobs.rb +121 -0
  9. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/account_type.rb +16 -0
  10. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/address.rb +112 -0
  11. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/alert.rb +156 -0
  12. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/alert_error_details.rb +71 -0
  13. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/alert_list.rb +100 -0
  14. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/alert_severity.rb +17 -0
  15. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/armbase_model.rb +71 -0
  16. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/asymmetric_encrypted_secret.rb +70 -0
  17. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/authentication.rb +47 -0
  18. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/authentication_type.rb +16 -0
  19. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/azure_container_data_format.rb +17 -0
  20. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/azure_container_info.rb +72 -0
  21. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/bandwidth_schedule.rb +115 -0
  22. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/bandwidth_schedules_list.rb +100 -0
  23. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/client_access_right.rb +59 -0
  24. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/client_permission_type.rb +17 -0
  25. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/contact_details.rb +87 -0
  26. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/data_box_edge_device.rb +287 -0
  27. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/data_box_edge_device_extended_info.rb +108 -0
  28. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/data_box_edge_device_list.rb +101 -0
  29. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/data_box_edge_device_patch.rb +55 -0
  30. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/data_box_edge_device_status.rb +20 -0
  31. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/data_policy.rb +16 -0
  32. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/day_of_week.rb +21 -0
  33. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/device_type.rb +15 -0
  34. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/download_phase.rb +18 -0
  35. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/encryption_algorithm.rb +17 -0
  36. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/file_event_trigger.rb +115 -0
  37. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/file_source_info.rb +46 -0
  38. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/install_reboot_behavior.rb +17 -0
  39. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/io_tdevice_info.rb +69 -0
  40. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/io_trole.rb +147 -0
  41. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/ipv4config.rb +71 -0
  42. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/ipv6config.rb +71 -0
  43. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/job.rb +242 -0
  44. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/job_error_details.rb +80 -0
  45. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/job_error_item.rb +79 -0
  46. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/job_status.rb +21 -0
  47. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/job_type.rb +19 -0
  48. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/metric_aggregation_type.rb +21 -0
  49. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/metric_category.rb +16 -0
  50. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/metric_dimension_v1.rb +68 -0
  51. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/metric_specification_v1.rb +187 -0
  52. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/metric_unit.rb +22 -0
  53. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/monitoring_status.rb +16 -0
  54. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/mount_point_map.rb +83 -0
  55. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_adapter.rb +229 -0
  56. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_adapter_dhcpstatus.rb +16 -0
  57. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_adapter_position.rb +60 -0
  58. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_adapter_rdmastatus.rb +16 -0
  59. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_adapter_status.rb +16 -0
  60. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_group.rb +17 -0
  61. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/network_settings.rb +83 -0
  62. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/operation.rb +81 -0
  63. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/operation_display.rb +80 -0
  64. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/operations_list.rb +99 -0
  65. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/order.rb +177 -0
  66. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/order_list.rb +100 -0
  67. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/order_state.rb +28 -0
  68. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/order_status.rb +74 -0
  69. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/periodic_timer_event_trigger.rb +115 -0
  70. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/periodic_timer_source_info.rb +71 -0
  71. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/platform_type.rb +16 -0
  72. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/refresh_details.rb +87 -0
  73. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/role.rb +71 -0
  74. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/role_list.rb +102 -0
  75. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/role_sink_info.rb +46 -0
  76. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/role_status.rb +16 -0
  77. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/role_types.rb +18 -0
  78. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/security_settings.rb +78 -0
  79. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/service_specification.rb +56 -0
  80. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/share.rb +208 -0
  81. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/share_access_protocol.rb +16 -0
  82. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/share_access_right.rb +59 -0
  83. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/share_access_type.rb +17 -0
  84. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/share_list.rb +100 -0
  85. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/share_status.rb +16 -0
  86. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/sku.rb +58 -0
  87. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/sku_name.rb +16 -0
  88. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/sku_tier.rb +15 -0
  89. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/sslstatus.rb +16 -0
  90. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/storage_account_credential.rb +143 -0
  91. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/storage_account_credential_list.rb +100 -0
  92. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/symmetric_key.rb +48 -0
  93. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/time_grain.rb +22 -0
  94. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/tracking_info.rb +79 -0
  95. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/trigger.rb +71 -0
  96. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/trigger_list.rb +102 -0
  97. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/update_download_progress.rb +108 -0
  98. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/update_install_progress.rb +71 -0
  99. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/update_operation.rb +18 -0
  100. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/update_operation_stage.rb +31 -0
  101. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/update_summary.rb +281 -0
  102. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/upload_certificate_request.rb +58 -0
  103. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/upload_certificate_response.rb +113 -0
  104. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/user.rb +96 -0
  105. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/user_access_right.rb +59 -0
  106. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/models/user_list.rb +100 -0
  107. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/module_definition.rb +9 -0
  108. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/operations.rb +214 -0
  109. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/operations_status.rb +121 -0
  110. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/orders.rb +584 -0
  111. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/roles.rb +600 -0
  112. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/shares.rb +725 -0
  113. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/storage_account_credentials.rb +606 -0
  114. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/triggers.rb +600 -0
  115. data/lib/2019-03-01/generated/azure_mgmt_edgegateway/users.rb +604 -0
  116. data/lib/azure_mgmt_edgegateway.rb +6 -0
  117. data/lib/module_definition.rb +8 -0
  118. data/lib/profiles/latest/edgegateway_latest_profile_client.rb +40 -0
  119. data/lib/profiles/latest/edgegateway_module_definition.rb +8 -0
  120. data/lib/profiles/latest/modules/edgegateway_profile_module.rb +475 -0
  121. data/lib/version.rb +7 -0
  122. metadata +238 -0
@@ -0,0 +1,175 @@
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::EdgeGateway::Mgmt::V2019_03_01
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class DataBoxEdgeManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] The API version.
21
+ attr_reader :api_version
22
+
23
+ # @return [String] The subscription ID.
24
+ attr_accessor :subscription_id
25
+
26
+ # @return [String] The preferred language for the response.
27
+ attr_accessor :accept_language
28
+
29
+ # @return [Integer] The retry timeout in seconds for Long Running
30
+ # Operations. Default value is 30.
31
+ attr_accessor :long_running_operation_retry_timeout
32
+
33
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
34
+ # generated. When set to true a unique x-ms-client-request-id value is
35
+ # generated and included in each request. Default is true.
36
+ attr_accessor :generate_client_request_id
37
+
38
+ # @return [Operations] operations
39
+ attr_reader :operations
40
+
41
+ # @return [Devices] devices
42
+ attr_reader :devices
43
+
44
+ # @return [Alerts] alerts
45
+ attr_reader :alerts
46
+
47
+ # @return [BandwidthSchedules] bandwidth_schedules
48
+ attr_reader :bandwidth_schedules
49
+
50
+ # @return [Jobs] jobs
51
+ attr_reader :jobs
52
+
53
+ # @return [OperationsStatus] operations_status
54
+ attr_reader :operations_status
55
+
56
+ # @return [Orders] orders
57
+ attr_reader :orders
58
+
59
+ # @return [Roles] roles
60
+ attr_reader :roles
61
+
62
+ # @return [Shares] shares
63
+ attr_reader :shares
64
+
65
+ # @return [StorageAccountCredentials] storage_account_credentials
66
+ attr_reader :storage_account_credentials
67
+
68
+ # @return [Triggers] triggers
69
+ attr_reader :triggers
70
+
71
+ # @return [Users] users
72
+ attr_reader :users
73
+
74
+ #
75
+ # Creates initializes a new instance of the DataBoxEdgeManagementClient class.
76
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
77
+ # @param base_url [String] the base URI of the service.
78
+ # @param options [Array] filters to be applied to the HTTP requests.
79
+ #
80
+ def initialize(credentials = nil, base_url = nil, options = nil)
81
+ super(credentials, options)
82
+ @base_url = base_url || 'https://management.azure.com'
83
+
84
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
85
+ @credentials = credentials
86
+
87
+ @operations = Operations.new(self)
88
+ @devices = Devices.new(self)
89
+ @alerts = Alerts.new(self)
90
+ @bandwidth_schedules = BandwidthSchedules.new(self)
91
+ @jobs = Jobs.new(self)
92
+ @operations_status = OperationsStatus.new(self)
93
+ @orders = Orders.new(self)
94
+ @roles = Roles.new(self)
95
+ @shares = Shares.new(self)
96
+ @storage_account_credentials = StorageAccountCredentials.new(self)
97
+ @triggers = Triggers.new(self)
98
+ @users = Users.new(self)
99
+ @api_version = '2019-03-01'
100
+ @accept_language = 'en-US'
101
+ @long_running_operation_retry_timeout = 30
102
+ @generate_client_request_id = true
103
+ add_telemetry
104
+ end
105
+
106
+ #
107
+ # Makes a request and returns the body of the response.
108
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
109
+ # @param path [String] the path, relative to {base_url}.
110
+ # @param options [Hash{String=>String}] specifying any request options like :body.
111
+ # @return [Hash{String=>String}] containing the body of the response.
112
+ # Example:
113
+ #
114
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
115
+ # path = "/path"
116
+ # options = {
117
+ # body: request_content,
118
+ # query_params: {'api-version' => '2016-02-01'}
119
+ # }
120
+ # result = @client.make_request(:put, path, options)
121
+ #
122
+ def make_request(method, path, options = {})
123
+ result = make_request_with_http_info(method, path, options)
124
+ result.body unless result.nil?
125
+ end
126
+
127
+ #
128
+ # Makes a request and returns the operation response.
129
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
130
+ # @param path [String] the path, relative to {base_url}.
131
+ # @param options [Hash{String=>String}] specifying any request options like :body.
132
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
133
+ #
134
+ def make_request_with_http_info(method, path, options = {})
135
+ result = make_request_async(method, path, options).value!
136
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
137
+ result
138
+ end
139
+
140
+ #
141
+ # Makes a request asynchronously.
142
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
143
+ # @param path [String] the path, relative to {base_url}.
144
+ # @param options [Hash{String=>String}] specifying any request options like :body.
145
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
146
+ #
147
+ def make_request_async(method, path, options = {})
148
+ fail ArgumentError, 'method is nil' if method.nil?
149
+ fail ArgumentError, 'path is nil' if path.nil?
150
+
151
+ request_url = options[:base_url] || @base_url
152
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
153
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
154
+ end
155
+
156
+ request_headers = @request_headers
157
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
158
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
159
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
160
+
161
+ super(request_url, method, path, options)
162
+ end
163
+
164
+
165
+ private
166
+ #
167
+ # Adds telemetry information.
168
+ #
169
+ def add_telemetry
170
+ sdk_information = 'azure_mgmt_edgegateway'
171
+ sdk_information = "#{sdk_information}/0.17.0"
172
+ add_user_agent_information(sdk_information)
173
+ end
174
+ end
175
+ end
@@ -0,0 +1,1879 @@
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::EdgeGateway::Mgmt::V2019_03_01
7
+ #
8
+ # Devices
9
+ #
10
+ class Devices
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Devices class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [DataBoxEdgeManagementClient] reference to the DataBoxEdgeManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets all the data box edge/gateway devices in a subscription.
26
+ #
27
+ # @param expand [String] Specify $expand=details to populate additional fields
28
+ # related to the resource or Specify $skipToken=<token> to populate the next
29
+ # page in the list.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Array<DataBoxEdgeDevice>] operation results.
34
+ #
35
+ def list_by_subscription(expand:nil, custom_headers:nil)
36
+ first_page = list_by_subscription_as_lazy(expand:expand, custom_headers:custom_headers)
37
+ first_page.get_all_items
38
+ end
39
+
40
+ #
41
+ # Gets all the data box edge/gateway devices in a subscription.
42
+ #
43
+ # @param expand [String] Specify $expand=details to populate additional fields
44
+ # related to the resource or Specify $skipToken=<token> to populate the next
45
+ # page in the list.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_by_subscription_with_http_info(expand:nil, custom_headers:nil)
52
+ list_by_subscription_async(expand:expand, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Gets all the data box edge/gateway devices in a subscription.
57
+ #
58
+ # @param expand [String] Specify $expand=details to populate additional fields
59
+ # related to the resource or Specify $skipToken=<token> to populate the next
60
+ # page in the list.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_by_subscription_async(expand:nil, custom_headers:nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
69
+
70
+
71
+ request_headers = {}
72
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
73
+
74
+ # Set Headers
75
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
76
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
77
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices'
78
+
79
+ request_url = @base_url || @client.base_url
80
+
81
+ options = {
82
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
83
+ path_params: {'subscriptionId' => @client.subscription_id},
84
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
85
+ headers: request_headers.merge(custom_headers || {}),
86
+ base_url: request_url
87
+ }
88
+ promise = @client.make_request_async(:get, path_template, options)
89
+
90
+ promise = promise.then do |result|
91
+ http_response = result.response
92
+ status_code = http_response.status
93
+ response_content = http_response.body
94
+ unless status_code == 200
95
+ error_model = JSON.load(response_content)
96
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
97
+ end
98
+
99
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
100
+ # Deserialize Response
101
+ if status_code == 200
102
+ begin
103
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
104
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::DataBoxEdgeDeviceList.mapper()
105
+ result.body = @client.deserialize(result_mapper, parsed_response)
106
+ rescue Exception => e
107
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
108
+ end
109
+ end
110
+
111
+ result
112
+ end
113
+
114
+ promise.execute
115
+ end
116
+
117
+ #
118
+ # Gets all the data box edge/gateway devices in a resource group.
119
+ #
120
+ # @param resource_group_name [String] The resource group name.
121
+ # @param expand [String] Specify $expand=details to populate additional fields
122
+ # related to the resource or Specify $skipToken=<token> to populate the next
123
+ # page in the list.
124
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
125
+ # will be added to the HTTP request.
126
+ #
127
+ # @return [Array<DataBoxEdgeDevice>] operation results.
128
+ #
129
+ def list_by_resource_group(resource_group_name, expand:nil, custom_headers:nil)
130
+ first_page = list_by_resource_group_as_lazy(resource_group_name, expand:expand, custom_headers:custom_headers)
131
+ first_page.get_all_items
132
+ end
133
+
134
+ #
135
+ # Gets all the data box edge/gateway devices in a resource group.
136
+ #
137
+ # @param resource_group_name [String] The resource group name.
138
+ # @param expand [String] Specify $expand=details to populate additional fields
139
+ # related to the resource or Specify $skipToken=<token> to populate the next
140
+ # page in the list.
141
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
142
+ # will be added to the HTTP request.
143
+ #
144
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
145
+ #
146
+ def list_by_resource_group_with_http_info(resource_group_name, expand:nil, custom_headers:nil)
147
+ list_by_resource_group_async(resource_group_name, expand:expand, custom_headers:custom_headers).value!
148
+ end
149
+
150
+ #
151
+ # Gets all the data box edge/gateway devices in a resource group.
152
+ #
153
+ # @param resource_group_name [String] The resource group name.
154
+ # @param expand [String] Specify $expand=details to populate additional fields
155
+ # related to the resource or Specify $skipToken=<token> to populate the next
156
+ # page in the list.
157
+ # @param [Hash{String => String}] A hash of custom headers that will be added
158
+ # to the HTTP request.
159
+ #
160
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
161
+ #
162
+ def list_by_resource_group_async(resource_group_name, expand:nil, custom_headers:nil)
163
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
164
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
165
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
166
+
167
+
168
+ request_headers = {}
169
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
170
+
171
+ # Set Headers
172
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
173
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
174
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices'
175
+
176
+ request_url = @base_url || @client.base_url
177
+
178
+ options = {
179
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
180
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
181
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
182
+ headers: request_headers.merge(custom_headers || {}),
183
+ base_url: request_url
184
+ }
185
+ promise = @client.make_request_async(:get, path_template, options)
186
+
187
+ promise = promise.then do |result|
188
+ http_response = result.response
189
+ status_code = http_response.status
190
+ response_content = http_response.body
191
+ unless status_code == 200
192
+ error_model = JSON.load(response_content)
193
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
194
+ end
195
+
196
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
197
+ # Deserialize Response
198
+ if status_code == 200
199
+ begin
200
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
201
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::DataBoxEdgeDeviceList.mapper()
202
+ result.body = @client.deserialize(result_mapper, parsed_response)
203
+ rescue Exception => e
204
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
205
+ end
206
+ end
207
+
208
+ result
209
+ end
210
+
211
+ promise.execute
212
+ end
213
+
214
+ #
215
+ # Gets the properties of the data box edge/gateway device.
216
+ #
217
+ # @param device_name [String] The device name.
218
+ # @param resource_group_name [String] The resource group name.
219
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
220
+ # will be added to the HTTP request.
221
+ #
222
+ # @return [DataBoxEdgeDevice] operation results.
223
+ #
224
+ def get(device_name, resource_group_name, custom_headers:nil)
225
+ response = get_async(device_name, resource_group_name, custom_headers:custom_headers).value!
226
+ response.body unless response.nil?
227
+ end
228
+
229
+ #
230
+ # Gets the properties of the data box edge/gateway device.
231
+ #
232
+ # @param device_name [String] The device name.
233
+ # @param resource_group_name [String] The resource group name.
234
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
235
+ # will be added to the HTTP request.
236
+ #
237
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
238
+ #
239
+ def get_with_http_info(device_name, resource_group_name, custom_headers:nil)
240
+ get_async(device_name, resource_group_name, custom_headers:custom_headers).value!
241
+ end
242
+
243
+ #
244
+ # Gets the properties of the data box edge/gateway device.
245
+ #
246
+ # @param device_name [String] The device name.
247
+ # @param resource_group_name [String] The resource group name.
248
+ # @param [Hash{String => String}] A hash of custom headers that will be added
249
+ # to the HTTP request.
250
+ #
251
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
252
+ #
253
+ def get_async(device_name, resource_group_name, custom_headers:nil)
254
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
255
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
256
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
257
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
258
+
259
+
260
+ request_headers = {}
261
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
262
+
263
+ # Set Headers
264
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
265
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
266
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'
267
+
268
+ request_url = @base_url || @client.base_url
269
+
270
+ options = {
271
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
272
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
273
+ query_params: {'api-version' => @client.api_version},
274
+ headers: request_headers.merge(custom_headers || {}),
275
+ base_url: request_url
276
+ }
277
+ promise = @client.make_request_async(:get, path_template, options)
278
+
279
+ promise = promise.then do |result|
280
+ http_response = result.response
281
+ status_code = http_response.status
282
+ response_content = http_response.body
283
+ unless status_code == 200
284
+ error_model = JSON.load(response_content)
285
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
286
+ end
287
+
288
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
289
+ # Deserialize Response
290
+ if status_code == 200
291
+ begin
292
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
293
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::DataBoxEdgeDevice.mapper()
294
+ result.body = @client.deserialize(result_mapper, parsed_response)
295
+ rescue Exception => e
296
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
297
+ end
298
+ end
299
+
300
+ result
301
+ end
302
+
303
+ promise.execute
304
+ end
305
+
306
+ #
307
+ # Creates or updates a Data Box Edge/Gateway resource.
308
+ #
309
+ # @param device_name [String] The device name.
310
+ # @param data_box_edge_device [DataBoxEdgeDevice] The resource object.
311
+ # @param resource_group_name [String] The resource group name.
312
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
313
+ # will be added to the HTTP request.
314
+ #
315
+ # @return [DataBoxEdgeDevice] operation results.
316
+ #
317
+ def create_or_update(device_name, data_box_edge_device, resource_group_name, custom_headers:nil)
318
+ response = create_or_update_async(device_name, data_box_edge_device, resource_group_name, custom_headers:custom_headers).value!
319
+ response.body unless response.nil?
320
+ end
321
+
322
+ #
323
+ # @param device_name [String] The device name.
324
+ # @param data_box_edge_device [DataBoxEdgeDevice] The resource object.
325
+ # @param resource_group_name [String] The resource group name.
326
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
327
+ # will be added to the HTTP request.
328
+ #
329
+ # @return [Concurrent::Promise] promise which provides async access to http
330
+ # response.
331
+ #
332
+ def create_or_update_async(device_name, data_box_edge_device, resource_group_name, custom_headers:nil)
333
+ # Send request
334
+ promise = begin_create_or_update_async(device_name, data_box_edge_device, resource_group_name, custom_headers:custom_headers)
335
+
336
+ promise = promise.then do |response|
337
+ # Defining deserialization method.
338
+ deserialize_method = lambda do |parsed_response|
339
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::DataBoxEdgeDevice.mapper()
340
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
341
+ end
342
+
343
+ # Waiting for response.
344
+ @client.get_long_running_operation_result(response, deserialize_method)
345
+ end
346
+
347
+ promise
348
+ end
349
+
350
+ #
351
+ # Deletes the data box edge/gateway device.
352
+ #
353
+ # @param device_name [String] The device name.
354
+ # @param resource_group_name [String] The resource group name.
355
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
356
+ # will be added to the HTTP request.
357
+ #
358
+ def delete(device_name, resource_group_name, custom_headers:nil)
359
+ response = delete_async(device_name, resource_group_name, custom_headers:custom_headers).value!
360
+ nil
361
+ end
362
+
363
+ #
364
+ # @param device_name [String] The device name.
365
+ # @param resource_group_name [String] The resource group name.
366
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
367
+ # will be added to the HTTP request.
368
+ #
369
+ # @return [Concurrent::Promise] promise which provides async access to http
370
+ # response.
371
+ #
372
+ def delete_async(device_name, resource_group_name, custom_headers:nil)
373
+ # Send request
374
+ promise = begin_delete_async(device_name, resource_group_name, custom_headers:custom_headers)
375
+
376
+ promise = promise.then do |response|
377
+ # Defining deserialization method.
378
+ deserialize_method = lambda do |parsed_response|
379
+ end
380
+
381
+ # Waiting for response.
382
+ @client.get_long_running_operation_result(response, deserialize_method)
383
+ end
384
+
385
+ promise
386
+ end
387
+
388
+ #
389
+ # Modifies a Data Box Edge/Gateway resource.
390
+ #
391
+ # @param device_name [String] The device name.
392
+ # @param parameters [DataBoxEdgeDevicePatch] The resource parameters.
393
+ # @param resource_group_name [String] The resource group name.
394
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
395
+ # will be added to the HTTP request.
396
+ #
397
+ # @return [DataBoxEdgeDevice] operation results.
398
+ #
399
+ def update(device_name, parameters, resource_group_name, custom_headers:nil)
400
+ response = update_async(device_name, parameters, resource_group_name, custom_headers:custom_headers).value!
401
+ response.body unless response.nil?
402
+ end
403
+
404
+ #
405
+ # Modifies a Data Box Edge/Gateway resource.
406
+ #
407
+ # @param device_name [String] The device name.
408
+ # @param parameters [DataBoxEdgeDevicePatch] The resource parameters.
409
+ # @param resource_group_name [String] The resource group name.
410
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
411
+ # will be added to the HTTP request.
412
+ #
413
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
414
+ #
415
+ def update_with_http_info(device_name, parameters, resource_group_name, custom_headers:nil)
416
+ update_async(device_name, parameters, resource_group_name, custom_headers:custom_headers).value!
417
+ end
418
+
419
+ #
420
+ # Modifies a Data Box Edge/Gateway resource.
421
+ #
422
+ # @param device_name [String] The device name.
423
+ # @param parameters [DataBoxEdgeDevicePatch] The resource parameters.
424
+ # @param resource_group_name [String] The resource group name.
425
+ # @param [Hash{String => String}] A hash of custom headers that will be added
426
+ # to the HTTP request.
427
+ #
428
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
429
+ #
430
+ def update_async(device_name, parameters, resource_group_name, custom_headers:nil)
431
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
432
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
433
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
434
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
435
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
436
+
437
+
438
+ request_headers = {}
439
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
440
+
441
+ # Set Headers
442
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
443
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
444
+
445
+ # Serialize Request
446
+ request_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::DataBoxEdgeDevicePatch.mapper()
447
+ request_content = @client.serialize(request_mapper, parameters)
448
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
449
+
450
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'
451
+
452
+ request_url = @base_url || @client.base_url
453
+
454
+ options = {
455
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
456
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
457
+ query_params: {'api-version' => @client.api_version},
458
+ body: request_content,
459
+ headers: request_headers.merge(custom_headers || {}),
460
+ base_url: request_url
461
+ }
462
+ promise = @client.make_request_async(:patch, 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
+ # Deserialize Response
475
+ if status_code == 200
476
+ begin
477
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
478
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::DataBoxEdgeDevice.mapper()
479
+ result.body = @client.deserialize(result_mapper, parsed_response)
480
+ rescue Exception => e
481
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
482
+ end
483
+ end
484
+
485
+ result
486
+ end
487
+
488
+ promise.execute
489
+ end
490
+
491
+ #
492
+ # Downloads the updates on a data box edge/gateway device.
493
+ #
494
+ # @param device_name [String] The device name.
495
+ # @param resource_group_name [String] The resource group name.
496
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
497
+ # will be added to the HTTP request.
498
+ #
499
+ def download_updates(device_name, resource_group_name, custom_headers:nil)
500
+ response = download_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
501
+ nil
502
+ end
503
+
504
+ #
505
+ # @param device_name [String] The device name.
506
+ # @param resource_group_name [String] The resource group name.
507
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
508
+ # will be added to the HTTP request.
509
+ #
510
+ # @return [Concurrent::Promise] promise which provides async access to http
511
+ # response.
512
+ #
513
+ def download_updates_async(device_name, resource_group_name, custom_headers:nil)
514
+ # Send request
515
+ promise = begin_download_updates_async(device_name, resource_group_name, custom_headers:custom_headers)
516
+
517
+ promise = promise.then do |response|
518
+ # Defining deserialization method.
519
+ deserialize_method = lambda do |parsed_response|
520
+ end
521
+
522
+ # Waiting for response.
523
+ @client.get_long_running_operation_result(response, deserialize_method)
524
+ end
525
+
526
+ promise
527
+ end
528
+
529
+ #
530
+ # Creates or updates the additional information of a the data box edge/gateway
531
+ # device.
532
+ #
533
+ # @param device_name [String] The device name.
534
+ # @param parameters [DataBoxEdgeDeviceExtendedInfo] The additional information.
535
+ # @param resource_group_name [String] The resource group name.
536
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
537
+ # will be added to the HTTP request.
538
+ #
539
+ # @return [DataBoxEdgeDeviceExtendedInfo] operation results.
540
+ #
541
+ def create_or_update_extended_info(device_name, parameters, resource_group_name, custom_headers:nil)
542
+ response = create_or_update_extended_info_async(device_name, parameters, resource_group_name, custom_headers:custom_headers).value!
543
+ response.body unless response.nil?
544
+ end
545
+
546
+ #
547
+ # Creates or updates the additional information of a the data box edge/gateway
548
+ # device.
549
+ #
550
+ # @param device_name [String] The device name.
551
+ # @param parameters [DataBoxEdgeDeviceExtendedInfo] The additional information.
552
+ # @param resource_group_name [String] The resource group name.
553
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
554
+ # will be added to the HTTP request.
555
+ #
556
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
557
+ #
558
+ def create_or_update_extended_info_with_http_info(device_name, parameters, resource_group_name, custom_headers:nil)
559
+ create_or_update_extended_info_async(device_name, parameters, resource_group_name, custom_headers:custom_headers).value!
560
+ end
561
+
562
+ #
563
+ # Creates or updates the additional information of a the data box edge/gateway
564
+ # device.
565
+ #
566
+ # @param device_name [String] The device name.
567
+ # @param parameters [DataBoxEdgeDeviceExtendedInfo] The additional information.
568
+ # @param resource_group_name [String] The resource group name.
569
+ # @param [Hash{String => String}] A hash of custom headers that will be added
570
+ # to the HTTP request.
571
+ #
572
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
573
+ #
574
+ def create_or_update_extended_info_async(device_name, parameters, resource_group_name, custom_headers:nil)
575
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
576
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
577
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
578
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
579
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
580
+
581
+
582
+ request_headers = {}
583
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
584
+
585
+ # Set Headers
586
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
587
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
588
+
589
+ # Serialize Request
590
+ request_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::DataBoxEdgeDeviceExtendedInfo.mapper()
591
+ request_content = @client.serialize(request_mapper, parameters)
592
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
593
+
594
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'
595
+
596
+ request_url = @base_url || @client.base_url
597
+
598
+ options = {
599
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
600
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
601
+ query_params: {'api-version' => @client.api_version},
602
+ body: request_content,
603
+ headers: request_headers.merge(custom_headers || {}),
604
+ base_url: request_url
605
+ }
606
+ promise = @client.make_request_async(:put, path_template, options)
607
+
608
+ promise = promise.then do |result|
609
+ http_response = result.response
610
+ status_code = http_response.status
611
+ response_content = http_response.body
612
+ unless status_code == 200
613
+ error_model = JSON.load(response_content)
614
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
615
+ end
616
+
617
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
618
+ # Deserialize Response
619
+ if status_code == 200
620
+ begin
621
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
622
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::DataBoxEdgeDeviceExtendedInfo.mapper()
623
+ result.body = @client.deserialize(result_mapper, parsed_response)
624
+ rescue Exception => e
625
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
626
+ end
627
+ end
628
+
629
+ result
630
+ end
631
+
632
+ promise.execute
633
+ end
634
+
635
+ #
636
+ # Gets additional information for the specified data box edge/gateway device.
637
+ #
638
+ # @param device_name [String] The device name.
639
+ # @param resource_group_name [String] The resource group name.
640
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
641
+ # will be added to the HTTP request.
642
+ #
643
+ # @return [DataBoxEdgeDeviceExtendedInfo] operation results.
644
+ #
645
+ def get_extended_information(device_name, resource_group_name, custom_headers:nil)
646
+ response = get_extended_information_async(device_name, resource_group_name, custom_headers:custom_headers).value!
647
+ response.body unless response.nil?
648
+ end
649
+
650
+ #
651
+ # Gets additional information for the specified data box edge/gateway device.
652
+ #
653
+ # @param device_name [String] The device name.
654
+ # @param resource_group_name [String] The resource group name.
655
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
656
+ # will be added to the HTTP request.
657
+ #
658
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
659
+ #
660
+ def get_extended_information_with_http_info(device_name, resource_group_name, custom_headers:nil)
661
+ get_extended_information_async(device_name, resource_group_name, custom_headers:custom_headers).value!
662
+ end
663
+
664
+ #
665
+ # Gets additional information for the specified data box edge/gateway device.
666
+ #
667
+ # @param device_name [String] The device name.
668
+ # @param resource_group_name [String] The resource group name.
669
+ # @param [Hash{String => String}] A hash of custom headers that will be added
670
+ # to the HTTP request.
671
+ #
672
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
673
+ #
674
+ def get_extended_information_async(device_name, resource_group_name, custom_headers:nil)
675
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
676
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
677
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
678
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
679
+
680
+
681
+ request_headers = {}
682
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
683
+
684
+ # Set Headers
685
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
686
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
687
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation'
688
+
689
+ request_url = @base_url || @client.base_url
690
+
691
+ options = {
692
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
693
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
694
+ query_params: {'api-version' => @client.api_version},
695
+ headers: request_headers.merge(custom_headers || {}),
696
+ base_url: request_url
697
+ }
698
+ promise = @client.make_request_async(:post, path_template, options)
699
+
700
+ promise = promise.then do |result|
701
+ http_response = result.response
702
+ status_code = http_response.status
703
+ response_content = http_response.body
704
+ unless status_code == 200
705
+ error_model = JSON.load(response_content)
706
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
707
+ end
708
+
709
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
710
+ # Deserialize Response
711
+ if status_code == 200
712
+ begin
713
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
714
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::DataBoxEdgeDeviceExtendedInfo.mapper()
715
+ result.body = @client.deserialize(result_mapper, parsed_response)
716
+ rescue Exception => e
717
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
718
+ end
719
+ end
720
+
721
+ result
722
+ end
723
+
724
+ promise.execute
725
+ end
726
+
727
+ #
728
+ # Installs the updates on the data box edge/gateway device.
729
+ #
730
+ # @param device_name [String] The device name.
731
+ # @param resource_group_name [String] The resource group name.
732
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
733
+ # will be added to the HTTP request.
734
+ #
735
+ def install_updates(device_name, resource_group_name, custom_headers:nil)
736
+ response = install_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
737
+ nil
738
+ end
739
+
740
+ #
741
+ # @param device_name [String] The device name.
742
+ # @param resource_group_name [String] The resource group name.
743
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
744
+ # will be added to the HTTP request.
745
+ #
746
+ # @return [Concurrent::Promise] promise which provides async access to http
747
+ # response.
748
+ #
749
+ def install_updates_async(device_name, resource_group_name, custom_headers:nil)
750
+ # Send request
751
+ promise = begin_install_updates_async(device_name, resource_group_name, custom_headers:custom_headers)
752
+
753
+ promise = promise.then do |response|
754
+ # Defining deserialization method.
755
+ deserialize_method = lambda do |parsed_response|
756
+ end
757
+
758
+ # Waiting for response.
759
+ @client.get_long_running_operation_result(response, deserialize_method)
760
+ end
761
+
762
+ promise
763
+ end
764
+
765
+ #
766
+ # Gets the network settings of the specified data box edge/gateway device.
767
+ #
768
+ # @param device_name [String] The device name.
769
+ # @param resource_group_name [String] The resource group name.
770
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
771
+ # will be added to the HTTP request.
772
+ #
773
+ # @return [NetworkSettings] operation results.
774
+ #
775
+ def get_network_settings(device_name, resource_group_name, custom_headers:nil)
776
+ response = get_network_settings_async(device_name, resource_group_name, custom_headers:custom_headers).value!
777
+ response.body unless response.nil?
778
+ end
779
+
780
+ #
781
+ # Gets the network settings of the specified data box edge/gateway device.
782
+ #
783
+ # @param device_name [String] The device name.
784
+ # @param resource_group_name [String] The resource group name.
785
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
786
+ # will be added to the HTTP request.
787
+ #
788
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
789
+ #
790
+ def get_network_settings_with_http_info(device_name, resource_group_name, custom_headers:nil)
791
+ get_network_settings_async(device_name, resource_group_name, custom_headers:custom_headers).value!
792
+ end
793
+
794
+ #
795
+ # Gets the network settings of the specified data box edge/gateway device.
796
+ #
797
+ # @param device_name [String] The device name.
798
+ # @param resource_group_name [String] The resource group name.
799
+ # @param [Hash{String => String}] A hash of custom headers that will be added
800
+ # to the HTTP request.
801
+ #
802
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
803
+ #
804
+ def get_network_settings_async(device_name, resource_group_name, custom_headers:nil)
805
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
806
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
807
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
808
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
809
+
810
+
811
+ request_headers = {}
812
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
813
+
814
+ # Set Headers
815
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
816
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
817
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default'
818
+
819
+ request_url = @base_url || @client.base_url
820
+
821
+ options = {
822
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
823
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
824
+ query_params: {'api-version' => @client.api_version},
825
+ headers: request_headers.merge(custom_headers || {}),
826
+ base_url: request_url
827
+ }
828
+ promise = @client.make_request_async(:get, path_template, options)
829
+
830
+ promise = promise.then do |result|
831
+ http_response = result.response
832
+ status_code = http_response.status
833
+ response_content = http_response.body
834
+ unless status_code == 200
835
+ error_model = JSON.load(response_content)
836
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
837
+ end
838
+
839
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
840
+ # Deserialize Response
841
+ if status_code == 200
842
+ begin
843
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
844
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::NetworkSettings.mapper()
845
+ result.body = @client.deserialize(result_mapper, parsed_response)
846
+ rescue Exception => e
847
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
848
+ end
849
+ end
850
+
851
+ result
852
+ end
853
+
854
+ promise.execute
855
+ end
856
+
857
+ #
858
+ # Scans for updates on a data box edge/gateway device.
859
+ #
860
+ # @param device_name [String] The device name.
861
+ # @param resource_group_name [String] The resource group name.
862
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
863
+ # will be added to the HTTP request.
864
+ #
865
+ def scan_for_updates(device_name, resource_group_name, custom_headers:nil)
866
+ response = scan_for_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
867
+ nil
868
+ end
869
+
870
+ #
871
+ # @param device_name [String] The device name.
872
+ # @param resource_group_name [String] The resource group name.
873
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
874
+ # will be added to the HTTP request.
875
+ #
876
+ # @return [Concurrent::Promise] promise which provides async access to http
877
+ # response.
878
+ #
879
+ def scan_for_updates_async(device_name, resource_group_name, custom_headers:nil)
880
+ # Send request
881
+ promise = begin_scan_for_updates_async(device_name, resource_group_name, custom_headers:custom_headers)
882
+
883
+ promise = promise.then do |response|
884
+ # Defining deserialization method.
885
+ deserialize_method = lambda do |parsed_response|
886
+ end
887
+
888
+ # Waiting for response.
889
+ @client.get_long_running_operation_result(response, deserialize_method)
890
+ end
891
+
892
+ promise
893
+ end
894
+
895
+ #
896
+ # Updates the security settings on a data box edge/gateway device.
897
+ #
898
+ # @param device_name [String] The device name.
899
+ # @param security_settings [SecuritySettings] The security settings.
900
+ # @param resource_group_name [String] The resource group name.
901
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
902
+ # will be added to the HTTP request.
903
+ #
904
+ def create_or_update_security_settings(device_name, security_settings, resource_group_name, custom_headers:nil)
905
+ response = create_or_update_security_settings_async(device_name, security_settings, resource_group_name, custom_headers:custom_headers).value!
906
+ nil
907
+ end
908
+
909
+ #
910
+ # @param device_name [String] The device name.
911
+ # @param security_settings [SecuritySettings] The security settings.
912
+ # @param resource_group_name [String] The resource group name.
913
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
914
+ # will be added to the HTTP request.
915
+ #
916
+ # @return [Concurrent::Promise] promise which provides async access to http
917
+ # response.
918
+ #
919
+ def create_or_update_security_settings_async(device_name, security_settings, resource_group_name, custom_headers:nil)
920
+ # Send request
921
+ promise = begin_create_or_update_security_settings_async(device_name, security_settings, resource_group_name, custom_headers:custom_headers)
922
+
923
+ promise = promise.then do |response|
924
+ # Defining deserialization method.
925
+ deserialize_method = lambda do |parsed_response|
926
+ end
927
+
928
+ # Waiting for response.
929
+ @client.get_long_running_operation_result(response, deserialize_method)
930
+ end
931
+
932
+ promise
933
+ end
934
+
935
+ #
936
+ # Gets information about the availability of updates based on the last scan of
937
+ # the device. It also gets information about any ongoing download or install
938
+ # jobs on the device.
939
+ #
940
+ # @param device_name [String] The device name.
941
+ # @param resource_group_name [String] The resource group name.
942
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
943
+ # will be added to the HTTP request.
944
+ #
945
+ # @return [UpdateSummary] operation results.
946
+ #
947
+ def get_update_summary(device_name, resource_group_name, custom_headers:nil)
948
+ response = get_update_summary_async(device_name, resource_group_name, custom_headers:custom_headers).value!
949
+ response.body unless response.nil?
950
+ end
951
+
952
+ #
953
+ # Gets information about the availability of updates based on the last scan of
954
+ # the device. It also gets information about any ongoing download or install
955
+ # jobs on the device.
956
+ #
957
+ # @param device_name [String] The device name.
958
+ # @param resource_group_name [String] The resource group name.
959
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
960
+ # will be added to the HTTP request.
961
+ #
962
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
963
+ #
964
+ def get_update_summary_with_http_info(device_name, resource_group_name, custom_headers:nil)
965
+ get_update_summary_async(device_name, resource_group_name, custom_headers:custom_headers).value!
966
+ end
967
+
968
+ #
969
+ # Gets information about the availability of updates based on the last scan of
970
+ # the device. It also gets information about any ongoing download or install
971
+ # jobs on the device.
972
+ #
973
+ # @param device_name [String] The device name.
974
+ # @param resource_group_name [String] The resource group name.
975
+ # @param [Hash{String => String}] A hash of custom headers that will be added
976
+ # to the HTTP request.
977
+ #
978
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
979
+ #
980
+ def get_update_summary_async(device_name, resource_group_name, custom_headers:nil)
981
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
982
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
983
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
984
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
985
+
986
+
987
+ request_headers = {}
988
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
989
+
990
+ # Set Headers
991
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
992
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
993
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default'
994
+
995
+ request_url = @base_url || @client.base_url
996
+
997
+ options = {
998
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
999
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1000
+ query_params: {'api-version' => @client.api_version},
1001
+ headers: request_headers.merge(custom_headers || {}),
1002
+ base_url: request_url
1003
+ }
1004
+ promise = @client.make_request_async(:get, path_template, options)
1005
+
1006
+ promise = promise.then do |result|
1007
+ http_response = result.response
1008
+ status_code = http_response.status
1009
+ response_content = http_response.body
1010
+ unless status_code == 200
1011
+ error_model = JSON.load(response_content)
1012
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1013
+ end
1014
+
1015
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1016
+ # Deserialize Response
1017
+ if status_code == 200
1018
+ begin
1019
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1020
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::UpdateSummary.mapper()
1021
+ result.body = @client.deserialize(result_mapper, parsed_response)
1022
+ rescue Exception => e
1023
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1024
+ end
1025
+ end
1026
+
1027
+ result
1028
+ end
1029
+
1030
+ promise.execute
1031
+ end
1032
+
1033
+ #
1034
+ # Uploads registration certificate for the device.
1035
+ #
1036
+ # @param device_name [String] The device name.
1037
+ # @param parameters [UploadCertificateRequest] The upload certificate request.
1038
+ # @param resource_group_name [String] The resource group name.
1039
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1040
+ # will be added to the HTTP request.
1041
+ #
1042
+ # @return [UploadCertificateResponse] operation results.
1043
+ #
1044
+ def upload_certificate(device_name, parameters, resource_group_name, custom_headers:nil)
1045
+ response = upload_certificate_async(device_name, parameters, resource_group_name, custom_headers:custom_headers).value!
1046
+ response.body unless response.nil?
1047
+ end
1048
+
1049
+ #
1050
+ # Uploads registration certificate for the device.
1051
+ #
1052
+ # @param device_name [String] The device name.
1053
+ # @param parameters [UploadCertificateRequest] The upload certificate request.
1054
+ # @param resource_group_name [String] The resource group name.
1055
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1056
+ # will be added to the HTTP request.
1057
+ #
1058
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1059
+ #
1060
+ def upload_certificate_with_http_info(device_name, parameters, resource_group_name, custom_headers:nil)
1061
+ upload_certificate_async(device_name, parameters, resource_group_name, custom_headers:custom_headers).value!
1062
+ end
1063
+
1064
+ #
1065
+ # Uploads registration certificate for the device.
1066
+ #
1067
+ # @param device_name [String] The device name.
1068
+ # @param parameters [UploadCertificateRequest] The upload certificate request.
1069
+ # @param resource_group_name [String] The resource group name.
1070
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1071
+ # to the HTTP request.
1072
+ #
1073
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1074
+ #
1075
+ def upload_certificate_async(device_name, parameters, resource_group_name, custom_headers:nil)
1076
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1077
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
1078
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1079
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1080
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1081
+
1082
+
1083
+ request_headers = {}
1084
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1085
+
1086
+ # Set Headers
1087
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1088
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1089
+
1090
+ # Serialize Request
1091
+ request_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::UploadCertificateRequest.mapper()
1092
+ request_content = @client.serialize(request_mapper, parameters)
1093
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1094
+
1095
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate'
1096
+
1097
+ request_url = @base_url || @client.base_url
1098
+
1099
+ options = {
1100
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1101
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1102
+ query_params: {'api-version' => @client.api_version},
1103
+ body: request_content,
1104
+ headers: request_headers.merge(custom_headers || {}),
1105
+ base_url: request_url
1106
+ }
1107
+ promise = @client.make_request_async(:post, path_template, options)
1108
+
1109
+ promise = promise.then do |result|
1110
+ http_response = result.response
1111
+ status_code = http_response.status
1112
+ response_content = http_response.body
1113
+ unless status_code == 200
1114
+ error_model = JSON.load(response_content)
1115
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1116
+ end
1117
+
1118
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1119
+ # Deserialize Response
1120
+ if status_code == 200
1121
+ begin
1122
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1123
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::UploadCertificateResponse.mapper()
1124
+ result.body = @client.deserialize(result_mapper, parsed_response)
1125
+ rescue Exception => e
1126
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1127
+ end
1128
+ end
1129
+
1130
+ result
1131
+ end
1132
+
1133
+ promise.execute
1134
+ end
1135
+
1136
+ #
1137
+ # Creates or updates a Data Box Edge/Gateway resource.
1138
+ #
1139
+ # @param device_name [String] The device name.
1140
+ # @param data_box_edge_device [DataBoxEdgeDevice] The resource object.
1141
+ # @param resource_group_name [String] The resource group name.
1142
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1143
+ # will be added to the HTTP request.
1144
+ #
1145
+ # @return [DataBoxEdgeDevice] operation results.
1146
+ #
1147
+ def begin_create_or_update(device_name, data_box_edge_device, resource_group_name, custom_headers:nil)
1148
+ response = begin_create_or_update_async(device_name, data_box_edge_device, resource_group_name, custom_headers:custom_headers).value!
1149
+ response.body unless response.nil?
1150
+ end
1151
+
1152
+ #
1153
+ # Creates or updates a Data Box Edge/Gateway resource.
1154
+ #
1155
+ # @param device_name [String] The device name.
1156
+ # @param data_box_edge_device [DataBoxEdgeDevice] The resource object.
1157
+ # @param resource_group_name [String] The resource group name.
1158
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1159
+ # will be added to the HTTP request.
1160
+ #
1161
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1162
+ #
1163
+ def begin_create_or_update_with_http_info(device_name, data_box_edge_device, resource_group_name, custom_headers:nil)
1164
+ begin_create_or_update_async(device_name, data_box_edge_device, resource_group_name, custom_headers:custom_headers).value!
1165
+ end
1166
+
1167
+ #
1168
+ # Creates or updates a Data Box Edge/Gateway resource.
1169
+ #
1170
+ # @param device_name [String] The device name.
1171
+ # @param data_box_edge_device [DataBoxEdgeDevice] The resource object.
1172
+ # @param resource_group_name [String] The resource group name.
1173
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1174
+ # to the HTTP request.
1175
+ #
1176
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1177
+ #
1178
+ def begin_create_or_update_async(device_name, data_box_edge_device, resource_group_name, custom_headers:nil)
1179
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1180
+ fail ArgumentError, 'data_box_edge_device is nil' if data_box_edge_device.nil?
1181
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1182
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1183
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1184
+
1185
+
1186
+ request_headers = {}
1187
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1188
+
1189
+ # Set Headers
1190
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1191
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1192
+
1193
+ # Serialize Request
1194
+ request_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::DataBoxEdgeDevice.mapper()
1195
+ request_content = @client.serialize(request_mapper, data_box_edge_device)
1196
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1197
+
1198
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'
1199
+
1200
+ request_url = @base_url || @client.base_url
1201
+
1202
+ options = {
1203
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1204
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1205
+ query_params: {'api-version' => @client.api_version},
1206
+ body: request_content,
1207
+ headers: request_headers.merge(custom_headers || {}),
1208
+ base_url: request_url
1209
+ }
1210
+ promise = @client.make_request_async(:put, path_template, options)
1211
+
1212
+ promise = promise.then do |result|
1213
+ http_response = result.response
1214
+ status_code = http_response.status
1215
+ response_content = http_response.body
1216
+ unless status_code == 200
1217
+ error_model = JSON.load(response_content)
1218
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1219
+ end
1220
+
1221
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1222
+ # Deserialize Response
1223
+ if status_code == 200
1224
+ begin
1225
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1226
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::DataBoxEdgeDevice.mapper()
1227
+ result.body = @client.deserialize(result_mapper, parsed_response)
1228
+ rescue Exception => e
1229
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1230
+ end
1231
+ end
1232
+
1233
+ result
1234
+ end
1235
+
1236
+ promise.execute
1237
+ end
1238
+
1239
+ #
1240
+ # Deletes the data box edge/gateway device.
1241
+ #
1242
+ # @param device_name [String] The device name.
1243
+ # @param resource_group_name [String] The resource group name.
1244
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1245
+ # will be added to the HTTP request.
1246
+ #
1247
+ #
1248
+ def begin_delete(device_name, resource_group_name, custom_headers:nil)
1249
+ response = begin_delete_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1250
+ nil
1251
+ end
1252
+
1253
+ #
1254
+ # Deletes the data box edge/gateway device.
1255
+ #
1256
+ # @param device_name [String] The device name.
1257
+ # @param resource_group_name [String] The resource group name.
1258
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1259
+ # will be added to the HTTP request.
1260
+ #
1261
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1262
+ #
1263
+ def begin_delete_with_http_info(device_name, resource_group_name, custom_headers:nil)
1264
+ begin_delete_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1265
+ end
1266
+
1267
+ #
1268
+ # Deletes the data box edge/gateway device.
1269
+ #
1270
+ # @param device_name [String] The device name.
1271
+ # @param resource_group_name [String] The resource group name.
1272
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1273
+ # to the HTTP request.
1274
+ #
1275
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1276
+ #
1277
+ def begin_delete_async(device_name, resource_group_name, custom_headers:nil)
1278
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1279
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1280
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1281
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1282
+
1283
+
1284
+ request_headers = {}
1285
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1286
+
1287
+ # Set Headers
1288
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1289
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1290
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}'
1291
+
1292
+ request_url = @base_url || @client.base_url
1293
+
1294
+ options = {
1295
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1296
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1297
+ query_params: {'api-version' => @client.api_version},
1298
+ headers: request_headers.merge(custom_headers || {}),
1299
+ base_url: request_url
1300
+ }
1301
+ promise = @client.make_request_async(:delete, path_template, options)
1302
+
1303
+ promise = promise.then do |result|
1304
+ http_response = result.response
1305
+ status_code = http_response.status
1306
+ response_content = http_response.body
1307
+ unless status_code == 200 || status_code == 202 || status_code == 204
1308
+ error_model = JSON.load(response_content)
1309
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1310
+ end
1311
+
1312
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1313
+
1314
+ result
1315
+ end
1316
+
1317
+ promise.execute
1318
+ end
1319
+
1320
+ #
1321
+ # Downloads the updates on a data box edge/gateway device.
1322
+ #
1323
+ # @param device_name [String] The device name.
1324
+ # @param resource_group_name [String] The resource group name.
1325
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1326
+ # will be added to the HTTP request.
1327
+ #
1328
+ #
1329
+ def begin_download_updates(device_name, resource_group_name, custom_headers:nil)
1330
+ response = begin_download_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1331
+ nil
1332
+ end
1333
+
1334
+ #
1335
+ # Downloads the updates on a data box edge/gateway device.
1336
+ #
1337
+ # @param device_name [String] The device name.
1338
+ # @param resource_group_name [String] The resource group name.
1339
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1340
+ # will be added to the HTTP request.
1341
+ #
1342
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1343
+ #
1344
+ def begin_download_updates_with_http_info(device_name, resource_group_name, custom_headers:nil)
1345
+ begin_download_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1346
+ end
1347
+
1348
+ #
1349
+ # Downloads the updates on a data box edge/gateway device.
1350
+ #
1351
+ # @param device_name [String] The device name.
1352
+ # @param resource_group_name [String] The resource group name.
1353
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1354
+ # to the HTTP request.
1355
+ #
1356
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1357
+ #
1358
+ def begin_download_updates_async(device_name, resource_group_name, custom_headers:nil)
1359
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1360
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1361
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1362
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1363
+
1364
+
1365
+ request_headers = {}
1366
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1367
+
1368
+ # Set Headers
1369
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1370
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1371
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates'
1372
+
1373
+ request_url = @base_url || @client.base_url
1374
+
1375
+ options = {
1376
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1377
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1378
+ query_params: {'api-version' => @client.api_version},
1379
+ headers: request_headers.merge(custom_headers || {}),
1380
+ base_url: request_url
1381
+ }
1382
+ promise = @client.make_request_async(:post, path_template, options)
1383
+
1384
+ promise = promise.then do |result|
1385
+ http_response = result.response
1386
+ status_code = http_response.status
1387
+ response_content = http_response.body
1388
+ unless status_code == 200 || status_code == 202
1389
+ error_model = JSON.load(response_content)
1390
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1391
+ end
1392
+
1393
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1394
+
1395
+ result
1396
+ end
1397
+
1398
+ promise.execute
1399
+ end
1400
+
1401
+ #
1402
+ # Installs the updates on the data box edge/gateway device.
1403
+ #
1404
+ # @param device_name [String] The device name.
1405
+ # @param resource_group_name [String] The resource group name.
1406
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1407
+ # will be added to the HTTP request.
1408
+ #
1409
+ #
1410
+ def begin_install_updates(device_name, resource_group_name, custom_headers:nil)
1411
+ response = begin_install_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1412
+ nil
1413
+ end
1414
+
1415
+ #
1416
+ # Installs the updates on the data box edge/gateway device.
1417
+ #
1418
+ # @param device_name [String] The device name.
1419
+ # @param resource_group_name [String] The resource group name.
1420
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1421
+ # will be added to the HTTP request.
1422
+ #
1423
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1424
+ #
1425
+ def begin_install_updates_with_http_info(device_name, resource_group_name, custom_headers:nil)
1426
+ begin_install_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1427
+ end
1428
+
1429
+ #
1430
+ # Installs the updates on the data box edge/gateway device.
1431
+ #
1432
+ # @param device_name [String] The device name.
1433
+ # @param resource_group_name [String] The resource group name.
1434
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1435
+ # to the HTTP request.
1436
+ #
1437
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1438
+ #
1439
+ def begin_install_updates_async(device_name, resource_group_name, custom_headers:nil)
1440
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1441
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1442
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1443
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1444
+
1445
+
1446
+ request_headers = {}
1447
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1448
+
1449
+ # Set Headers
1450
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1451
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1452
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates'
1453
+
1454
+ request_url = @base_url || @client.base_url
1455
+
1456
+ options = {
1457
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1458
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1459
+ query_params: {'api-version' => @client.api_version},
1460
+ headers: request_headers.merge(custom_headers || {}),
1461
+ base_url: request_url
1462
+ }
1463
+ promise = @client.make_request_async(:post, path_template, options)
1464
+
1465
+ promise = promise.then do |result|
1466
+ http_response = result.response
1467
+ status_code = http_response.status
1468
+ response_content = http_response.body
1469
+ unless status_code == 200 || status_code == 202
1470
+ error_model = JSON.load(response_content)
1471
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1472
+ end
1473
+
1474
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1475
+
1476
+ result
1477
+ end
1478
+
1479
+ promise.execute
1480
+ end
1481
+
1482
+ #
1483
+ # Scans for updates on a data box edge/gateway device.
1484
+ #
1485
+ # @param device_name [String] The device name.
1486
+ # @param resource_group_name [String] The resource group name.
1487
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1488
+ # will be added to the HTTP request.
1489
+ #
1490
+ #
1491
+ def begin_scan_for_updates(device_name, resource_group_name, custom_headers:nil)
1492
+ response = begin_scan_for_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1493
+ nil
1494
+ end
1495
+
1496
+ #
1497
+ # Scans for updates on a data box edge/gateway device.
1498
+ #
1499
+ # @param device_name [String] The device name.
1500
+ # @param resource_group_name [String] The resource group name.
1501
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1502
+ # will be added to the HTTP request.
1503
+ #
1504
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1505
+ #
1506
+ def begin_scan_for_updates_with_http_info(device_name, resource_group_name, custom_headers:nil)
1507
+ begin_scan_for_updates_async(device_name, resource_group_name, custom_headers:custom_headers).value!
1508
+ end
1509
+
1510
+ #
1511
+ # Scans for updates on a data box edge/gateway device.
1512
+ #
1513
+ # @param device_name [String] The device name.
1514
+ # @param resource_group_name [String] The resource group name.
1515
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1516
+ # to the HTTP request.
1517
+ #
1518
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1519
+ #
1520
+ def begin_scan_for_updates_async(device_name, resource_group_name, custom_headers:nil)
1521
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1522
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1523
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1524
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1525
+
1526
+
1527
+ request_headers = {}
1528
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1529
+
1530
+ # Set Headers
1531
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1532
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1533
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates'
1534
+
1535
+ request_url = @base_url || @client.base_url
1536
+
1537
+ options = {
1538
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1539
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1540
+ query_params: {'api-version' => @client.api_version},
1541
+ headers: request_headers.merge(custom_headers || {}),
1542
+ base_url: request_url
1543
+ }
1544
+ promise = @client.make_request_async(:post, path_template, options)
1545
+
1546
+ promise = promise.then do |result|
1547
+ http_response = result.response
1548
+ status_code = http_response.status
1549
+ response_content = http_response.body
1550
+ unless status_code == 200 || status_code == 202
1551
+ error_model = JSON.load(response_content)
1552
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1553
+ end
1554
+
1555
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1556
+
1557
+ result
1558
+ end
1559
+
1560
+ promise.execute
1561
+ end
1562
+
1563
+ #
1564
+ # Updates the security settings on a data box edge/gateway device.
1565
+ #
1566
+ # @param device_name [String] The device name.
1567
+ # @param security_settings [SecuritySettings] The security settings.
1568
+ # @param resource_group_name [String] The resource group name.
1569
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1570
+ # will be added to the HTTP request.
1571
+ #
1572
+ #
1573
+ def begin_create_or_update_security_settings(device_name, security_settings, resource_group_name, custom_headers:nil)
1574
+ response = begin_create_or_update_security_settings_async(device_name, security_settings, resource_group_name, custom_headers:custom_headers).value!
1575
+ nil
1576
+ end
1577
+
1578
+ #
1579
+ # Updates the security settings on a data box edge/gateway device.
1580
+ #
1581
+ # @param device_name [String] The device name.
1582
+ # @param security_settings [SecuritySettings] The security settings.
1583
+ # @param resource_group_name [String] The resource group name.
1584
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1585
+ # will be added to the HTTP request.
1586
+ #
1587
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1588
+ #
1589
+ def begin_create_or_update_security_settings_with_http_info(device_name, security_settings, resource_group_name, custom_headers:nil)
1590
+ begin_create_or_update_security_settings_async(device_name, security_settings, resource_group_name, custom_headers:custom_headers).value!
1591
+ end
1592
+
1593
+ #
1594
+ # Updates the security settings on a data box edge/gateway device.
1595
+ #
1596
+ # @param device_name [String] The device name.
1597
+ # @param security_settings [SecuritySettings] The security settings.
1598
+ # @param resource_group_name [String] The resource group name.
1599
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1600
+ # to the HTTP request.
1601
+ #
1602
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1603
+ #
1604
+ def begin_create_or_update_security_settings_async(device_name, security_settings, resource_group_name, custom_headers:nil)
1605
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
1606
+ fail ArgumentError, 'security_settings is nil' if security_settings.nil?
1607
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1608
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1609
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1610
+
1611
+
1612
+ request_headers = {}
1613
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1614
+
1615
+ # Set Headers
1616
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1617
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1618
+
1619
+ # Serialize Request
1620
+ request_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::SecuritySettings.mapper()
1621
+ request_content = @client.serialize(request_mapper, security_settings)
1622
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1623
+
1624
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update'
1625
+
1626
+ request_url = @base_url || @client.base_url
1627
+
1628
+ options = {
1629
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1630
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
1631
+ query_params: {'api-version' => @client.api_version},
1632
+ body: request_content,
1633
+ headers: request_headers.merge(custom_headers || {}),
1634
+ base_url: request_url
1635
+ }
1636
+ promise = @client.make_request_async(:post, path_template, options)
1637
+
1638
+ promise = promise.then do |result|
1639
+ http_response = result.response
1640
+ status_code = http_response.status
1641
+ response_content = http_response.body
1642
+ unless status_code == 202 || status_code == 204
1643
+ error_model = JSON.load(response_content)
1644
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1645
+ end
1646
+
1647
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1648
+
1649
+ result
1650
+ end
1651
+
1652
+ promise.execute
1653
+ end
1654
+
1655
+ #
1656
+ # Gets all the data box edge/gateway devices in a subscription.
1657
+ #
1658
+ # @param next_page_link [String] The NextLink from the previous successful call
1659
+ # to List operation.
1660
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1661
+ # will be added to the HTTP request.
1662
+ #
1663
+ # @return [DataBoxEdgeDeviceList] operation results.
1664
+ #
1665
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
1666
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1667
+ response.body unless response.nil?
1668
+ end
1669
+
1670
+ #
1671
+ # Gets all the data box edge/gateway devices in a subscription.
1672
+ #
1673
+ # @param next_page_link [String] The NextLink from the previous successful call
1674
+ # to List operation.
1675
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1676
+ # will be added to the HTTP request.
1677
+ #
1678
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1679
+ #
1680
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
1681
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1682
+ end
1683
+
1684
+ #
1685
+ # Gets all the data box edge/gateway devices in a subscription.
1686
+ #
1687
+ # @param next_page_link [String] The NextLink from the previous successful call
1688
+ # to List operation.
1689
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1690
+ # to the HTTP request.
1691
+ #
1692
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1693
+ #
1694
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
1695
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1696
+
1697
+
1698
+ request_headers = {}
1699
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1700
+
1701
+ # Set Headers
1702
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1703
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1704
+ path_template = '{nextLink}'
1705
+
1706
+ request_url = @base_url || @client.base_url
1707
+
1708
+ options = {
1709
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1710
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1711
+ headers: request_headers.merge(custom_headers || {}),
1712
+ base_url: request_url
1713
+ }
1714
+ promise = @client.make_request_async(:get, path_template, options)
1715
+
1716
+ promise = promise.then do |result|
1717
+ http_response = result.response
1718
+ status_code = http_response.status
1719
+ response_content = http_response.body
1720
+ unless status_code == 200
1721
+ error_model = JSON.load(response_content)
1722
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1723
+ end
1724
+
1725
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1726
+ # Deserialize Response
1727
+ if status_code == 200
1728
+ begin
1729
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1730
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::DataBoxEdgeDeviceList.mapper()
1731
+ result.body = @client.deserialize(result_mapper, parsed_response)
1732
+ rescue Exception => e
1733
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1734
+ end
1735
+ end
1736
+
1737
+ result
1738
+ end
1739
+
1740
+ promise.execute
1741
+ end
1742
+
1743
+ #
1744
+ # Gets all the data box edge/gateway devices in a resource group.
1745
+ #
1746
+ # @param next_page_link [String] The NextLink from the previous successful call
1747
+ # to List operation.
1748
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1749
+ # will be added to the HTTP request.
1750
+ #
1751
+ # @return [DataBoxEdgeDeviceList] operation results.
1752
+ #
1753
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1754
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1755
+ response.body unless response.nil?
1756
+ end
1757
+
1758
+ #
1759
+ # Gets all the data box edge/gateway devices in a resource group.
1760
+ #
1761
+ # @param next_page_link [String] The NextLink from the previous successful call
1762
+ # to List operation.
1763
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1764
+ # will be added to the HTTP request.
1765
+ #
1766
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1767
+ #
1768
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1769
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1770
+ end
1771
+
1772
+ #
1773
+ # Gets all the data box edge/gateway devices in a resource group.
1774
+ #
1775
+ # @param next_page_link [String] The NextLink from the previous successful call
1776
+ # to List operation.
1777
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1778
+ # to the HTTP request.
1779
+ #
1780
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1781
+ #
1782
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1783
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1784
+
1785
+
1786
+ request_headers = {}
1787
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1788
+
1789
+ # Set Headers
1790
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1791
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1792
+ path_template = '{nextLink}'
1793
+
1794
+ request_url = @base_url || @client.base_url
1795
+
1796
+ options = {
1797
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1798
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1799
+ headers: request_headers.merge(custom_headers || {}),
1800
+ base_url: request_url
1801
+ }
1802
+ promise = @client.make_request_async(:get, path_template, options)
1803
+
1804
+ promise = promise.then do |result|
1805
+ http_response = result.response
1806
+ status_code = http_response.status
1807
+ response_content = http_response.body
1808
+ unless status_code == 200
1809
+ error_model = JSON.load(response_content)
1810
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1811
+ end
1812
+
1813
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1814
+ # Deserialize Response
1815
+ if status_code == 200
1816
+ begin
1817
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1818
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::DataBoxEdgeDeviceList.mapper()
1819
+ result.body = @client.deserialize(result_mapper, parsed_response)
1820
+ rescue Exception => e
1821
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1822
+ end
1823
+ end
1824
+
1825
+ result
1826
+ end
1827
+
1828
+ promise.execute
1829
+ end
1830
+
1831
+ #
1832
+ # Gets all the data box edge/gateway devices in a subscription.
1833
+ #
1834
+ # @param expand [String] Specify $expand=details to populate additional fields
1835
+ # related to the resource or Specify $skipToken=<token> to populate the next
1836
+ # page in the list.
1837
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1838
+ # will be added to the HTTP request.
1839
+ #
1840
+ # @return [DataBoxEdgeDeviceList] which provide lazy access to pages of the
1841
+ # response.
1842
+ #
1843
+ def list_by_subscription_as_lazy(expand:nil, custom_headers:nil)
1844
+ response = list_by_subscription_async(expand:expand, custom_headers:custom_headers).value!
1845
+ unless response.nil?
1846
+ page = response.body
1847
+ page.next_method = Proc.new do |next_page_link|
1848
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
1849
+ end
1850
+ page
1851
+ end
1852
+ end
1853
+
1854
+ #
1855
+ # Gets all the data box edge/gateway devices in a resource group.
1856
+ #
1857
+ # @param resource_group_name [String] The resource group name.
1858
+ # @param expand [String] Specify $expand=details to populate additional fields
1859
+ # related to the resource or Specify $skipToken=<token> to populate the next
1860
+ # page in the list.
1861
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1862
+ # will be added to the HTTP request.
1863
+ #
1864
+ # @return [DataBoxEdgeDeviceList] which provide lazy access to pages of the
1865
+ # response.
1866
+ #
1867
+ def list_by_resource_group_as_lazy(resource_group_name, expand:nil, custom_headers:nil)
1868
+ response = list_by_resource_group_async(resource_group_name, expand:expand, custom_headers:custom_headers).value!
1869
+ unless response.nil?
1870
+ page = response.body
1871
+ page.next_method = Proc.new do |next_page_link|
1872
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1873
+ end
1874
+ page
1875
+ end
1876
+ end
1877
+
1878
+ end
1879
+ end