# 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_03_01_preview
  module Models
    #
    # A job target, for example a specific database or a container of databases
    # that is evaluated during job execution.
    #
    class JobTarget

      include MsRestAzure

      # @return [JobTargetGroupMembershipType] Whether the target is included
      # or excluded from the group. Possible values include: 'Include',
      # 'Exclude'. Default value: 'Include' .
      attr_accessor :membership_type

      # @return [JobTargetType] The target type. Possible values include:
      # 'TargetGroup', 'SqlDatabase', 'SqlElasticPool', 'SqlShardMap',
      # 'SqlServer'
      attr_accessor :type

      # @return [String] The target server name.
      attr_accessor :server_name

      # @return [String] The target database name.
      attr_accessor :database_name

      # @return [String] The target elastic pool name.
      attr_accessor :elastic_pool_name

      # @return [String] The target shard map.
      attr_accessor :shard_map_name

      # @return [String] The resource ID of the credential that is used during
      # job execution to connect to the target and determine the list of
      # databases inside the target.
      attr_accessor :refresh_credential


      #
      # Mapper for JobTarget class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'JobTarget',
          type: {
            name: 'Composite',
            class_name: 'JobTarget',
            model_properties: {
              membership_type: {
                client_side_validation: true,
                required: false,
                serialized_name: 'membershipType',
                default_value: 'Include',
                type: {
                  name: 'Enum',
                  module: 'JobTargetGroupMembershipType'
                }
              },
              type: {
                client_side_validation: true,
                required: true,
                serialized_name: 'type',
                type: {
                  name: 'String'
                }
              },
              server_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'serverName',
                type: {
                  name: 'String'
                }
              },
              database_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'databaseName',
                type: {
                  name: 'String'
                }
              },
              elastic_pool_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'elasticPoolName',
                type: {
                  name: 'String'
                }
              },
              shard_map_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'shardMapName',
                type: {
                  name: 'String'
                }
              },
              refresh_credential: {
                client_side_validation: true,
                required: false,
                serialized_name: 'refreshCredential',
                type: {
                  name: 'String'
                }
              }
            }
          }
        }
      end
    end
  end
end
