azure_mgmt_iot_central 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central.rb +42 -0
  4. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/apps.rb +1103 -0
  5. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/iot_central_client.rb +135 -0
  6. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/models/app.rb +155 -0
  7. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/models/app_list_result.rb +99 -0
  8. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/models/app_name_availability_info.rb +74 -0
  9. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/models/app_name_unavailability_reason.rb +16 -0
  10. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/models/app_patch.rb +108 -0
  11. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/models/app_sku.rb +16 -0
  12. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/models/app_sku_info.rb +47 -0
  13. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/models/error_details.rb +71 -0
  14. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/models/operation.rb +60 -0
  15. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/models/operation_display.rb +83 -0
  16. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/models/operation_inputs.rb +47 -0
  17. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/models/operation_list_result.rb +102 -0
  18. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/models/resource.rb +113 -0
  19. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/module_definition.rb +9 -0
  20. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/operations.rb +219 -0
  21. data/lib/2018-09-01/generated/azure_mgmt_iot_central.rb +43 -0
  22. data/lib/2018-09-01/generated/azure_mgmt_iot_central/apps.rb +1402 -0
  23. data/lib/2018-09-01/generated/azure_mgmt_iot_central/iot_central_client.rb +135 -0
  24. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/app.rb +149 -0
  25. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/app_availability_info.rb +73 -0
  26. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/app_list_result.rb +99 -0
  27. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/app_patch.rb +114 -0
  28. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/app_sku.rb +19 -0
  29. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/app_sku_info.rb +47 -0
  30. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/app_template.rb +107 -0
  31. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/app_templates_result.rb +101 -0
  32. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/cloud_error_body.rb +92 -0
  33. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/operation.rb +60 -0
  34. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/operation_display.rb +83 -0
  35. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/operation_inputs.rb +60 -0
  36. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/operation_list_result.rb +102 -0
  37. data/lib/2018-09-01/generated/azure_mgmt_iot_central/models/resource.rb +113 -0
  38. data/lib/2018-09-01/generated/azure_mgmt_iot_central/module_definition.rb +9 -0
  39. data/lib/2018-09-01/generated/azure_mgmt_iot_central/operations.rb +219 -0
  40. data/lib/azure_mgmt_iot_central.rb +7 -0
  41. data/lib/module_definition.rb +8 -0
  42. data/lib/profiles/latest/iotcentral_latest_profile_client.rb +40 -0
  43. data/lib/profiles/latest/iotcentral_module_definition.rb +8 -0
  44. data/lib/profiles/latest/modules/iotcentral_profile_module.rb +119 -0
  45. data/lib/version.rb +7 -0
  46. metadata +163 -0
