azure_mgmt_iot_central 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) 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 +1085 -0
  5. data/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/iot_central_client.rb +134 -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 +104 -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 +215 -0
  21. data/lib/azure_mgmt_iot_central.rb +6 -0
  22. data/lib/module_definition.rb +8 -0
  23. data/lib/profiles/latest/iotcentral_latest_profile_client.rb +40 -0
  24. data/lib/profiles/latest/iotcentral_module_definition.rb +8 -0
  25. data/lib/profiles/latest/modules/iotcentral_profile_module.rb +115 -0
  26. data/lib/version.rb +7 -0
  27. metadata +144 -0
@@ -0,0 +1,134 @@
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
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class IotCentralClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] The subscription identifier.
21
+ attr_accessor :subscription_id
22
+
23
+ # @return [String] The version of the API.
24
+ attr_reader :api_version
25
+
26
+ # @return [String] Gets or sets the preferred language for the response.
27
+ attr_accessor :accept_language
28
+
29
+ # @return [Integer] Gets or sets the retry timeout in seconds for Long
30
+ # Running Operations. Default value is 30.
31
+ attr_accessor :long_running_operation_retry_timeout
32
+
33
+ # @return [Boolean] When set to true a unique x-ms-client-request-id value
34
+ # is generated and included in each request. Default is true.
35
+ attr_accessor :generate_client_request_id
36
+
37
+ # @return [Apps] apps
38
+ attr_reader :apps
39
+
40
+ # @return [Operations] operations
41
+ attr_reader :operations
42
+
43
+ #
44
+ # Creates initializes a new instance of the IotCentralClient class.
45
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
46
+ # @param base_url [String] the base URI of the service.
47
+ # @param options [Array] filters to be applied to the HTTP requests.
48
+ #
49
+ def initialize(credentials = nil, base_url = nil, options = nil)
50
+ super(credentials, options)
51
+ @base_url = base_url || 'https://management.azure.com'
52
+
53
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
54
+ @credentials = credentials
55
+
56
+ @apps = Apps.new(self)
57
+ @operations = Operations.new(self)
58
+ @api_version = '2017-07-01-privatepreview'
59
+ @accept_language = 'en-US'
60
+ @long_running_operation_retry_timeout = 30
61
+ @generate_client_request_id = true
62
+ add_telemetry
63
+ end
64
+
65
+ #
66
+ # Makes a request and returns the body of the response.
67
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
68
+ # @param path [String] the path, relative to {base_url}.
69
+ # @param options [Hash{String=>String}] specifying any request options like :body.
70
+ # @return [Hash{String=>String}] containing the body of the response.
71
+ # Example:
72
+ #
73
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
74
+ # path = "/path"
75
+ # options = {
76
+ # body: request_content,
77
+ # query_params: {'api-version' => '2016-02-01'}
78
+ # }
79
+ # result = @client.make_request(:put, path, options)
80
+ #
81
+ def make_request(method, path, options = {})
82
+ result = make_request_with_http_info(method, path, options)
83
+ result.body unless result.nil?
84
+ end
85
+
86
+ #
87
+ # Makes a request and returns the operation response.
88
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
89
+ # @param path [String] the path, relative to {base_url}.
90
+ # @param options [Hash{String=>String}] specifying any request options like :body.
91
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
92
+ #
93
+ def make_request_with_http_info(method, path, options = {})
94
+ result = make_request_async(method, path, options).value!
95
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
96
+ result
97
+ end
98
+
99
+ #
100
+ # Makes a request asynchronously.
101
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
102
+ # @param path [String] the path, relative to {base_url}.
103
+ # @param options [Hash{String=>String}] specifying any request options like :body.
104
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
105
+ #
106
+ def make_request_async(method, path, options = {})
107
+ fail ArgumentError, 'method is nil' if method.nil?
108
+ fail ArgumentError, 'path is nil' if path.nil?
109
+
110
+ request_url = options[:base_url] || @base_url
111
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
112
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
113
+ end
114
+
115
+ request_headers = @request_headers
116
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
117
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
118
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
119
+
120
+ super(request_url, method, path, options)
121
+ end
122
+
123
+
124
+ private
125
+ #
126
+ # Adds telemetry information.
127
+ #
128
+ def add_telemetry
129
+ sdk_information = 'azure_mgmt_iot_central'
130
+ sdk_information = "#{sdk_information}/0.0.1"
131
+ add_user_agent_information(sdk_information)
132
+ end
133
+ end
134
+ end
@@ -0,0 +1,155 @@
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 IoT Central application.
10
+ #
11
+ class App < Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The ID of the application.
16
+ attr_accessor :application_id
17
+
18
+ # @return [String] The display name of the application.
19
+ attr_accessor :display_name
20
+
21
+ # @return [String] The subdomain of the application.
22
+ attr_accessor :subdomain
23
+
24
+ # @return [String] The ID of the application template, which is a
25
+ # blueprint that defines the characteristics and behaviors of an
26
+ # application. Optional; if not specified, defaults to a blank blueprint
27
+ # and allows the application to be defined from scratch.
28
+ attr_accessor :template
29
+
30
+ # @return [AppSkuInfo] A valid instance SKU.
31
+ attr_accessor :sku
32
+
33
+
34
+ #
35
+ # Mapper for App class as Ruby Hash.
36
+ # This will be used for serialization/deserialization.
37
+ #
38
+ def self.mapper()
39
+ {
40
+ client_side_validation: true,
41
+ required: false,
42
+ serialized_name: 'App',
43
+ type: {
44
+ name: 'Composite',
45
+ class_name: 'App',
46
+ model_properties: {
47
+ id: {
48
+ client_side_validation: true,
49
+ required: false,
50
+ read_only: true,
51
+ serialized_name: 'id',
52
+ type: {
53
+ name: 'String'
54
+ }
55
+ },
56
+ name: {
57
+ client_side_validation: true,
58
+ required: false,
59
+ read_only: true,
60
+ serialized_name: 'name',
61
+ constraints: {
62
+ Pattern: '^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,99}[a-zA-Z0-9]$'
63
+ },
64
+ type: {
65
+ name: 'String'
66
+ }
67
+ },
68
+ type: {
69
+ client_side_validation: true,
70
+ required: false,
71
+ read_only: true,
72
+ serialized_name: 'type',
73
+ type: {
74
+ name: 'String'
75
+ }
76
+ },
77
+ location: {
78
+ client_side_validation: true,
79
+ required: true,
80
+ serialized_name: 'location',
81
+ type: {
82
+ name: 'String'
83
+ }
84
+ },
85
+ tags: {
86
+ client_side_validation: true,
87
+ required: false,
88
+ serialized_name: 'tags',
89
+ type: {
90
+ name: 'Dictionary',
91
+ value: {
92
+ client_side_validation: true,
93
+ required: false,
94
+ serialized_name: 'StringElementType',
95
+ type: {
96
+ name: 'String'
97
+ }
98
+ }
99
+ }
100
+ },
101
+ application_id: {
102
+ client_side_validation: true,
103
+ required: false,
104
+ read_only: true,
105
+ serialized_name: 'properties.applicationId',
106
+ type: {
107
+ name: 'String'
108
+ }
109
+ },
110
+ display_name: {
111
+ client_side_validation: true,
112
+ required: false,
113
+ serialized_name: 'properties.displayName',
114
+ constraints: {
115
+ Pattern: '^.{1,200}$'
116
+ },
117
+ type: {
118
+ name: 'String'
119
+ }
120
+ },
121
+ subdomain: {
122
+ client_side_validation: true,
123
+ required: false,
124
+ serialized_name: 'properties.subdomain',
125
+ constraints: {
126
+ Pattern: '^[a-z0-9-]{1,63}$'
127
+ },
128
+ type: {
129
+ name: 'String'
130
+ }
131
+ },
132
+ template: {
133
+ client_side_validation: true,
134
+ required: false,
135
+ serialized_name: 'properties.template',
136
+ type: {
137
+ name: 'String'
138
+ }
139
+ },
140
+ sku: {
141
+ client_side_validation: true,
142
+ required: true,
143
+ serialized_name: 'sku',
144
+ type: {
145
+ name: 'Composite',
146
+ class_name: 'AppSkuInfo'
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }
152
+ end
153
+ end
154
+ end
155
+ end
@@ -0,0 +1,99 @@
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 Applications with a next link.
10
+ #
11
+ class AppListResult
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [String] The link used to get the next page of IoT Central
17
+ # Applications.
18
+ attr_accessor :next_link
19
+
20
+ # @return [Array<App>] A list of IoT Central Applications.
21
+ attr_accessor :value
22
+
23
+ # return [Proc] with next page method call.
24
+ attr_accessor :next_method
25
+
26
+ #
27
+ # Gets the rest of the items for the request, enabling auto-pagination.
28
+ #
29
+ # @return [Array<App>] operation results.
30
+ #
31
+ def get_all_items
32
+ items = @value
33
+ page = self
34
+ while page.next_link != nil do
35
+ page = page.get_next_page
36
+ items.concat(page.value)
37
+ end
38
+ items
39
+ end
40
+
41
+ #
42
+ # Gets the next page of results.
43
+ #
44
+ # @return [AppListResult] with next page content.
45
+ #
46
+ def get_next_page
47
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
48
+ unless response.nil?
49
+ @next_link = response.body.next_link
50
+ @value = response.body.value
51
+ self
52
+ end
53
+ end
54
+
55
+ #
56
+ # Mapper for AppListResult class as Ruby Hash.
57
+ # This will be used for serialization/deserialization.
58
+ #
59
+ def self.mapper()
60
+ {
61
+ client_side_validation: true,
62
+ required: false,
63
+ serialized_name: 'AppListResult',
64
+ type: {
65
+ name: 'Composite',
66
+ class_name: 'AppListResult',
67
+ model_properties: {
68
+ next_link: {
69
+ client_side_validation: true,
70
+ required: false,
71
+ serialized_name: 'nextLink',
72
+ type: {
73
+ name: 'String'
74
+ }
75
+ },
76
+ value: {
77
+ client_side_validation: true,
78
+ required: false,
79
+ serialized_name: 'value',
80
+ type: {
81
+ name: 'Sequence',
82
+ element: {
83
+ client_side_validation: true,
84
+ required: false,
85
+ serialized_name: 'AppElementType',
86
+ type: {
87
+ name: 'Composite',
88
+ class_name: 'App'
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,74 @@
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 properties indicating whether a given IoT Central application name is
10
+ # available.
11
+ #
12
+ class AppNameAvailabilityInfo
13
+
14
+ include MsRestAzure
15
+
16
+ # @return [Boolean] The value which indicates whether the provided name
17
+ # is available.
18
+ attr_accessor :name_available
19
+
20
+ # @return [AppNameUnavailabilityReason] The reason for unavailability.
21
+ # Possible values include: 'Invalid', 'AlreadyExists'
22
+ attr_accessor :reason
23
+
24
+ # @return [String] The detailed reason message.
25
+ attr_accessor :message
26
+
27
+
28
+ #
29
+ # Mapper for AppNameAvailabilityInfo class as Ruby Hash.
30
+ # This will be used for serialization/deserialization.
31
+ #
32
+ def self.mapper()
33
+ {
34
+ client_side_validation: true,
35
+ required: false,
36
+ serialized_name: 'AppNameAvailabilityInfo',
37
+ type: {
38
+ name: 'Composite',
39
+ class_name: 'AppNameAvailabilityInfo',
40
+ model_properties: {
41
+ name_available: {
42
+ client_side_validation: true,
43
+ required: false,
44
+ read_only: true,
45
+ serialized_name: 'nameAvailable',
46
+ type: {
47
+ name: 'Boolean'
48
+ }
49
+ },
50
+ reason: {
51
+ client_side_validation: true,
52
+ required: false,
53
+ read_only: true,
54
+ serialized_name: 'reason',
55
+ type: {
56
+ name: 'Enum',
57
+ module: 'AppNameUnavailabilityReason'
58
+ }
59
+ },
60
+ message: {
61
+ client_side_validation: true,
62
+ required: false,
63
+ serialized_name: 'message',
64
+ type: {
65
+ name: 'String'
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ end
72
+ end
73
+ end
74
+ end