azure_mgmt_databoxedge 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-08-01/generated/azure_mgmt_databoxedge.rb +158 -0
  4. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/alerts.rb +328 -0
  5. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/bandwidth_schedules.rb +621 -0
  6. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/containers.rb +771 -0
  7. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/data_box_edge_management_client.rb +191 -0
  8. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/devices.rb +1811 -0
  9. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/jobs.rb +126 -0
  10. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/account_type.rb +16 -0
  11. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/address.rb +112 -0
  12. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/alert.rb +156 -0
  13. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/alert_error_details.rb +71 -0
  14. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/alert_list.rb +100 -0
  15. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/alert_severity.rb +17 -0
  16. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/armbase_model.rb +71 -0
  17. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/asymmetric_encrypted_secret.rb +70 -0
  18. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/authentication.rb +47 -0
  19. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/authentication_type.rb +16 -0
  20. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/azure_container_data_format.rb +17 -0
  21. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/azure_container_info.rb +72 -0
  22. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/bandwidth_schedule.rb +115 -0
  23. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/bandwidth_schedules_list.rb +100 -0
  24. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/client_access_right.rb +59 -0
  25. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/client_permission_type.rb +17 -0
  26. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/contact_details.rb +87 -0
  27. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/container.rb +113 -0
  28. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/container_list.rb +100 -0
  29. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/container_status.rb +19 -0
  30. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/data_box_edge_device.rb +300 -0
  31. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/data_box_edge_device_extended_info.rb +97 -0
  32. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/data_box_edge_device_list.rb +101 -0
  33. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/data_box_edge_device_patch.rb +55 -0
  34. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/data_box_edge_device_status.rb +21 -0
  35. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/data_policy.rb +16 -0
  36. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/day_of_week.rb +21 -0
  37. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/device_type.rb +15 -0
  38. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/download_phase.rb +18 -0
  39. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/encryption_algorithm.rb +17 -0
  40. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/file_event_trigger.rb +115 -0
  41. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/file_source_info.rb +46 -0
  42. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/install_reboot_behavior.rb +17 -0
  43. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/io_tdevice_info.rb +80 -0
  44. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/io_trole.rb +147 -0
  45. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/ipv4config.rb +71 -0
  46. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/ipv6config.rb +71 -0
  47. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/job.rb +242 -0
  48. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/job_error_details.rb +80 -0
  49. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/job_error_item.rb +79 -0
  50. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/job_status.rb +21 -0
  51. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/job_type.rb +20 -0
  52. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/metric_aggregation_type.rb +21 -0
  53. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/metric_category.rb +16 -0
  54. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/metric_dimension_v1.rb +68 -0
  55. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/metric_specification_v1.rb +187 -0
  56. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/metric_unit.rb +22 -0
  57. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/monitoring_status.rb +16 -0
  58. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/mount_point_map.rb +83 -0
  59. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_adapter.rb +229 -0
  60. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_adapter_dhcpstatus.rb +16 -0
  61. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_adapter_position.rb +60 -0
  62. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_adapter_rdmastatus.rb +16 -0
  63. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_adapter_status.rb +16 -0
  64. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_group.rb +17 -0
  65. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/network_settings.rb +83 -0
  66. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/node.rb +152 -0
  67. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/node_list.rb +56 -0
  68. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/node_status.rb +19 -0
  69. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/operation.rb +81 -0
  70. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/operation_display.rb +80 -0
  71. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/operations_list.rb +99 -0
  72. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/order.rb +177 -0
  73. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/order_list.rb +100 -0
  74. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/order_state.rb +28 -0
  75. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/order_status.rb +96 -0
  76. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/periodic_timer_event_trigger.rb +115 -0
  77. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/periodic_timer_source_info.rb +73 -0
  78. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/platform_type.rb +16 -0
  79. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/refresh_details.rb +87 -0
  80. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/resource_type_sku.rb +202 -0
  81. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/role.rb +71 -0
  82. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/role_list.rb +102 -0
  83. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/role_sink_info.rb +46 -0
  84. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/role_status.rb +16 -0
  85. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/role_types.rb +18 -0
  86. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/security_settings.rb +78 -0
  87. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/service_specification.rb +56 -0
  88. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/share.rb +208 -0
  89. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/share_access_protocol.rb +16 -0
  90. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/share_access_right.rb +59 -0
  91. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/share_access_type.rb +17 -0
  92. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/share_list.rb +100 -0
  93. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/share_status.rb +19 -0
  94. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku.rb +61 -0
  95. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_cost.rb +71 -0
  96. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_information_list.rb +68 -0
  97. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_location_info.rb +87 -0
  98. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_name.rb +23 -0
  99. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_restriction.rb +94 -0
  100. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_restriction_info.rb +75 -0
  101. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_restriction_reason_code.rb +16 -0
  102. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sku_tier.rb +15 -0
  103. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/sslstatus.rb +16 -0
  104. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/storage_account.rb +134 -0
  105. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/storage_account_credential.rb +154 -0
  106. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/storage_account_credential_list.rb +100 -0
  107. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/storage_account_list.rb +101 -0
  108. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/storage_account_status.rb +19 -0
  109. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/symmetric_key.rb +48 -0
  110. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/time_grain.rb +22 -0
  111. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/tracking_info.rb +79 -0
  112. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/trigger.rb +71 -0
  113. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/trigger_list.rb +102 -0
  114. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/update_download_progress.rb +108 -0
  115. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/update_install_progress.rb +71 -0
  116. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/update_operation.rb +18 -0
  117. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/update_operation_stage.rb +31 -0
  118. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/update_summary.rb +281 -0
  119. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/upload_certificate_request.rb +58 -0
  120. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/upload_certificate_response.rb +132 -0
  121. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/user.rb +108 -0
  122. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/user_access_right.rb +59 -0
  123. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/user_list.rb +100 -0
  124. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/models/user_type.rb +17 -0
  125. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/module_definition.rb +9 -0
  126. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/nodes.rb +119 -0
  127. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/operations.rb +218 -0
  128. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/operations_status.rb +126 -0
  129. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/orders.rb +594 -0
  130. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/roles.rb +610 -0
  131. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/shares.rb +737 -0
  132. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/skus.rb +117 -0
  133. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/storage_account_credentials.rb +623 -0
  134. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/storage_accounts.rb +615 -0
  135. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/triggers.rb +618 -0
  136. data/lib/2019-08-01/generated/azure_mgmt_databoxedge/users.rb +622 -0
  137. data/lib/azure_mgmt_databoxedge.rb +6 -0
  138. data/lib/module_definition.rb +7 -0
  139. data/lib/profiles/latest/databoxedge_latest_profile_client.rb +40 -0
  140. data/lib/profiles/latest/databoxedge_module_definition.rb +8 -0
  141. data/lib/profiles/latest/modules/databoxedge_profile_module.rb +551 -0
  142. data/lib/version.rb +7 -0
  143. metadata +258 -0
