Class: Fog::Resources::AzureRM::Provider

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/azurerm/models/resources/provider.rb

Overview

Provider model class

Class Method Summary collapse

Class Method Details

.parse(provider) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fog/azurerm/models/resources/provider.rb', line 11

def self.parse(provider)
  hash = {}
  hash['id'] = provider.id
  hash['namespace'] = provider.namespace
  hash['registration_state'] = provider.registration_state if provider.respond_to?('registration_state')

  hash['resource_types'] = []
  provider.resource_types.each do |provider_resource_type|
    provider_resource_type_obj = Fog::Resources::AzureRM::ProviderResourceType.new
    hash['resource_types'] << provider_resource_type_obj.merge_attributes(Fog::Resources::AzureRM::ProviderResourceType.parse(provider_resource_type))
  end
  hash
end