# 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::SQL::Mgmt::V2017_10_01_preview
  module Models
    #
    # An instance failover group.
    #
    class InstanceFailoverGroup < ProxyResource

      include MsRestAzure

      # @return [InstanceFailoverGroupReadWriteEndpoint] Read-write endpoint of
      # the failover group instance.
      attr_accessor :read_write_endpoint

      # @return [InstanceFailoverGroupReadOnlyEndpoint] Read-only endpoint of
      # the failover group instance.
      attr_accessor :read_only_endpoint

      # @return [InstanceFailoverGroupReplicationRole] Local replication role
      # of the failover group instance. Possible values include: 'Primary',
      # 'Secondary'
      attr_accessor :replication_role

      # @return [String] Replication state of the failover group instance.
      attr_accessor :replication_state

      # @return [Array<PartnerRegionInfo>] Partner region information for the
      # failover group.
      attr_accessor :partner_regions

      # @return [Array<ManagedInstancePairInfo>] List of managed instance pairs
      # in the failover group.
      attr_accessor :managed_instance_pairs


      #
      # Mapper for InstanceFailoverGroup class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'InstanceFailoverGroup',
          type: {
            name: 'Composite',
            class_name: 'InstanceFailoverGroup',
            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'
                }
              },
              read_write_endpoint: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.readWriteEndpoint',
                type: {
                  name: 'Composite',
                  class_name: 'InstanceFailoverGroupReadWriteEndpoint'
                }
              },
              read_only_endpoint: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.readOnlyEndpoint',
                type: {
                  name: 'Composite',
                  class_name: 'InstanceFailoverGroupReadOnlyEndpoint'
                }
              },
              replication_role: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.replicationRole',
                type: {
                  name: 'String'
                }
              },
              replication_state: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.replicationState',
                type: {
                  name: 'String'
                }
              },
              partner_regions: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.partnerRegions',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'PartnerRegionInfoElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'PartnerRegionInfo'
                      }
                  }
                }
              },
              managed_instance_pairs: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.managedInstancePairs',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ManagedInstancePairInfoElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'ManagedInstancePairInfo'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end