@@ -0,0 +1,618 @@
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::DataBoxEdge::Mgmt::V2019_08_01
7
+ #
8
+ # Triggers
9
+ #
10
+ class Triggers
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Triggers 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 triggers configured in the device.
26
+ #
27
+ # @param device_name [String] The device name.
28
+ # @param resource_group_name [String] The resource group name.
29
+ # @param filter [String] Specify $filter='CustomContextTag eq <tag>' to filter
30
+ # on custom context tag property
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<Trigger>] operation results.
35
+ #
36
+ def list_by_data_box_edge_device(device_name, resource_group_name, filter:nil, custom_headers:nil)
37
+ first_page = list_by_data_box_edge_device_as_lazy(device_name, resource_group_name, filter:filter, custom_headers:custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Lists all the triggers configured in the device.
43
+ #
44
+ # @param device_name [String] The device name.
45
+ # @param resource_group_name [String] The resource group name.
46
+ # @param filter [String] Specify $filter='CustomContextTag eq <tag>' to filter
47
+ # on custom context tag property
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_by_data_box_edge_device_with_http_info(device_name, resource_group_name, filter:nil, custom_headers:nil)
54
+ list_by_data_box_edge_device_async(device_name, resource_group_name, filter:filter, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Lists all the triggers configured in the device.
59
+ #
60
+ # @param device_name [String] The device name.
61
+ # @param resource_group_name [String] The resource group name.
62
+ # @param filter [String] Specify $filter='CustomContextTag eq <tag>' to filter
63
+ # on custom context tag property
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_by_data_box_edge_device_async(device_name, resource_group_name, filter:nil, custom_headers:nil)
70
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
71
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
72
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
73
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
74
+
75
+
76
+ request_headers = {}
77
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
78
+
79
+ # Set Headers
80
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
81
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
82
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers'
83
+
84
+ request_url = @base_url || @client.base_url
85
+
86
+ options = {
87
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
88
+ path_params: {'deviceName' => device_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
89
+ query_params: {'api-version' => @client.api_version,'$filter' => filter},
90
+ headers: request_headers.merge(custom_headers || {}),
91
+ base_url: request_url
92
+ }
93
+ promise = @client.make_request_async(:get, path_template, options)
94
+
95
+ promise = promise.then do |result|
96
+ http_response = result.response
97
+ status_code = http_response.status
98
+ response_content = http_response.body
99
+ unless status_code == 200
100
+ error_model = JSON.load(response_content)
101
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
102
+ end
103
+
104
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
105
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
106
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
107
+ # Deserialize Response
108
+ if status_code == 200
109
+ begin
110
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
111
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::TriggerList.mapper()
112
+ result.body = @client.deserialize(result_mapper, parsed_response)
113
+ rescue Exception => e
114
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
115
+ end
116
+ end
117
+
118
+ result
119
+ end
120
+
121
+ promise.execute
122
+ end
123
+
124
+ #
125
+ # Get a specific trigger by name.
126
+ #
127
+ # @param device_name [String] The device name.
128
+ # @param name [String] The trigger name.
129
+ # @param resource_group_name [String] The resource group name.
130
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
131
+ # will be added to the HTTP request.
132
+ #
133
+ # @return [Trigger] operation results.
134
+ #
135
+ def get(device_name, name, resource_group_name, custom_headers:nil)
136
+ response = get_async(device_name, name, resource_group_name, custom_headers:custom_headers).value!
137
+ response.body unless response.nil?
138
+ end
139
+
140
+ #
141
+ # Get a specific trigger by name.
142
+ #
143
+ # @param device_name [String] The device name.
144
+ # @param name [String] The trigger name.
145
+ # @param resource_group_name [String] The resource group name.
146
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
+ # will be added to the HTTP request.
148
+ #
149
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
150
+ #
151
+ def get_with_http_info(device_name, name, resource_group_name, custom_headers:nil)
152
+ get_async(device_name, name, resource_group_name, custom_headers:custom_headers).value!
153
+ end
154
+
155
+ #
156
+ # Get a specific trigger by name.
157
+ #
158
+ # @param device_name [String] The device name.
159
+ # @param name [String] The trigger name.
160
+ # @param resource_group_name [String] The resource group name.
161
+ # @param [Hash{String => String}] A hash of custom headers that will be added
162
+ # to the HTTP request.
163
+ #
164
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
165
+ #
166
+ def get_async(device_name, name, resource_group_name, custom_headers:nil)
167
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
168
+ fail ArgumentError, 'name is nil' if name.nil?
169
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
170
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
171
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
172
+
173
+
174
+ request_headers = {}
175
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
176
+
177
+ # Set Headers
178
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
179
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
180
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'
181
+
182
+ request_url = @base_url || @client.base_url
183
+
184
+ options = {
185
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
186
+ path_params: {'deviceName' => device_name,'name' => name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
187
+ query_params: {'api-version' => @client.api_version},
188
+ headers: request_headers.merge(custom_headers || {}),
189
+ base_url: request_url
190
+ }
191
+ promise = @client.make_request_async(:get, path_template, options)
192
+
193
+ promise = promise.then do |result|
194
+ http_response = result.response
195
+ status_code = http_response.status
196
+ response_content = http_response.body
197
+ unless status_code == 200
198
+ error_model = JSON.load(response_content)
199
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
200
+ end
201
+
202
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
203
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
204
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
205
+ # Deserialize Response
206
+ if status_code == 200
207
+ begin
208
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
209
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::Trigger.mapper()
210
+ result.body = @client.deserialize(result_mapper, parsed_response)
211
+ rescue Exception => e
212
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
213
+ end
214
+ end
215
+
216
+ result
217
+ end
218
+
219
+ promise.execute
220
+ end
221
+
222
+ #
223
+ # Creates or updates a trigger.
224
+ #
225
+ # @param device_name [String] Creates or updates a trigger
226
+ # @param name [String] The trigger name.
227
+ # @param trigger [Trigger] The trigger.
228
+ # @param resource_group_name [String] The resource group name.
229
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
230
+ # will be added to the HTTP request.
231
+ #
232
+ # @return [Trigger] operation results.
233
+ #
234
+ def create_or_update(device_name, name, trigger, resource_group_name, custom_headers:nil)
235
+ response = create_or_update_async(device_name, name, trigger, resource_group_name, custom_headers:custom_headers).value!
236
+ response.body unless response.nil?
237
+ end
238
+
239
+ #
240
+ # @param device_name [String] Creates or updates a trigger
241
+ # @param name [String] The trigger name.
242
+ # @param trigger [Trigger] The trigger.
243
+ # @param resource_group_name [String] The resource group name.
244
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
245
+ # will be added to the HTTP request.
246
+ #
247
+ # @return [Concurrent::Promise] promise which provides async access to http
248
+ # response.
249
+ #
250
+ def create_or_update_async(device_name, name, trigger, resource_group_name, custom_headers:nil)
251
+ # Send request
252
+ promise = begin_create_or_update_async(device_name, name, trigger, resource_group_name, custom_headers:custom_headers)
253
+
254
+ promise = promise.then do |response|
255
+ # Defining deserialization method.
256
+ deserialize_method = lambda do |parsed_response|
257
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::Trigger.mapper()
258
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
259
+ end
260
+
261
+ # Waiting for response.
262
+ @client.get_long_running_operation_result(response, deserialize_method)
263
+ end
264
+
265
+ promise
266
+ end
267
+
268
+ #
269
+ # Deletes the trigger on the gateway device.
270
+ #
271
+ # @param device_name [String] The device name.
272
+ # @param name [String] The trigger name.
273
+ # @param resource_group_name [String] The resource group name.
274
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
275
+ # will be added to the HTTP request.
276
+ #
277
+ def delete(device_name, name, resource_group_name, custom_headers:nil)
278
+ response = delete_async(device_name, name, resource_group_name, custom_headers:custom_headers).value!
279
+ nil
280
+ end
281
+
282
+ #
283
+ # @param device_name [String] The device name.
284
+ # @param name [String] The trigger name.
285
+ # @param resource_group_name [String] The resource group name.
286
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
287
+ # will be added to the HTTP request.
288
+ #
289
+ # @return [Concurrent::Promise] promise which provides async access to http
290
+ # response.
291
+ #
292
+ def delete_async(device_name, name, resource_group_name, custom_headers:nil)
293
+ # Send request
294
+ promise = begin_delete_async(device_name, name, resource_group_name, custom_headers:custom_headers)
295
+
296
+ promise = promise.then do |response|
297
+ # Defining deserialization method.
298
+ deserialize_method = lambda do |parsed_response|
299
+ end
300
+
301
+ # Waiting for response.
302
+ @client.get_long_running_operation_result(response, deserialize_method)
303
+ end
304
+
305
+ promise
306
+ end
307
+
308
+ #
309
+ # Creates or updates a trigger.
310
+ #
311
+ # @param device_name [String] Creates or updates a trigger
312
+ # @param name [String] The trigger name.
313
+ # @param trigger [Trigger] The trigger.
314
+ # @param resource_group_name [String] The resource group name.
315
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
316
+ # will be added to the HTTP request.
317
+ #
318
+ # @return [Trigger] operation results.
319
+ #
320
+ def begin_create_or_update(device_name, name, trigger, resource_group_name, custom_headers:nil)
321
+ response = begin_create_or_update_async(device_name, name, trigger, resource_group_name, custom_headers:custom_headers).value!
322
+ response.body unless response.nil?
323
+ end
324
+
325
+ #
326
+ # Creates or updates a trigger.
327
+ #
328
+ # @param device_name [String] Creates or updates a trigger
329
+ # @param name [String] The trigger name.
330
+ # @param trigger [Trigger] The trigger.
331
+ # @param resource_group_name [String] The resource group name.
332
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
333
+ # will be added to the HTTP request.
334
+ #
335
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
336
+ #
337
+ def begin_create_or_update_with_http_info(device_name, name, trigger, resource_group_name, custom_headers:nil)
338
+ begin_create_or_update_async(device_name, name, trigger, resource_group_name, custom_headers:custom_headers).value!
339
+ end
340
+
341
+ #
342
+ # Creates or updates a trigger.
343
+ #
344
+ # @param device_name [String] Creates or updates a trigger
345
+ # @param name [String] The trigger name.
346
+ # @param trigger [Trigger] The trigger.
347
+ # @param resource_group_name [String] The resource group name.
348
+ # @param [Hash{String => String}] A hash of custom headers that will be added
349
+ # to the HTTP request.
350
+ #
351
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
352
+ #
353
+ def begin_create_or_update_async(device_name, name, trigger, resource_group_name, custom_headers:nil)
354
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
355
+ fail ArgumentError, 'name is nil' if name.nil?
356
+ fail ArgumentError, 'trigger is nil' if trigger.nil?
357
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
358
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
359
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
360
+
361
+
362
+ request_headers = {}
363
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
364
+
365
+ # Set Headers
366
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
367
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
368
+
369
+ # Serialize Request
370
+ request_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::Trigger.mapper()
371
+ request_content = @client.serialize(request_mapper, trigger)
372
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
373
+
374
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'
375
+
376
+ request_url = @base_url || @client.base_url
377
+
378
+ options = {
379
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
380
+ path_params: {'deviceName' => device_name,'name' => name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
381
+ query_params: {'api-version' => @client.api_version},
382
+ body: request_content,
383
+ headers: request_headers.merge(custom_headers || {}),
384
+ base_url: request_url
385
+ }
386
+ promise = @client.make_request_async(:put, path_template, options)
387
+
388
+ promise = promise.then do |result|
389
+ http_response = result.response
390
+ status_code = http_response.status
391
+ response_content = http_response.body
392
+ unless status_code == 200 || status_code == 202
393
+ error_model = JSON.load(response_content)
394
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
395
+ end
396
+
397
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
398
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
399
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
400
+ # Deserialize Response
401
+ if status_code == 200
402
+ begin
403
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
404
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::Trigger.mapper()
405
+ result.body = @client.deserialize(result_mapper, parsed_response)
406
+ rescue Exception => e
407
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
408
+ end
409
+ end
410
+
411
+ result
412
+ end
413
+
414
+ promise.execute
415
+ end
416
+
417
+ #
418
+ # Deletes the trigger on the gateway device.
419
+ #
420
+ # @param device_name [String] The device name.
421
+ # @param name [String] The trigger name.
422
+ # @param resource_group_name [String] The resource group name.
423
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
424
+ # will be added to the HTTP request.
425
+ #
426
+ #
427
+ def begin_delete(device_name, name, resource_group_name, custom_headers:nil)
428
+ response = begin_delete_async(device_name, name, resource_group_name, custom_headers:custom_headers).value!
429
+ nil
430
+ end
431
+
432
+ #
433
+ # Deletes the trigger on the gateway device.
434
+ #
435
+ # @param device_name [String] The device name.
436
+ # @param name [String] The trigger name.
437
+ # @param resource_group_name [String] The resource group name.
438
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
439
+ # will be added to the HTTP request.
440
+ #
441
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
442
+ #
443
+ def begin_delete_with_http_info(device_name, name, resource_group_name, custom_headers:nil)
444
+ begin_delete_async(device_name, name, resource_group_name, custom_headers:custom_headers).value!
445
+ end
446
+
447
+ #
448
+ # Deletes the trigger on the gateway device.
449
+ #
450
+ # @param device_name [String] The device name.
451
+ # @param name [String] The trigger name.
452
+ # @param resource_group_name [String] The resource group name.
453
+ # @param [Hash{String => String}] A hash of custom headers that will be added
454
+ # to the HTTP request.
455
+ #
456
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
457
+ #
458
+ def begin_delete_async(device_name, name, resource_group_name, custom_headers:nil)
459
+ fail ArgumentError, 'device_name is nil' if device_name.nil?
460
+ fail ArgumentError, 'name is nil' if name.nil?
461
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
462
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
463
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
464
+
465
+
466
+ request_headers = {}
467
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
468
+
469
+ # Set Headers
470
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
471
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
472
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}'
473
+
474
+ request_url = @base_url || @client.base_url
475
+
476
+ options = {
477
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
478
+ path_params: {'deviceName' => device_name,'name' => name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
479
+ query_params: {'api-version' => @client.api_version},
480
+ headers: request_headers.merge(custom_headers || {}),
481
+ base_url: request_url
482
+ }
483
+ promise = @client.make_request_async(:delete, path_template, options)
484
+
485
+ promise = promise.then do |result|
486
+ http_response = result.response
487
+ status_code = http_response.status
488
+ response_content = http_response.body
489
+ unless status_code == 200 || status_code == 202 || status_code == 204
490
+ error_model = JSON.load(response_content)
491
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
492
+ end
493
+
494
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
495
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
496
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
497
+
498
+ result
499
+ end
500
+
501
+ promise.execute
502
+ end
503
+
504
+ #
505
+ # Lists all the triggers configured in the device.
506
+ #
507
+ # @param next_page_link [String] The NextLink from the previous successful call
508
+ # to List operation.
509
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
510
+ # will be added to the HTTP request.
511
+ #
512
+ # @return [TriggerList] operation results.
513
+ #
514
+ def list_by_data_box_edge_device_next(next_page_link, custom_headers:nil)
515
+ response = list_by_data_box_edge_device_next_async(next_page_link, custom_headers:custom_headers).value!
516
+ response.body unless response.nil?
517
+ end
518
+
519
+ #
520
+ # Lists all the triggers configured in the device.
521
+ #
522
+ # @param next_page_link [String] The NextLink from the previous successful call
523
+ # to List operation.
524
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
525
+ # will be added to the HTTP request.
526
+ #
527
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
528
+ #
529
+ def list_by_data_box_edge_device_next_with_http_info(next_page_link, custom_headers:nil)
530
+ list_by_data_box_edge_device_next_async(next_page_link, custom_headers:custom_headers).value!
531
+ end
532
+
533
+ #
534
+ # Lists all the triggers configured in the device.
535
+ #
536
+ # @param next_page_link [String] The NextLink from the previous successful call
537
+ # to List operation.
538
+ # @param [Hash{String => String}] A hash of custom headers that will be added
539
+ # to the HTTP request.
540
+ #
541
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
542
+ #
543
+ def list_by_data_box_edge_device_next_async(next_page_link, custom_headers:nil)
544
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
545
+
546
+
547
+ request_headers = {}
548
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
549
+
550
+ # Set Headers
551
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
552
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
553
+ path_template = '{nextLink}'
554
+
555
+ request_url = @base_url || @client.base_url
556
+
557
+ options = {
558
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
559
+ skip_encoding_path_params: {'nextLink' => next_page_link},
560
+ headers: request_headers.merge(custom_headers || {}),
561
+ base_url: request_url
562
+ }
563
+ promise = @client.make_request_async(:get, path_template, options)
564
+
565
+ promise = promise.then do |result|
566
+ http_response = result.response
567
+ status_code = http_response.status
568
+ response_content = http_response.body
569
+ unless status_code == 200
570
+ error_model = JSON.load(response_content)
571
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
572
+ end
573
+
574
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
575
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
576
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
577
+ # Deserialize Response
578
+ if status_code == 200
579
+ begin
580
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
581
+ result_mapper = Azure::DataBoxEdge::Mgmt::V2019_08_01::Models::TriggerList.mapper()
582
+ result.body = @client.deserialize(result_mapper, parsed_response)
583
+ rescue Exception => e
584
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
585
+ end
586
+ end
587
+
588
+ result
589
+ end
590
+
591
+ promise.execute
592
+ end
593
+
594
+ #
595
+ # Lists all the triggers configured in the device.
596
+ #
597
+ # @param device_name [String] The device name.
598
+ # @param resource_group_name [String] The resource group name.
599
+ # @param filter [String] Specify $filter='CustomContextTag eq <tag>' to filter
600
+ # on custom context tag property
601
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
602
+ # will be added to the HTTP request.
603
+ #
604
+ # @return [TriggerList] which provide lazy access to pages of the response.
605
+ #
606
+ def list_by_data_box_edge_device_as_lazy(device_name, resource_group_name, filter:nil, custom_headers:nil)
607
+ response = list_by_data_box_edge_device_async(device_name, resource_group_name, filter:filter, custom_headers:custom_headers).value!
608
+ unless response.nil?
609
+ page = response.body
610
+ page.next_method = Proc.new do |next_page_link|
611
+ list_by_data_box_edge_device_next_async(next_page_link, custom_headers:custom_headers)
612
+ end
613
+ page
614
+ end
615
+ end
616
+
617
+ end
618
+ end