Sha256: 608b28c49c860a6a2d89ace9f35c488516460899de6c74bc82b8e25b1a39901b

Contents?: true

Size: 1.61 KB

Versions: 46

Compression:

Stored size: 1.61 KB

Contents

module ApiStub
  module Requests
    module Sql
      # Mock class for Firewall Rule
      class FirewallRule
        def self.create_firewall_rule_response(sql_manager_client)
          body = '{
            "id": "{uri-of-firewall-rule}",
            "name": "{rule-name}",
            "type": "{rule-type}",
            "location": "{server-location}",
            "properties": {
              "startIpAddress": "{start-ip-address}",
              "endIpAddress": "{end-ip-address}"
            }
          }'
          firewall_mapper = Azure::ARM::SQL::Models::ServerFirewallRule.mapper
          sql_manager_client.deserialize(firewall_mapper, Fog::JSON.decode(body), 'result.body')
        end

        def self.list_firewall_rule_response(sql_manager_client)
          body = '{
            "value": [{
              "id": "{uri-of-firewall-rule}",
              "name": "{rule-name}",
              "type": "{rule-type}",
              "location": "{server-location}",
              "properties": {
                "startIpAddress": "{start-ip-address}",
                "endIpAddress": "{end-ip-address}"
              }
            }]
          }'
          firewall_mapper = Azure::ARM::SQL::Models::ServerFirewallRuleListResult.mapper
          sql_manager_client.deserialize(firewall_mapper, Fog::JSON.decode(body), 'result.body')
        end

        def self.firewall_rule_hash
          {
            resource_group: 'resource_group',
            server_name: 'server_name',
            name: 'firewall_name',
            start_ip: '10.10.10.01',
            end_ip: '10.10.10.10'
          }
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 4 rubygems

Version Path
fog-azure-rm-0.6.0 test/api_stub/requests/sql/firewall_rule.rb
fog-azure-rm-0.5.3 test/api_stub/requests/sql/firewall_rule.rb
fog-azure-rm-0.5.2 test/api_stub/requests/sql/firewall_rule.rb
far-gem-0.5.6 test/api_stub/requests/sql/firewall_rule.rb
fog-azure-rm-0.5.1 test/api_stub/requests/sql/firewall_rule.rb
far-gem-0.5.5 test/api_stub/requests/sql/firewall_rule.rb
fog-azure-rm-0.5.0 test/api_stub/requests/sql/firewall_rule.rb
far-gem-0.5.4 test/api_stub/requests/sql/firewall_rule.rb
far-gem-0.5.3 test/api_stub/requests/sql/firewall_rule.rb
fog-azure-rm-0.4.9 test/api_stub/requests/sql/firewall_rule.rb
far-gem-0.5.2 test/api_stub/requests/sql/firewall_rule.rb
fog-azure-rm-0.4.8 test/api_stub/requests/sql/firewall_rule.rb
fog-azure-rm-0.4.7 test/api_stub/requests/sql/firewall_rule.rb
fog-azure-rm-0.4.6 test/api_stub/requests/sql/firewall_rule.rb
fog-azure-rm-0.4.5 test/api_stub/requests/sql/firewall_rule.rb
fog-azure-rm-temp-0.0.5 test/api_stub/requests/sql/firewall_rule.rb
fog-azure-rm-0.4.4 test/api_stub/requests/sql/firewall_rule.rb
fog-azure-rm-0.4.3 test/api_stub/requests/sql/firewall_rule.rb
far-gem-0.5.1 test/api_stub/requests/sql/firewall_rule.rb
fog-azure-rm-0.4.2 test/api_stub/requests/sql/firewall_rule.rb