# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::MariaDB::Mgmt::V2018_06_01
  module Models
    #
    # Represents a server firewall rule.
    #
    class FirewallRule < ProxyResource

      include MsRestAzure

      # @return [String] The start IP address of the server firewall rule. Must
      # be IPv4 format.
      attr_accessor :start_ip_address

      # @return [String] The end IP address of the server firewall rule. Must
      # be IPv4 format.
      attr_accessor :end_ip_address


      #
      # Mapper for FirewallRule class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'FirewallRule',
          type: {
            name: 'Composite',
            class_name: 'FirewallRule',
            model_properties: {
              id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'id',
                type: {
                  name: 'String'
                }
              },
              name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              type: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'type',
                type: {
                  name: 'String'
                }
              },
              start_ip_address: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.startIpAddress',
                constraints: {
                  Pattern: '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'
                },
                type: {
                  name: 'String'
                }
              },
              end_ip_address: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.endIpAddress',
                constraints: {
                  Pattern: '^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$'
                },
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end
