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,121 @@
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
+ # OperationsStatus
9
+ #
10
+ class OperationsStatus
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the OperationsStatus 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 the details of a specified job on a data box edge/gateway device.
26
+ #
27
+ # @param device_name [String] The device name.
28
+ # @param name [String] The job name.
29
+ # @param resource_group_name [String] The resource group name.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [Job] operation results.
34
+ #
35
+ def get(device_name, name, resource_group_name, custom_headers:nil)
36
+ response = get_async(device_name, name, resource_group_name, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Gets the details of a specified job on a data box edge/gateway device.
42
+ #
43
+ # @param device_name [String] The device name.
44
+ # @param name [String] The job name.
45
+ # @param resource_group_name [String] The resource group name.
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 get_with_http_info(device_name, name, resource_group_name, custom_headers:nil)
52
+ get_async(device_name, name, resource_group_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Gets the details of a specified job on a data box edge/gateway device.
57
+ #
58
+ # @param device_name [String] The device name.
59
+ # @param name [String] The job name.
60
+ # @param resource_group_name [String] The resource group name.
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 get_async(device_name, name, resource_group_name, custom_headers:nil)
67
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
68
+ fail ArgumentError, 'name is nil' if name.nil?
69
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
70
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
71
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
72
+
73
+
74
+ request_headers = {}
75
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
76
+
77
+ # Set Headers
78
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
79
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
80
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}'
81
+
82
+ request_url = @base_url || @client.base_url
83
+
84
+ options = {
85
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
86
+ path_params: {'deviceName' => device_name,'name' => name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
87
+ query_params: {'api-version' => @client.api_version},
88
+ headers: request_headers.merge(custom_headers || {}),
89
+ base_url: request_url
90
+ }
91
+ promise = @client.make_request_async(:get, path_template, options)
92
+
93
+ promise = promise.then do |result|
94
+ http_response = result.response
95
+ status_code = http_response.status
96
+ response_content = http_response.body
97
+ unless status_code == 200
98
+ error_model = JSON.load(response_content)
99
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
100
+ end
101
+
102
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
103
+ # Deserialize Response
104
+ if status_code == 200
105
+ begin
106
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
107
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::Job.mapper()
108
+ result.body = @client.deserialize(result_mapper, parsed_response)
109
+ rescue Exception => e
110
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
111
+ end
112
+ end
113
+
114
+ result
115
+ end
116
+
117
+ promise.execute
118
+ end
119
+
120
+ end
121
+ end
@@ -0,0 +1,584 @@
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
+ # Orders
9
+ #
10
+ class Orders
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Orders 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
+ # Lists all the orders related to a data box edge/gateway device.
26
+ #
27
+ # @param device_name [String] The device name.
28
+ # @param resource_group_name [String] The resource group name.
29
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
30
+ # will be added to the HTTP request.
31
+ #
32
+ # @return [Array<Order>] operation results.
33
+ #
34
+ def list_by_data_box_edge_device(device_name, resource_group_name, custom_headers:nil)
35
+ first_page = list_by_data_box_edge_device_as_lazy(device_name, resource_group_name, custom_headers:custom_headers)
36
+ first_page.get_all_items
37
+ end
38
+
39
+ #
40
+ # Lists all the orders related to a data box edge/gateway device.
41
+ #
42
+ # @param device_name [String] The device name.
43
+ # @param resource_group_name [String] The resource group name.
44
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
45
+ # will be added to the HTTP request.
46
+ #
47
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
+ #
49
+ def list_by_data_box_edge_device_with_http_info(device_name, resource_group_name, custom_headers:nil)
50
+ list_by_data_box_edge_device_async(device_name, resource_group_name, custom_headers:custom_headers).value!
51
+ end
52
+
53
+ #
54
+ # Lists all the orders related to a data box edge/gateway device.
55
+ #
56
+ # @param device_name [String] The device name.
57
+ # @param resource_group_name [String] The resource group name.
58
+ # @param [Hash{String => String}] A hash of custom headers that will be added
59
+ # to the HTTP request.
60
+ #
61
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
62
+ #
63
+ def list_by_data_box_edge_device_async(device_name, resource_group_name, custom_headers:nil)
64
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
65
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
66
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
67
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
68
+
69
+
70
+ request_headers = {}
71
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
72
+
73
+ # Set Headers
74
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
75
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
76
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders'
77
+
78
+ request_url = @base_url || @client.base_url
79
+
80
+ options = {
81
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
82
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
83
+ query_params: {'api-version' => @client.api_version},
84
+ headers: request_headers.merge(custom_headers || {}),
85
+ base_url: request_url
86
+ }
87
+ promise = @client.make_request_async(:get, path_template, options)
88
+
89
+ promise = promise.then do |result|
90
+ http_response = result.response
91
+ status_code = http_response.status
92
+ response_content = http_response.body
93
+ unless status_code == 200
94
+ error_model = JSON.load(response_content)
95
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
96
+ end
97
+
98
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
99
+ # Deserialize Response
100
+ if status_code == 200
101
+ begin
102
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
103
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::OrderList.mapper()
104
+ result.body = @client.deserialize(result_mapper, parsed_response)
105
+ rescue Exception => e
106
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
107
+ end
108
+ end
109
+
110
+ result
111
+ end
112
+
113
+ promise.execute
114
+ end
115
+
116
+ #
117
+ # Gets a specific order by name.
118
+ #
119
+ # @param device_name [String] The device name.
120
+ # @param resource_group_name [String] The resource group name.
121
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
122
+ # will be added to the HTTP request.
123
+ #
124
+ # @return [Order] operation results.
125
+ #
126
+ def get(device_name, resource_group_name, custom_headers:nil)
127
+ response = get_async(device_name, resource_group_name, custom_headers:custom_headers).value!
128
+ response.body unless response.nil?
129
+ end
130
+
131
+ #
132
+ # Gets a specific order by name.
133
+ #
134
+ # @param device_name [String] The device name.
135
+ # @param resource_group_name [String] The resource group name.
136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
137
+ # will be added to the HTTP request.
138
+ #
139
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
140
+ #
141
+ def get_with_http_info(device_name, resource_group_name, custom_headers:nil)
142
+ get_async(device_name, resource_group_name, custom_headers:custom_headers).value!
143
+ end
144
+
145
+ #
146
+ # Gets a specific order by name.
147
+ #
148
+ # @param device_name [String] The device name.
149
+ # @param resource_group_name [String] The resource group name.
150
+ # @param [Hash{String => String}] A hash of custom headers that will be added
151
+ # to the HTTP request.
152
+ #
153
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
154
+ #
155
+ def get_async(device_name, resource_group_name, custom_headers:nil)
156
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
157
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
158
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
159
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
160
+
161
+
162
+ request_headers = {}
163
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
164
+
165
+ # Set Headers
166
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
167
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
168
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'
169
+
170
+ request_url = @base_url || @client.base_url
171
+
172
+ options = {
173
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
174
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
175
+ query_params: {'api-version' => @client.api_version},
176
+ headers: request_headers.merge(custom_headers || {}),
177
+ base_url: request_url
178
+ }
179
+ promise = @client.make_request_async(:get, path_template, options)
180
+
181
+ promise = promise.then do |result|
182
+ http_response = result.response
183
+ status_code = http_response.status
184
+ response_content = http_response.body
185
+ unless status_code == 200
186
+ error_model = JSON.load(response_content)
187
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
188
+ end
189
+
190
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
191
+ # Deserialize Response
192
+ if status_code == 200
193
+ begin
194
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
195
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::Order.mapper()
196
+ result.body = @client.deserialize(result_mapper, parsed_response)
197
+ rescue Exception => e
198
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
199
+ end
200
+ end
201
+
202
+ result
203
+ end
204
+
205
+ promise.execute
206
+ end
207
+
208
+ #
209
+ # Creates or updates an order.
210
+ #
211
+ # @param device_name [String] The order details of a device.
212
+ # @param order [Order] The order to be created or updated.
213
+ # @param resource_group_name [String] The resource group name.
214
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
215
+ # will be added to the HTTP request.
216
+ #
217
+ # @return [Order] operation results.
218
+ #
219
+ def create_or_update(device_name, order, resource_group_name, custom_headers:nil)
220
+ response = create_or_update_async(device_name, order, resource_group_name, custom_headers:custom_headers).value!
221
+ response.body unless response.nil?
222
+ end
223
+
224
+ #
225
+ # @param device_name [String] The order details of a device.
226
+ # @param order [Order] The order to be created or updated.
227
+ # @param resource_group_name [String] The resource group name.
228
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
229
+ # will be added to the HTTP request.
230
+ #
231
+ # @return [Concurrent::Promise] promise which provides async access to http
232
+ # response.
233
+ #
234
+ def create_or_update_async(device_name, order, resource_group_name, custom_headers:nil)
235
+ # Send request
236
+ promise = begin_create_or_update_async(device_name, order, resource_group_name, custom_headers:custom_headers)
237
+
238
+ promise = promise.then do |response|
239
+ # Defining deserialization method.
240
+ deserialize_method = lambda do |parsed_response|
241
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::Order.mapper()
242
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
243
+ end
244
+
245
+ # Waiting for response.
246
+ @client.get_long_running_operation_result(response, deserialize_method)
247
+ end
248
+
249
+ promise
250
+ end
251
+
252
+ #
253
+ # Deletes the order related to the device.
254
+ #
255
+ # @param device_name [String] The device name.
256
+ # @param resource_group_name [String] The resource group name.
257
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
258
+ # will be added to the HTTP request.
259
+ #
260
+ def delete(device_name, resource_group_name, custom_headers:nil)
261
+ response = delete_async(device_name, resource_group_name, custom_headers:custom_headers).value!
262
+ nil
263
+ end
264
+
265
+ #
266
+ # @param device_name [String] The device name.
267
+ # @param resource_group_name [String] The resource group name.
268
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
269
+ # will be added to the HTTP request.
270
+ #
271
+ # @return [Concurrent::Promise] promise which provides async access to http
272
+ # response.
273
+ #
274
+ def delete_async(device_name, resource_group_name, custom_headers:nil)
275
+ # Send request
276
+ promise = begin_delete_async(device_name, resource_group_name, custom_headers:custom_headers)
277
+
278
+ promise = promise.then do |response|
279
+ # Defining deserialization method.
280
+ deserialize_method = lambda do |parsed_response|
281
+ end
282
+
283
+ # Waiting for response.
284
+ @client.get_long_running_operation_result(response, deserialize_method)
285
+ end
286
+
287
+ promise
288
+ end
289
+
290
+ #
291
+ # Creates or updates an order.
292
+ #
293
+ # @param device_name [String] The order details of a device.
294
+ # @param order [Order] The order to be created or updated.
295
+ # @param resource_group_name [String] The resource group name.
296
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
297
+ # will be added to the HTTP request.
298
+ #
299
+ # @return [Order] operation results.
300
+ #
301
+ def begin_create_or_update(device_name, order, resource_group_name, custom_headers:nil)
302
+ response = begin_create_or_update_async(device_name, order, resource_group_name, custom_headers:custom_headers).value!
303
+ response.body unless response.nil?
304
+ end
305
+
306
+ #
307
+ # Creates or updates an order.
308
+ #
309
+ # @param device_name [String] The order details of a device.
310
+ # @param order [Order] The order to be created or updated.
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 [MsRestAzure::AzureOperationResponse] HTTP response information.
316
+ #
317
+ def begin_create_or_update_with_http_info(device_name, order, resource_group_name, custom_headers:nil)
318
+ begin_create_or_update_async(device_name, order, resource_group_name, custom_headers:custom_headers).value!
319
+ end
320
+
321
+ #
322
+ # Creates or updates an order.
323
+ #
324
+ # @param device_name [String] The order details of a device.
325
+ # @param order [Order] The order to be created or updated.
326
+ # @param resource_group_name [String] The resource group name.
327
+ # @param [Hash{String => String}] A hash of custom headers that will be added
328
+ # to the HTTP request.
329
+ #
330
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
331
+ #
332
+ def begin_create_or_update_async(device_name, order, resource_group_name, custom_headers:nil)
333
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
334
+ fail ArgumentError, 'order is nil' if order.nil?
335
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
336
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
337
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
338
+
339
+
340
+ request_headers = {}
341
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
342
+
343
+ # Set Headers
344
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
345
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
346
+
347
+ # Serialize Request
348
+ request_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::Order.mapper()
349
+ request_content = @client.serialize(request_mapper, order)
350
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
351
+
352
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'
353
+
354
+ request_url = @base_url || @client.base_url
355
+
356
+ options = {
357
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
358
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
359
+ query_params: {'api-version' => @client.api_version},
360
+ body: request_content,
361
+ headers: request_headers.merge(custom_headers || {}),
362
+ base_url: request_url
363
+ }
364
+ promise = @client.make_request_async(:put, path_template, options)
365
+
366
+ promise = promise.then do |result|
367
+ http_response = result.response
368
+ status_code = http_response.status
369
+ response_content = http_response.body
370
+ unless status_code == 200 || status_code == 202
371
+ error_model = JSON.load(response_content)
372
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
373
+ end
374
+
375
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
376
+ # Deserialize Response
377
+ if status_code == 200
378
+ begin
379
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
380
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::Order.mapper()
381
+ result.body = @client.deserialize(result_mapper, parsed_response)
382
+ rescue Exception => e
383
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
384
+ end
385
+ end
386
+
387
+ result
388
+ end
389
+
390
+ promise.execute
391
+ end
392
+
393
+ #
394
+ # Deletes the order related to the device.
395
+ #
396
+ # @param device_name [String] The device name.
397
+ # @param resource_group_name [String] The resource group name.
398
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
399
+ # will be added to the HTTP request.
400
+ #
401
+ #
402
+ def begin_delete(device_name, resource_group_name, custom_headers:nil)
403
+ response = begin_delete_async(device_name, resource_group_name, custom_headers:custom_headers).value!
404
+ nil
405
+ end
406
+
407
+ #
408
+ # Deletes the order related to the device.
409
+ #
410
+ # @param device_name [String] The device name.
411
+ # @param resource_group_name [String] The resource group name.
412
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
413
+ # will be added to the HTTP request.
414
+ #
415
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
416
+ #
417
+ def begin_delete_with_http_info(device_name, resource_group_name, custom_headers:nil)
418
+ begin_delete_async(device_name, resource_group_name, custom_headers:custom_headers).value!
419
+ end
420
+
421
+ #
422
+ # Deletes the order related to the device.
423
+ #
424
+ # @param device_name [String] The device name.
425
+ # @param resource_group_name [String] The resource group name.
426
+ # @param [Hash{String => String}] A hash of custom headers that will be added
427
+ # to the HTTP request.
428
+ #
429
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
430
+ #
431
+ def begin_delete_async(device_name, resource_group_name, custom_headers:nil)
432
+ fail ArgumentError, 'device_name is nil' if device_name.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
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default'
445
+
446
+ request_url = @base_url || @client.base_url
447
+
448
+ options = {
449
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
450
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
451
+ query_params: {'api-version' => @client.api_version},
452
+ headers: request_headers.merge(custom_headers || {}),
453
+ base_url: request_url
454
+ }
455
+ promise = @client.make_request_async(:delete, path_template, options)
456
+
457
+ promise = promise.then do |result|
458
+ http_response = result.response
459
+ status_code = http_response.status
460
+ response_content = http_response.body
461
+ unless status_code == 200 || status_code == 202 || status_code == 204
462
+ error_model = JSON.load(response_content)
463
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
464
+ end
465
+
466
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
467
+
468
+ result
469
+ end
470
+
471
+ promise.execute
472
+ end
473
+
474
+ #
475
+ # Lists all the orders related to a data box edge/gateway device.
476
+ #
477
+ # @param next_page_link [String] The NextLink from the previous successful call
478
+ # to List operation.
479
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
480
+ # will be added to the HTTP request.
481
+ #
482
+ # @return [OrderList] operation results.
483
+ #
484
+ def list_by_data_box_edge_device_next(next_page_link, custom_headers:nil)
485
+ response = list_by_data_box_edge_device_next_async(next_page_link, custom_headers:custom_headers).value!
486
+ response.body unless response.nil?
487
+ end
488
+
489
+ #
490
+ # Lists all the orders related to a data box edge/gateway device.
491
+ #
492
+ # @param next_page_link [String] The NextLink from the previous successful call
493
+ # to List operation.
494
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
495
+ # will be added to the HTTP request.
496
+ #
497
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
498
+ #
499
+ def list_by_data_box_edge_device_next_with_http_info(next_page_link, custom_headers:nil)
500
+ list_by_data_box_edge_device_next_async(next_page_link, custom_headers:custom_headers).value!
501
+ end
502
+
503
+ #
504
+ # Lists all the orders related to a data box edge/gateway device.
505
+ #
506
+ # @param next_page_link [String] The NextLink from the previous successful call
507
+ # to List operation.
508
+ # @param [Hash{String => String}] A hash of custom headers that will be added
509
+ # to the HTTP request.
510
+ #
511
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
512
+ #
513
+ def list_by_data_box_edge_device_next_async(next_page_link, custom_headers:nil)
514
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
515
+
516
+
517
+ request_headers = {}
518
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
519
+
520
+ # Set Headers
521
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
522
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
523
+ path_template = '{nextLink}'
524
+
525
+ request_url = @base_url || @client.base_url
526
+
527
+ options = {
528
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
529
+ skip_encoding_path_params: {'nextLink' => next_page_link},
530
+ headers: request_headers.merge(custom_headers || {}),
531
+ base_url: request_url
532
+ }
533
+ promise = @client.make_request_async(:get, path_template, options)
534
+
535
+ promise = promise.then do |result|
536
+ http_response = result.response
537
+ status_code = http_response.status
538
+ response_content = http_response.body
539
+ unless status_code == 200
540
+ error_model = JSON.load(response_content)
541
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
542
+ end
543
+
544
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
545
+ # Deserialize Response
546
+ if status_code == 200
547
+ begin
548
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
549
+ result_mapper = Azure::EdgeGateway::Mgmt::V2019_03_01::Models::OrderList.mapper()
550
+ result.body = @client.deserialize(result_mapper, parsed_response)
551
+ rescue Exception => e
552
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
553
+ end
554
+ end
555
+
556
+ result
557
+ end
558
+
559
+ promise.execute
560
+ end
561
+
562
+ #
563
+ # Lists all the orders related to a data box edge/gateway device.
564
+ #
565
+ # @param device_name [String] The device name.
566
+ # @param resource_group_name [String] The resource group name.
567
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
568
+ # will be added to the HTTP request.
569
+ #
570
+ # @return [OrderList] which provide lazy access to pages of the response.
571
+ #
572
+ def list_by_data_box_edge_device_as_lazy(device_name, resource_group_name, custom_headers:nil)
573
+ response = list_by_data_box_edge_device_async(device_name, resource_group_name, custom_headers:custom_headers).value!
574
+ unless response.nil?
575
+ page = response.body
576
+ page.next_method = Proc.new do |next_page_link|
577
+ list_by_data_box_edge_device_next_async(next_page_link, custom_headers:custom_headers)
578
+ end
579
+ page
580
+ end
581
+ end
582
+
583
+ end
584
+ end