# 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::DataFactory::Mgmt::V2017_09_01_preview
  module Models
    #
    # Trigger that schedules pipeline runs for all fixed time interval windows
    # from a start time without gaps and also supports backfill scenarios (when
    # start time is in the past).
    #
    class TumblingWindowTrigger < Trigger

      include MsRestAzure


      def initialize
        @type = "TumblingWindowTrigger"
      end

      attr_accessor :type

      # @return [TriggerPipelineReference] Pipeline for which runs are created
      # when an event is fired for trigger window that is ready.
      attr_accessor :pipeline

      # @return [TumblingWindowFrequency] The frequency of the time windows.
      # Possible values include: 'Minute', 'Hour'
      attr_accessor :frequency

      # @return [Integer] The interval of the time windows. The minimum
      # interval allowed is 15 Minutes.
      attr_accessor :interval

      # @return [DateTime] The start time for the time period for the trigger
      # during which events are fired for windows that are ready. Only UTC time
      # is currently supported.
      attr_accessor :start_time

      # @return [DateTime] The end time for the time period for the trigger
      # during which events are fired for windows that are ready. Only UTC time
      # is currently supported.
      attr_accessor :end_time

      # @return Specifies how long the trigger waits past due time before
      # triggering new run. It doesn't alter window start and end time. The
      # default is 0. Type: string (or Expression with resultType string),
      # pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])).
      attr_accessor :delay

      # @return [Integer] The max number of parallel time windows (ready for
      # execution) for which a new run is triggered.
      attr_accessor :max_concurrency

      # @return [RetryPolicy] Retry policy that will be applied for failed
      # pipeline runs.
      attr_accessor :retry_policy


      #
      # Mapper for TumblingWindowTrigger class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'TumblingWindowTrigger',
          type: {
            name: 'Composite',
            class_name: 'TumblingWindowTrigger',
            model_properties: {
              additional_properties: {
                client_side_validation: true,
                required: false,
                type: {
                  name: 'Dictionary',
                  value: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ObjectElementType',
                      type: {
                        name: 'Object'
                      }
                  }
                }
              },
              description: {
                client_side_validation: true,
                required: false,
                serialized_name: 'description',
                type: {
                  name: 'String'
                }
              },
              runtime_state: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'runtimeState',
                type: {
                  name: 'String'
                }
              },
              type: {
                client_side_validation: true,
                required: true,
                serialized_name: 'type',
                type: {
                  name: 'String'
                }
              },
              pipeline: {
                client_side_validation: true,
                required: true,
                serialized_name: 'pipeline',
                default_value: {},
                type: {
                  name: 'Composite',
                  class_name: 'TriggerPipelineReference'
                }
              },
              frequency: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.frequency',
                type: {
                  name: 'String'
                }
              },
              interval: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.interval',
                type: {
                  name: 'Number'
                }
              },
              start_time: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.startTime',
                type: {
                  name: 'DateTime'
                }
              },
              end_time: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.endTime',
                type: {
                  name: 'DateTime'
                }
              },
              delay: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.delay',
                type: {
                  name: 'Object'
                }
              },
              max_concurrency: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.maxConcurrency',
                constraints: {
                  InclusiveMaximum: 50,
                  InclusiveMinimum: 1
                },
                type: {
                  name: 'Number'
                }
              },
              retry_policy: {
                client_side_validation: true,
                required: false,
                serialized_name: 'typeProperties.retryPolicy',
                type: {
                  name: 'Composite',
                  class_name: 'RetryPolicy'
                }
              }
            }
          }
        }
      end
    end
  end
end
