Sha256: 6987e28e16689f2ac8fb5a5495a5598842a49e8411038e038c20bb60ec7be8ba

Contents?: true

Size: 1.48 KB

Versions: 6

Compression:

Stored size: 1.48 KB

Contents

module Fog
  module Network
    class AzureRM
      # Vpn Client Configuration model class for Network Service
      class VpnClientConfiguration < Fog::Model
        attribute :address_pool
        attribute :root_certificates
        attribute :revoked_certificates

        def self.parse(vpn_client_config)
          hash = {}
          hash['address_pool'] = []
          vpn_client_config.vpn_client_address_pool.each do |address_prefix|
            hash['address_pool'] << address_prefix
          end unless vpn_client_config.vpn_client_address_pool.nil?

          hash['root_certificates'] = []
          vpn_client_config.vpn_client_root_certificates.each do |root_cert|
            root_certificate = Fog::Network::AzureRM::VpnClientRootCertificate.new
            hash['root_certificates'] << root_certificate.merge_attributes(Fog::Network::AzureRM::VpnClientRootCertificate.parse(root_cert))
          end unless vpn_client_config.vpn_client_root_certificates.nil?

          hash['revoked_certificates'] = []
          vpn_client_config.vpn_client_revoked_certificates.each do |revoked_cert|
            revoked_certificate = Fog::Network::AzureRM::VpnClientRevokedCertificate.new
            hash['revoked_certificates'] << revoked_certificate.merge_attributes(Fog::Network::AzureRM::VpnClientRevokedCertificate.parse(revoked_cert))
          end unless vpn_client_config.vpn_client_revoked_certificates.nil?

          hash
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 lib/fog/azurerm/models/network/vpn_client_configuration.rb
fog-azure-rm-0.1.0 lib/fog/azurerm/models/network/vpn_client_configuration.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/models/network/vpn_client_configuration.rb
fog-azure-rm-0.0.8 lib/fog/azurerm/models/network/vpn_client_configuration.rb
fog-azure-rm-0.0.6 lib/fog/azurerm/models/network/vpn_client_configuration.rb
fog-azure-rm-0.0.5 lib/fog/azurerm/models/network/vpn_client_configuration.rb