Class: DeepSecurity::TimeFilter
- Inherits:
-
TransportObject
- Object
- SavonHelper::MappingObject
- SavonHelper::CachingObject
- TransportObject
- DeepSecurity::TimeFilter
- Defined in:
- lib/deepsecurity/transport_objects/time_filter.rb
Overview
Used as search criteria limit the scope of objects returned by time related attributes, such as from, to, or a specific time. If the type is set to EnumTimeFilterType CUSTOM_RANGE, then the rangeFrom and rangeTo property will be required. If the EnumTimeFilterType SPECIFIC_TIME type is set, then the specifiicTime property will be required.
Constant Summary
Constants inherited from SavonHelper::MappingObject
SavonHelper::MappingObject::BLACK_LIST
Instance Attribute Summary collapse
-
#range_from ⇒ DateTime
Time range start to filter computers by.
-
#range_to ⇒ DateTime
Time range end to filter computers by.
-
#specific_time ⇒ DateTime
Specific time to filter computers by.
-
#type ⇒ EnumTimeFilterType
EnumTimeFilterType to filter computers by.
Attributes inherited from SavonHelper::MappingObject
Attributes included from SavonHelper::DSL
High-Level SOAP Wrapper collapse
-
.custom_range(datetime_range) ⇒ TimeFilter
Return a new instance for the given datetime range.
-
.last_24_hours ⇒ TimeFilter
Return a new instance for the last 24 hours.
-
.last_7_days ⇒ TimeFilter
Return a new instance for the last 7 days.
-
.last_day ⇒ TimeFilter
Return a new instance for last day (yesterday 00:00:00UTC-23:59:59UTC).
-
.last_hour ⇒ TimeFilter
Return a new instance for the last hour.
-
.specific_time(datetime) ⇒ TimeFilter
Return a new instance for the given datetime.
-
.specificTime(datetime) ⇒ TimeFilter
deprecated
Deprecated.
Please use #specific_time instead
Methods inherited from TransportObject
Methods inherited from SavonHelper::CachingObject
all_cache_aspects, #cachable?, #cache, cache_aspects, cache_by_aspect, cache_key, #cache_key, from_savon, #store_in_cache
Methods inherited from SavonHelper::MappingObject
all_type_mappings, defined_attributes, from_savon, has_attribute_chain, #initialize, #to_json, #to_s, #to_savon, type_mappings
Methods included from SavonHelper::DSL
#array_boolean_accessor, #array_datetime_accessor, #array_double_accessor, #array_enum_accessor, #array_float__accessor, #array_integer_accessor, #array_ip_address_accessor, #array_object_accessor, #array_string_accessor, #attr_boolean_accessor, #attr_datetime_accessor, #attr_double_accessor, #attr_enum_accessor, #attr_float_accessor, #attr_integer_accessor, #attr_ip_address_accessor, #attr_object_accessor, #attr_string_accessor, #hint_object_accessor
Constructor Details
This class inherits a constructor from SavonHelper::MappingObject
Instance Attribute Details
#range_from ⇒ DateTime
Time range start to filter computers by.
8 9 10 |
# File 'lib/deepsecurity/transport_objects/time_filter.rb', line 8 attr_datetime_accessor :rangeFrom, "Time range start to filter computers by." , :range_from |
#range_to ⇒ DateTime
Time range end to filter computers by.
11 12 13 |
# File 'lib/deepsecurity/transport_objects/time_filter.rb', line 11 attr_datetime_accessor :rangeTo, "Time range end to filter computers by.", :range_to |
#specific_time ⇒ DateTime
Specific time to filter computers by.
14 15 16 |
# File 'lib/deepsecurity/transport_objects/time_filter.rb', line 14 attr_datetime_accessor :specificTime, "Specific time to filter computers by.", :specific_time |
#type ⇒ EnumTimeFilterType
EnumTimeFilterType to filter computers by.
20 21 |
# File 'lib/deepsecurity/transport_objects/time_filter.rb', line 20 attr_enum_accessor :type, EnumTimeFilterType, "EnumTimeFilterType to filter computers by." |
Class Method Details
.custom_range(datetime_range) ⇒ TimeFilter
Return a new instance for the given datetime range.
53 54 55 56 57 58 59 |
# File 'lib/deepsecurity/transport_objects/time_filter.rb', line 53 def self.custom_range(datetime_range) instance = self.new() instance.type = :custom_range instance.range_from = datetime_range.first instance.range_to = datetime_range.last instance end |
.last_24_hours ⇒ TimeFilter
Return a new instance for the last 24 hours.
35 36 37 38 39 |
# File 'lib/deepsecurity/transport_objects/time_filter.rb', line 35 def self.last_24_hours instance = self.new() instance.type = :last_24_hours instance end |
.last_7_days ⇒ TimeFilter
Return a new instance for the last 7 days.
44 45 46 47 48 |
# File 'lib/deepsecurity/transport_objects/time_filter.rb', line 44 def self.last_7_days instance = self.new() instance.type = :last_7_days instance end |
.last_day ⇒ TimeFilter
Return a new instance for last day (yesterday 00:00:00UTC-23:59:59UTC).
82 83 84 |
# File 'lib/deepsecurity/transport_objects/time_filter.rb', line 82 def self.last_day self.custom_range(((Date.today-1).to_time)..((Date.today).to_time-1)) end |
.last_hour ⇒ TimeFilter
Return a new instance for the last hour.
27 28 29 30 31 |
# File 'lib/deepsecurity/transport_objects/time_filter.rb', line 27 def self.last_hour instance = self.new() instance.type = :last_hour instance end |
.specific_time(datetime) ⇒ TimeFilter
Return a new instance for the given datetime.
72 73 74 75 76 77 |
# File 'lib/deepsecurity/transport_objects/time_filter.rb', line 72 def self.specific_time(datetime) instance = self.new() instance.type = :specific_time instance.specific_time = datetime instance end |
.specificTime(datetime) ⇒ TimeFilter
Please use #specific_time instead
Return a new instance for the given datetime.
65 66 67 |
# File 'lib/deepsecurity/transport_objects/time_filter.rb', line 65 def self.specificTime(datetime) self.specific_time(datetime) end |