azure_mgmt_resources 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +3 -0
- data/.travis.yml +3 -0
- data/Gemfile +14 -0
- data/LICENSE.txt +21 -0
- data/README.md +106 -0
- data/Rakefile +5 -0
- data/azure_mgmt_resources.gemspec +38 -0
- data/lib/azure_mgmt_resources.rb +74 -0
- data/lib/azure_mgmt_resources/Models/basic_dependency.rb +76 -0
- data/lib/azure_mgmt_resources/Models/dependency.rb +105 -0
- data/lib/azure_mgmt_resources/Models/deployment.rb +64 -0
- data/lib/azure_mgmt_resources/Models/deployment_extended.rb +83 -0
- data/lib/azure_mgmt_resources/Models/deployment_extended_filter.rb +58 -0
- data/lib/azure_mgmt_resources/Models/deployment_list_result.rb +88 -0
- data/lib/azure_mgmt_resources/Models/deployment_mode.rb +15 -0
- data/lib/azure_mgmt_resources/Models/deployment_operation.rb +83 -0
- data/lib/azure_mgmt_resources/Models/deployment_operation_properties.rb +102 -0
- data/lib/azure_mgmt_resources/Models/deployment_operations_list_result.rb +88 -0
- data/lib/azure_mgmt_resources/Models/deployment_properties.rb +116 -0
- data/lib/azure_mgmt_resources/Models/deployment_properties_extended.rb +216 -0
- data/lib/azure_mgmt_resources/Models/deployment_validate_result.rb +82 -0
- data/lib/azure_mgmt_resources/Models/generic_resource.rb +103 -0
- data/lib/azure_mgmt_resources/Models/generic_resource_filter.rb +76 -0
- data/lib/azure_mgmt_resources/Models/parameters_link.rb +68 -0
- data/lib/azure_mgmt_resources/Models/plan.rb +85 -0
- data/lib/azure_mgmt_resources/Models/provider.rb +106 -0
- data/lib/azure_mgmt_resources/Models/provider_list_result.rb +87 -0
- data/lib/azure_mgmt_resources/Models/provider_resource_type.rb +88 -0
- data/lib/azure_mgmt_resources/Models/resource_group.rb +105 -0
- data/lib/azure_mgmt_resources/Models/resource_group_extended.rb +113 -0
- data/lib/azure_mgmt_resources/Models/resource_group_extended_filter.rb +63 -0
- data/lib/azure_mgmt_resources/Models/resource_group_filter.rb +67 -0
- data/lib/azure_mgmt_resources/Models/resource_group_format_resource_properties.rb +54 -0
- data/lib/azure_mgmt_resources/Models/resource_group_list_result.rb +88 -0
- data/lib/azure_mgmt_resources/Models/resource_group_properties.rb +58 -0
- data/lib/azure_mgmt_resources/Models/resource_list_result.rb +88 -0
- data/lib/azure_mgmt_resources/Models/resource_management_error.rb +77 -0
- data/lib/azure_mgmt_resources/Models/resource_management_error_with_details.rb +106 -0
- data/lib/azure_mgmt_resources/Models/resource_provider_operation_definition.rb +74 -0
- data/lib/azure_mgmt_resources/Models/resource_provider_operation_detail_list_result.rb +80 -0
- data/lib/azure_mgmt_resources/Models/resource_provider_operation_display_properties.rb +95 -0
- data/lib/azure_mgmt_resources/Models/resources_move_info.rb +67 -0
- data/lib/azure_mgmt_resources/Models/tag_count.rb +67 -0
- data/lib/azure_mgmt_resources/Models/tag_details.rb +112 -0
- data/lib/azure_mgmt_resources/Models/tag_value.rb +82 -0
- data/lib/azure_mgmt_resources/Models/tags_list_result.rb +87 -0
- data/lib/azure_mgmt_resources/Models/target_resource.rb +76 -0
- data/lib/azure_mgmt_resources/Models/template_link.rb +68 -0
- data/lib/azure_mgmt_resources/deployment_operations.rb +297 -0
- data/lib/azure_mgmt_resources/deployments.rb +601 -0
- data/lib/azure_mgmt_resources/module_definition.rb +6 -0
- data/lib/azure_mgmt_resources/providers.rb +461 -0
- data/lib/azure_mgmt_resources/resource_groups.rb +891 -0
- data/lib/azure_mgmt_resources/resource_management_client.rb +85 -0
- data/lib/azure_mgmt_resources/resource_provider_operation_details.rb +126 -0
- data/lib/azure_mgmt_resources/resources.rb +737 -0
- data/lib/azure_mgmt_resources/tags.rb +546 -0
- data/lib/azure_mgmt_resources/version.rb +6 -0
- metadata +235 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bdc702845014bce0e6d43808d03d714853126812
|
4
|
+
data.tar.gz: 31e78f0b2a51ca61074f305092accea37a80b720
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cceaadb4a910c71ef0cd7c2591bbf4f600a4978e1e4bdafd2e8720fd18cbb9aea6593108f0c23915557369996955434d6ea5c6346e36b24c32892ee26060d563
|
7
|
+
data.tar.gz: 0b31ff3cd4f1d79e4966a66b02f0f93efa6e62cec0e7158eb2711247ae748639df992fb3a752361c4af3a5aa654c357eb4388a317265c45daff2cf1d8cafacbc
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
4
|
+
|
5
|
+
source 'https://rubygems.org'
|
6
|
+
|
7
|
+
gemspec
|
8
|
+
|
9
|
+
group :development do
|
10
|
+
end
|
11
|
+
|
12
|
+
group :test do
|
13
|
+
gem 'rspec'
|
14
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Microsoft Corporation
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
# Intro
|
2
|
+
|
3
|
+
This project provides a Ruby gem for easy access to the Azure ARM Resources API. With this gem you can create/update/list/delete resources, resource groups, resource providers and deployments.
|
4
|
+
|
5
|
+
# Supported Ruby Versions
|
6
|
+
|
7
|
+
* Ruby 2+
|
8
|
+
|
9
|
+
Note: x64 Ruby for Windows is known to have some compatibility issues.
|
10
|
+
|
11
|
+
# Getting started
|
12
|
+
|
13
|
+
## Setting up the service principal
|
14
|
+
|
15
|
+
First of all to start interacting with the ARM resources you will need to setup a service principal. Service principal is an Azure application which allows you to authenticate to Azure and access Azure services. The detailed steps of how to setup a service principal can be found in this article: http://aka.ms/cli-service-principal. In the result of setting up service principal you will get tenant id, client id and client secret data.
|
16
|
+
|
17
|
+
## Installation
|
18
|
+
|
19
|
+
install the appropriate gem:
|
20
|
+
|
21
|
+
```
|
22
|
+
gem install azure_mgmt_resources
|
23
|
+
```
|
24
|
+
|
25
|
+
and reference it in your code:
|
26
|
+
|
27
|
+
```Ruby
|
28
|
+
require 'azure_mgmt_resources'
|
29
|
+
```
|
30
|
+
|
31
|
+
After that you should be ready to start using SDK!
|
32
|
+
|
33
|
+
## Authentication
|
34
|
+
|
35
|
+
```Ruby
|
36
|
+
# Create authentication objects
|
37
|
+
token_provider = MsRestAzure::ApplicationTokenProvider.new(tenant_id, client_id, secret)
|
38
|
+
credentials = MsRest::TokenCredentials.new(token_provider)
|
39
|
+
```
|
40
|
+
|
41
|
+
To get tenant_id, client_id and secret for your Azure application visit Azure portal or copy them from the powershell script from the article mentioned above.
|
42
|
+
|
43
|
+
## Creating resource group
|
44
|
+
|
45
|
+
```Ruby
|
46
|
+
# Create a client - a point of access to the API and set the subscription id
|
47
|
+
client = Azure::ARM::Resources::ResourceManagementClient.new(credentials)
|
48
|
+
client.subscription_id = subscription_id
|
49
|
+
|
50
|
+
# Create a model for resource group.
|
51
|
+
resource_group = Azure::ARM::Resources::Models::ResourceGroup.new()
|
52
|
+
resource_group.location = 'westus'
|
53
|
+
|
54
|
+
promise = client.resource_groups.create_or_update('new_test_resource_group', resource_group)
|
55
|
+
```
|
56
|
+
|
57
|
+
The SDK method returns a promise which you can utilize depending on your needs. E.g. if you need to get result immediately via sync blocking call - do the following:
|
58
|
+
|
59
|
+
```Ruby
|
60
|
+
result = promise.value!
|
61
|
+
```
|
62
|
+
|
63
|
+
If you need to follow async flow - provide a block which will be executed in off main thread:
|
64
|
+
|
65
|
+
```Ruby
|
66
|
+
promise = promise.then do |result|
|
67
|
+
# Handle the result
|
68
|
+
end
|
69
|
+
```
|
70
|
+
|
71
|
+
In both cases you're returned an instance of MsRestAzure::AzureOperationResponse which contains HTTP requests/response objects and response body. Response body is a deserialized object representing the received information. In case of code above - newly created resource group. To get data from it:
|
72
|
+
|
73
|
+
```Ruby
|
74
|
+
resource_group = result.body
|
75
|
+
|
76
|
+
p resource_group.name # 'new_test_resource_group'
|
77
|
+
p resource_group.id # the id of resource group
|
78
|
+
```
|
79
|
+
|
80
|
+
Congrats, you've create an ARM resource group. We encourage you to try more stuff and let us know your feedback!
|
81
|
+
|
82
|
+
# Running tests
|
83
|
+
|
84
|
+
## Adding env variables
|
85
|
+
|
86
|
+
To run the tests you would need to set the following environment variables with your real Azure data:
|
87
|
+
|
88
|
+
* azure_tenant_id
|
89
|
+
* azure_client_id
|
90
|
+
* azure_client_secret
|
91
|
+
* subscription_id
|
92
|
+
|
93
|
+
* run_long_tasks - set this to '1' only if you would like to run time consuming tests like VM creation.
|
94
|
+
|
95
|
+
## Starting tests
|
96
|
+
|
97
|
+
Just run 'rspec' command from the current gem folder.
|
98
|
+
|
99
|
+
# Contribution
|
100
|
+
|
101
|
+
All the SDK code was generated by tool 'AutoRest' - https://github.com/Azure/autorest
|
102
|
+
So if you have found a bug or have an idea for a new feature - suggest, discuss and contribute it into the AutoRest repository. After that SDK maintainers will update the sources and the gem.
|
103
|
+
|
104
|
+
# Provide feedback
|
105
|
+
|
106
|
+
Send email to the azsdkteam@microsoft.com or file new issue in this repository.
|
data/Rakefile
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
4
|
+
|
5
|
+
lib = File.expand_path('../lib', __FILE__)
|
6
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
7
|
+
|
8
|
+
require 'azure_mgmt_resources/module_definition'
|
9
|
+
require 'azure_mgmt_resources/version'
|
10
|
+
|
11
|
+
Gem::Specification.new do |spec|
|
12
|
+
spec.name = 'azure_mgmt_resources'
|
13
|
+
spec.version = Azure::ARM::Resources::VERSION
|
14
|
+
spec.authors = 'Microsoft Corporation'
|
15
|
+
spec.email = 'azsdkteam@microsoft.com'
|
16
|
+
spec.description = 'Microsoft Azure Resource Management Client Library for Ruby'
|
17
|
+
spec.summary = 'Official ruby client library to consume Microsoft Azure Resource Management services.'
|
18
|
+
spec.homepage = 'http://github.com/azure/azure-sdk-for-ruby'
|
19
|
+
spec.license = 'MIT'
|
20
|
+
|
21
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
spec.bindir = 'bin'
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ['lib']
|
25
|
+
|
26
|
+
spec.required_ruby_version = '>= 1.9.3'
|
27
|
+
|
28
|
+
spec.add_development_dependency 'bundler', '~> 1.9'
|
29
|
+
spec.add_development_dependency 'rake', '~> 10'
|
30
|
+
spec.add_development_dependency 'rspec', '~> 3'
|
31
|
+
spec.add_development_dependency 'dotenv', '~> 2'
|
32
|
+
|
33
|
+
spec.add_runtime_dependency 'json', '~> 1.8'
|
34
|
+
spec.add_runtime_dependency 'concurrent-ruby', ['>= 1.0.0.pre1', '<2']
|
35
|
+
spec.add_runtime_dependency 'faraday', '~> 0.9'
|
36
|
+
spec.add_runtime_dependency 'faraday-cookie_jar', '~> 0.0.6'
|
37
|
+
spec.add_runtime_dependency 'ms_rest_azure', '~> 0.1'
|
38
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
|
7
|
+
require 'uri'
|
8
|
+
require 'cgi'
|
9
|
+
require 'date'
|
10
|
+
require 'json'
|
11
|
+
require 'base64'
|
12
|
+
require 'erb'
|
13
|
+
require 'securerandom'
|
14
|
+
require 'time'
|
15
|
+
require 'timeliness'
|
16
|
+
require 'faraday'
|
17
|
+
require 'faraday-cookie_jar'
|
18
|
+
require 'concurrent'
|
19
|
+
require 'ms_rest'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
require 'azure_mgmt_resources/module_definition'
|
23
|
+
require 'azure_mgmt_resources/version'
|
24
|
+
|
25
|
+
module Azure::ARM::Resources
|
26
|
+
autoload :Providers, 'azure_mgmt_resources/providers.rb'
|
27
|
+
autoload :ResourceGroups, 'azure_mgmt_resources/resource_groups.rb'
|
28
|
+
autoload :Resources, 'azure_mgmt_resources/resources.rb'
|
29
|
+
autoload :Tags, 'azure_mgmt_resources/tags.rb'
|
30
|
+
autoload :DeploymentOperations, 'azure_mgmt_resources/deployment_operations.rb'
|
31
|
+
autoload :ResourceProviderOperationDetails, 'azure_mgmt_resources/resource_provider_operation_details.rb'
|
32
|
+
autoload :Deployments, 'azure_mgmt_resources/deployments.rb'
|
33
|
+
autoload :ResourceManagementClient, 'azure_mgmt_resources/resource_management_client.rb'
|
34
|
+
|
35
|
+
module Models
|
36
|
+
autoload :DeploymentExtendedFilter, 'azure_mgmt_resources/models/deployment_extended_filter.rb'
|
37
|
+
autoload :GenericResourceFilter, 'azure_mgmt_resources/models/generic_resource_filter.rb'
|
38
|
+
autoload :ResourceGroupFilter, 'azure_mgmt_resources/models/resource_group_filter.rb'
|
39
|
+
autoload :ProviderResourceType, 'azure_mgmt_resources/models/provider_resource_type.rb'
|
40
|
+
autoload :Provider, 'azure_mgmt_resources/models/provider.rb'
|
41
|
+
autoload :ProviderListResult, 'azure_mgmt_resources/models/provider_list_result.rb'
|
42
|
+
autoload :Plan, 'azure_mgmt_resources/models/plan.rb'
|
43
|
+
autoload :ResourceListResult, 'azure_mgmt_resources/models/resource_list_result.rb'
|
44
|
+
autoload :ResourceGroupProperties, 'azure_mgmt_resources/models/resource_group_properties.rb'
|
45
|
+
autoload :ResourceGroup, 'azure_mgmt_resources/models/resource_group.rb'
|
46
|
+
autoload :ResourceGroupListResult, 'azure_mgmt_resources/models/resource_group_list_result.rb'
|
47
|
+
autoload :ResourcesMoveInfo, 'azure_mgmt_resources/models/resources_move_info.rb'
|
48
|
+
autoload :TagCount, 'azure_mgmt_resources/models/tag_count.rb'
|
49
|
+
autoload :TagValue, 'azure_mgmt_resources/models/tag_value.rb'
|
50
|
+
autoload :TagDetails, 'azure_mgmt_resources/models/tag_details.rb'
|
51
|
+
autoload :TagsListResult, 'azure_mgmt_resources/models/tags_list_result.rb'
|
52
|
+
autoload :TargetResource, 'azure_mgmt_resources/models/target_resource.rb'
|
53
|
+
autoload :DeploymentOperationProperties, 'azure_mgmt_resources/models/deployment_operation_properties.rb'
|
54
|
+
autoload :DeploymentOperation, 'azure_mgmt_resources/models/deployment_operation.rb'
|
55
|
+
autoload :DeploymentOperationsListResult, 'azure_mgmt_resources/models/deployment_operations_list_result.rb'
|
56
|
+
autoload :ResourceProviderOperationDisplayProperties, 'azure_mgmt_resources/models/resource_provider_operation_display_properties.rb'
|
57
|
+
autoload :ResourceProviderOperationDefinition, 'azure_mgmt_resources/models/resource_provider_operation_definition.rb'
|
58
|
+
autoload :ResourceProviderOperationDetailListResult, 'azure_mgmt_resources/models/resource_provider_operation_detail_list_result.rb'
|
59
|
+
autoload :TemplateLink, 'azure_mgmt_resources/models/template_link.rb'
|
60
|
+
autoload :ParametersLink, 'azure_mgmt_resources/models/parameters_link.rb'
|
61
|
+
autoload :DeploymentProperties, 'azure_mgmt_resources/models/deployment_properties.rb'
|
62
|
+
autoload :Deployment, 'azure_mgmt_resources/models/deployment.rb'
|
63
|
+
autoload :ResourceManagementError, 'azure_mgmt_resources/models/resource_management_error.rb'
|
64
|
+
autoload :ResourceManagementErrorWithDetails, 'azure_mgmt_resources/models/resource_management_error_with_details.rb'
|
65
|
+
autoload :BasicDependency, 'azure_mgmt_resources/models/basic_dependency.rb'
|
66
|
+
autoload :Dependency, 'azure_mgmt_resources/models/dependency.rb'
|
67
|
+
autoload :DeploymentPropertiesExtended, 'azure_mgmt_resources/models/deployment_properties_extended.rb'
|
68
|
+
autoload :DeploymentValidateResult, 'azure_mgmt_resources/models/deployment_validate_result.rb'
|
69
|
+
autoload :DeploymentExtended, 'azure_mgmt_resources/models/deployment_extended.rb'
|
70
|
+
autoload :DeploymentListResult, 'azure_mgmt_resources/models/deployment_list_result.rb'
|
71
|
+
autoload :GenericResource, 'azure_mgmt_resources/models/generic_resource.rb'
|
72
|
+
autoload :DeploymentMode, 'azure_mgmt_resources/models/deployment_mode.rb'
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ARM::Resources
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Deployment dependency information.
|
10
|
+
#
|
11
|
+
class BasicDependency
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [String] Gets or sets the ID of the dependency.
|
16
|
+
attr_accessor :id
|
17
|
+
|
18
|
+
# @return [String] Gets or sets the dependency resource type.
|
19
|
+
attr_accessor :resource_type
|
20
|
+
|
21
|
+
# @return [String] Gets or sets the dependency resource name.
|
22
|
+
attr_accessor :resource_name
|
23
|
+
|
24
|
+
#
|
25
|
+
# Validate the object. Throws ValidationError if validation fails.
|
26
|
+
#
|
27
|
+
def validate
|
28
|
+
# Nothing to validate
|
29
|
+
end
|
30
|
+
|
31
|
+
#
|
32
|
+
# Serializes given Model object into Ruby Hash.
|
33
|
+
# @param object Model object to serialize.
|
34
|
+
# @return [Hash] Serialized object in form of Ruby Hash.
|
35
|
+
#
|
36
|
+
def self.serialize_object(object)
|
37
|
+
object.validate
|
38
|
+
output_object = {}
|
39
|
+
|
40
|
+
serialized_property = object.id
|
41
|
+
output_object['id'] = serialized_property unless serialized_property.nil?
|
42
|
+
|
43
|
+
serialized_property = object.resource_type
|
44
|
+
output_object['resourceType'] = serialized_property unless serialized_property.nil?
|
45
|
+
|
46
|
+
serialized_property = object.resource_name
|
47
|
+
output_object['resourceName'] = serialized_property unless serialized_property.nil?
|
48
|
+
|
49
|
+
output_object
|
50
|
+
end
|
51
|
+
|
52
|
+
#
|
53
|
+
# Deserializes given Ruby Hash into Model object.
|
54
|
+
# @param object [Hash] Ruby Hash object to deserialize.
|
55
|
+
# @return [BasicDependency] Deserialized object.
|
56
|
+
#
|
57
|
+
def self.deserialize_object(object)
|
58
|
+
return if object.nil?
|
59
|
+
output_object = BasicDependency.new
|
60
|
+
|
61
|
+
deserialized_property = object['id']
|
62
|
+
output_object.id = deserialized_property
|
63
|
+
|
64
|
+
deserialized_property = object['resourceType']
|
65
|
+
output_object.resource_type = deserialized_property
|
66
|
+
|
67
|
+
deserialized_property = object['resourceName']
|
68
|
+
output_object.resource_name = deserialized_property
|
69
|
+
|
70
|
+
output_object.validate
|
71
|
+
|
72
|
+
output_object
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.11.0.0
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::ARM::Resources
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Deployment dependency information.
|
10
|
+
#
|
11
|
+
class Dependency
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return [Array<BasicDependency>] Gets the list of dependencies.
|
16
|
+
attr_accessor :depends_on
|
17
|
+
|
18
|
+
# @return [String] Gets or sets the ID of the dependency.
|
19
|
+
attr_accessor :id
|
20
|
+
|
21
|
+
# @return [String] Gets or sets the dependency resource type.
|
22
|
+
attr_accessor :resource_type
|
23
|
+
|
24
|
+
# @return [String] Gets or sets the dependency resource name.
|
25
|
+
attr_accessor :resource_name
|
26
|
+
|
27
|
+
#
|
28
|
+
# Validate the object. Throws ValidationError if validation fails.
|
29
|
+
#
|
30
|
+
def validate
|
31
|
+
@depends_on.each{ |e| e.validate if e.respond_to?(:validate) } unless @depends_on.nil?
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
# Serializes given Model object into Ruby Hash.
|
36
|
+
# @param object Model object to serialize.
|
37
|
+
# @return [Hash] Serialized object in form of Ruby Hash.
|
38
|
+
#
|
39
|
+
def self.serialize_object(object)
|
40
|
+
object.validate
|
41
|
+
output_object = {}
|
42
|
+
|
43
|
+
serialized_property = object.depends_on
|
44
|
+
unless serialized_property.nil?
|
45
|
+
serializedArray = []
|
46
|
+
serialized_property.each do |element|
|
47
|
+
unless element.nil?
|
48
|
+
element = BasicDependency.serialize_object(element)
|
49
|
+
end
|
50
|
+
serializedArray.push(element)
|
51
|
+
end
|
52
|
+
serialized_property = serializedArray
|
53
|
+
end
|
54
|
+
output_object['dependsOn'] = serialized_property unless serialized_property.nil?
|
55
|
+
|
56
|
+
serialized_property = object.id
|
57
|
+
output_object['id'] = serialized_property unless serialized_property.nil?
|
58
|
+
|
59
|
+
serialized_property = object.resource_type
|
60
|
+
output_object['resourceType'] = serialized_property unless serialized_property.nil?
|
61
|
+
|
62
|
+
serialized_property = object.resource_name
|
63
|
+
output_object['resourceName'] = serialized_property unless serialized_property.nil?
|
64
|
+
|
65
|
+
output_object
|
66
|
+
end
|
67
|
+
|
68
|
+
#
|
69
|
+
# Deserializes given Ruby Hash into Model object.
|
70
|
+
# @param object [Hash] Ruby Hash object to deserialize.
|
71
|
+
# @return [Dependency] Deserialized object.
|
72
|
+
#
|
73
|
+
def self.deserialize_object(object)
|
74
|
+
return if object.nil?
|
75
|
+
output_object = Dependency.new
|
76
|
+
|
77
|
+
deserialized_property = object['dependsOn']
|
78
|
+
unless deserialized_property.nil?
|
79
|
+
deserializedArray = [];
|
80
|
+
deserialized_property.each do |element1|
|
81
|
+
unless element1.nil?
|
82
|
+
element1 = BasicDependency.deserialize_object(element1)
|
83
|
+
end
|
84
|
+
deserializedArray.push(element1);
|
85
|
+
end
|
86
|
+
deserialized_property = deserializedArray;
|
87
|
+
end
|
88
|
+
output_object.depends_on = deserialized_property
|
89
|
+
|
90
|
+
deserialized_property = object['id']
|
91
|
+
output_object.id = deserialized_property
|
92
|
+
|
93
|
+
deserialized_property = object['resourceType']
|
94
|
+
output_object.resource_type = deserialized_property
|
95
|
+
|
96
|
+
deserialized_property = object['resourceName']
|
97
|
+
output_object.resource_name = deserialized_property
|
98
|
+
|
99
|
+
output_object.validate
|
100
|
+
|
101
|
+
output_object
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|