# 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::Sqlvirtualmachine::Mgmt::V2017_03_01_preview
  module Models
    #
    # A SQL Server availability group listener.
    #
    class AvailabilityGroupListener < ProxyResource

      include MsRestAzure

      # @return [String] Provisioning state to track the async operation
      # status.
      attr_accessor :provisioning_state

      # @return [String] Name of the availability group.
      attr_accessor :availability_group_name

      # @return [Array<LoadBalancerConfiguration>] List of load balancer
      # configurations for an availability group listener.
      attr_accessor :load_balancer_configurations

      # @return [Boolean] Create a default availability group if it does not
      # exist.
      attr_accessor :create_default_availability_group_if_not_exist

      # @return [Integer] Listener port.
      attr_accessor :port


      #
      # Mapper for AvailabilityGroupListener class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'AvailabilityGroupListener',
          type: {
            name: 'Composite',
            class_name: 'AvailabilityGroupListener',
            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'
                }
              },
              provisioning_state: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.provisioningState',
                type: {
                  name: 'String'
                }
              },
              availability_group_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.availabilityGroupName',
                type: {
                  name: 'String'
                }
              },
              load_balancer_configurations: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.loadBalancerConfigurations',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'LoadBalancerConfigurationElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'LoadBalancerConfiguration'
                      }
                  }
                }
              },
              create_default_availability_group_if_not_exist: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.createDefaultAvailabilityGroupIfNotExist',
                type: {
                  name: 'Boolean'
                }
              },
              port: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.port',
                type: {
                  name: 'Number'
                }
              }
            }
          }
        }
      end
    end
  end
end