@@ -0,0 +1,102 @@
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::IotCentral::Mgmt::V2017_07_01_privatepreview
7
+ module Models
8
+ #
9
+ # A list of IoT Central operations. It contains a list of operations and a
10
+ # URL link to get the next set of results.
11
+ #
12
+ class OperationListResult
13
+
14
+ include MsRestAzure
15
+
16
+ include MsRest::JSONable
17
+ # @return [String] The link used to get the next page of IoT Central
18
+ # description objects.
19
+ attr_accessor :next_link
20
+
21
+ # @return [Array<Operation>] A list of operations supported by the
22
+ # Microsoft.IoTCentral resource provider.
23
+ attr_accessor :value
24
+
25
+ # return [Proc] with next page method call.
26
+ attr_accessor :next_method
27
+
28
+ #
29
+ # Gets the rest of the items for the request, enabling auto-pagination.
30
+ #
31
+ # @return [Array<Operation>] operation results.
32
+ #
33
+ def get_all_items
34
+ items = @value
35
+ page = self
36
+ while page.next_link != nil && !page.next_link.strip.empty? do
37
+ page = page.get_next_page
38
+ items.concat(page.value)
39
+ end
40
+ items
41
+ end
42
+
43
+ #
44
+ # Gets the next page of results.
45
+ #
46
+ # @return [OperationListResult] with next page content.
47
+ #
48
+ def get_next_page
49
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
50
+ unless response.nil?
51
+ @next_link = response.body.next_link
52
+ @value = response.body.value
53
+ self
54
+ end
55
+ end
56
+
57
+ #
58
+ # Mapper for OperationListResult class as Ruby Hash.
59
+ # This will be used for serialization/deserialization.
60
+ #
61
+ def self.mapper()
62
+ {
63
+ client_side_validation: true,
64
+ required: false,
65
+ serialized_name: 'OperationListResult',
66
+ type: {
67
+ name: 'Composite',
68
+ class_name: 'OperationListResult',
69
+ model_properties: {
70
+ next_link: {
71
+ client_side_validation: true,
72
+ required: false,
73
+ serialized_name: 'nextLink',
74
+ type: {
75
+ name: 'String'
76
+ }
77
+ },
78
+ value: {
79
+ client_side_validation: true,
80
+ required: false,
81
+ read_only: true,
82
+ serialized_name: 'value',
83
+ type: {
84
+ name: 'Sequence',
85
+ element: {
86
+ client_side_validation: true,
87
+ required: false,
88
+ serialized_name: 'OperationElementType',
89
+ type: {
90
+ name: 'Composite',
91
+ class_name: 'Operation'
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,113 @@
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::IotCentral::Mgmt::V2017_07_01_privatepreview
7
+ module Models
8
+ #
9
+ # The common properties of an ARM resource.
10
+ #
11
+ class Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The ARM resource identifier.
16
+ attr_accessor :id
17
+
18
+ # @return [String] The ARM resource name.
19
+ attr_accessor :name
20
+
21
+ # @return [String] The resource type.
22
+ attr_accessor :type
23
+
24
+ # @return [String] The resource location.
25
+ attr_accessor :location
26
+
27
+ # @return [Hash{String => String}] The resource tags.
28
+ attr_accessor :tags
29
+
30
+
31
+ # @return [String] the name of the resource group of the resource.
32
+ def resource_group
33
+ unless self.id.nil?
34
+ groups = self.id.match(/.+\/resourceGroups\/([^\/]+)\/.+/)
35
+ groups.captures[0].strip if groups
36
+ end
37
+ end
38
+
39
+
40
+ #
41
+ # Mapper for Resource class as Ruby Hash.
42
+ # This will be used for serialization/deserialization.
43
+ #
44
+ def self.mapper()
45
+ {
46
+ client_side_validation: true,
47
+ required: false,
48
+ serialized_name: 'Resource',
49
+ type: {
50
+ name: 'Composite',
51
+ class_name: 'Resource',
52
+ model_properties: {
53
+ id: {
54
+ client_side_validation: true,
55
+ required: false,
56
+ read_only: true,
57
+ serialized_name: 'id',
58
+ type: {
59
+ name: 'String'
60
+ }
61
+ },
62
+ name: {
63
+ client_side_validation: true,
64
+ required: false,
65
+ read_only: true,
66
+ serialized_name: 'name',
67
+ constraints: {
68
+ Pattern: '^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,99}[a-zA-Z0-9]$'
69
+ },
70
+ type: {
71
+ name: 'String'
72
+ }
73
+ },
74
+ type: {
75
+ client_side_validation: true,
76
+ required: false,
77
+ read_only: true,
78
+ serialized_name: 'type',
79
+ type: {
80
+ name: 'String'
81
+ }
82
+ },
83
+ location: {
84
+ client_side_validation: true,
85
+ required: true,
86
+ serialized_name: 'location',
87
+ type: {
88
+ name: 'String'
89
+ }
90
+ },
91
+ tags: {
92
+ client_side_validation: true,
93
+ required: false,
94
+ serialized_name: 'tags',
95
+ type: {
96
+ name: 'Dictionary',
97
+ value: {
98
+ client_side_validation: true,
99
+ required: false,
100
+ serialized_name: 'StringElementType',
101
+ type: {
102
+ name: 'String'
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
108
+ }
109
+ }
110
+ end
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::IotCentral end
8
+ module Azure::IotCentral::Mgmt end
9
+ module Azure::IotCentral::Mgmt::V2017_07_01_privatepreview end
@@ -0,0 +1,219 @@
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::IotCentral::Mgmt::V2017_07_01_privatepreview
7
+ #
8
+ # Use this API to manage IoT Central Applications in your Azure subscription.
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [IotCentralClient] reference to the IotCentralClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Lists all of the available IoT Central application REST API operations.
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [Array<Operation>] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ first_page = list_as_lazy(custom_headers:custom_headers)
34
+ first_page.get_all_items
35
+ end
36
+
37
+ #
38
+ # Lists all of the available IoT Central application REST API operations.
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Lists all of the available IoT Central application REST API operations.
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers:nil)
58
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
+
60
+
61
+ request_headers = {}
62
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
63
+
64
+ # Set Headers
65
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
66
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
67
+ path_template = 'providers/Microsoft.IoTCentral/operations'
68
+
69
+ request_url = @base_url || @client.base_url
70
+
71
+ options = {
72
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
73
+ query_params: {'api-version' => @client.api_version},
74
+ headers: request_headers.merge(custom_headers || {}),
75
+ base_url: request_url
76
+ }
77
+ promise = @client.make_request_async(:get, path_template, options)
78
+
79
+ promise = promise.then do |result|
80
+ http_response = result.response
81
+ status_code = http_response.status
82
+ response_content = http_response.body
83
+ unless status_code == 200
84
+ error_model = JSON.load(response_content)
85
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
86
+ end
87
+
88
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
89
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
90
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
91
+ # Deserialize Response
92
+ if status_code == 200
93
+ begin
94
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
95
+ result_mapper = Azure::IotCentral::Mgmt::V2017_07_01_privatepreview::Models::OperationListResult.mapper()
96
+ result.body = @client.deserialize(result_mapper, parsed_response)
97
+ rescue Exception => e
98
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
99
+ end
100
+ end
101
+
102
+ result
103
+ end
104
+
105
+ promise.execute
106
+ end
107
+
108
+ #
109
+ # Lists all of the available IoT Central application REST API operations.
110
+ #
111
+ # @param next_page_link [String] The NextLink from the previous successful call
112
+ # to List operation.
113
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
114
+ # will be added to the HTTP request.
115
+ #
116
+ # @return [OperationListResult] operation results.
117
+ #
118
+ def list_next(next_page_link, custom_headers:nil)
119
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
120
+ response.body unless response.nil?
121
+ end
122
+
123
+ #
124
+ # Lists all of the available IoT Central application REST API operations.
125
+ #
126
+ # @param next_page_link [String] The NextLink from the previous successful call
127
+ # to List operation.
128
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
129
+ # will be added to the HTTP request.
130
+ #
131
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
132
+ #
133
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
134
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
135
+ end
136
+
137
+ #
138
+ # Lists all of the available IoT Central application REST API operations.
139
+ #
140
+ # @param next_page_link [String] The NextLink from the previous successful call
141
+ # to List operation.
142
+ # @param [Hash{String => String}] A hash of custom headers that will be added
143
+ # to the HTTP request.
144
+ #
145
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
146
+ #
147
+ def list_next_async(next_page_link, custom_headers:nil)
148
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
149
+
150
+
151
+ request_headers = {}
152
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
153
+
154
+ # Set Headers
155
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
156
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
157
+ path_template = '{nextLink}'
158
+
159
+ request_url = @base_url || @client.base_url
160
+
161
+ options = {
162
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
163
+ skip_encoding_path_params: {'nextLink' => next_page_link},
164
+ headers: request_headers.merge(custom_headers || {}),
165
+ base_url: request_url
166
+ }
167
+ promise = @client.make_request_async(:get, path_template, options)
168
+
169
+ promise = promise.then do |result|
170
+ http_response = result.response
171
+ status_code = http_response.status
172
+ response_content = http_response.body
173
+ unless status_code == 200
174
+ error_model = JSON.load(response_content)
175
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
176
+ end
177
+
178
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
179
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
180
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
181
+ # Deserialize Response
182
+ if status_code == 200
183
+ begin
184
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
185
+ result_mapper = Azure::IotCentral::Mgmt::V2017_07_01_privatepreview::Models::OperationListResult.mapper()
186
+ result.body = @client.deserialize(result_mapper, parsed_response)
187
+ rescue Exception => e
188
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
189
+ end
190
+ end
191
+
192
+ result
193
+ end
194
+
195
+ promise.execute
196
+ end
197
+
198
+ #
199
+ # Lists all of the available IoT Central application REST API operations.
200
+ #
201
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
202
+ # will be added to the HTTP request.
203
+ #
204
+ # @return [OperationListResult] which provide lazy access to pages of the
205
+ # response.
206
+ #
207
+ def list_as_lazy(custom_headers:nil)
208
+ response = list_async(custom_headers:custom_headers).value!
209
+ unless response.nil?
210
+ page = response.body
211
+ page.next_method = Proc.new do |next_page_link|
212
+ list_next_async(next_page_link, custom_headers:custom_headers)
213
+ end
214
+ page
215
+ end
216
+ end
217
+
218
+ end
219
+ end
@@ -0,0 +1,43 @@
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
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2018-09-01/generated/azure_mgmt_iot_central/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::IotCentral::Mgmt::V2018_09_01
23
+ autoload :Apps, '2018-09-01/generated/azure_mgmt_iot_central/apps.rb'
24
+ autoload :Operations, '2018-09-01/generated/azure_mgmt_iot_central/operations.rb'
25
+ autoload :IotCentralClient, '2018-09-01/generated/azure_mgmt_iot_central/iot_central_client.rb'
26
+
27
+ module Models
28
+ autoload :AppListResult, '2018-09-01/generated/azure_mgmt_iot_central/models/app_list_result.rb'
29
+ autoload :OperationDisplay, '2018-09-01/generated/azure_mgmt_iot_central/models/operation_display.rb'
30
+ autoload :AppTemplatesResult, '2018-09-01/generated/azure_mgmt_iot_central/models/app_templates_result.rb'
31
+ autoload :AppPatch, '2018-09-01/generated/azure_mgmt_iot_central/models/app_patch.rb'
32
+ autoload :Operation, '2018-09-01/generated/azure_mgmt_iot_central/models/operation.rb'
33
+ autoload :CloudErrorBody, '2018-09-01/generated/azure_mgmt_iot_central/models/cloud_error_body.rb'
34
+ autoload :OperationListResult, '2018-09-01/generated/azure_mgmt_iot_central/models/operation_list_result.rb'
35
+ autoload :AppSkuInfo, '2018-09-01/generated/azure_mgmt_iot_central/models/app_sku_info.rb'
36
+ autoload :OperationInputs, '2018-09-01/generated/azure_mgmt_iot_central/models/operation_inputs.rb'
37
+ autoload :AppAvailabilityInfo, '2018-09-01/generated/azure_mgmt_iot_central/models/app_availability_info.rb'
38
+ autoload :Resource, '2018-09-01/generated/azure_mgmt_iot_central/models/resource.rb'
39
+ autoload :AppTemplate, '2018-09-01/generated/azure_mgmt_iot_central/models/app_template.rb'
40
+ autoload :App, '2018-09-01/generated/azure_mgmt_iot_central/models/app.rb'
41
+ autoload :AppSku, '2018-09-01/generated/azure_mgmt_iot_central/models/app_sku.rb'
42
+ end
43
+ end