Class: AnalyticsOps::Governance::ChangeHistory
- Inherits:
-
Object
- Object
- AnalyticsOps::Governance::ChangeHistory
- Defined in:
- lib/analytics_ops/governance.rb,
sig/analytics_ops.rbs
Overview
Bounded, deidentified Admin API change-history result.
Constant Summary collapse
- EVENT_KEYS =
%w[actor_type change_time changes changes_filtered id].freeze
- CHANGE_KEYS =
%w[action resource].freeze
- MAX_EVENTS =
200- MAX_CHANGES =
1_000
Instance Attribute Summary collapse
-
#events ⇒ Array[record]
readonly
Returns the value of attribute events.
-
#property_id ⇒ String
readonly
Returns the value of attribute property_id.
Instance Method Summary collapse
-
#initialize(property_id:, events:) ⇒ ChangeHistory
constructor
A new instance of ChangeHistory.
- #to_h ⇒ record
Constructor Details
#initialize(property_id:, events:) ⇒ ChangeHistory
Returns a new instance of ChangeHistory.
140 141 142 143 144 145 146 147 148 149 |
# File 'lib/analytics_ops/governance.rb', line 140 def initialize(property_id:, events:) unless property_id.is_a?(String) && property_id.match?(/\A\d{1,50}\z/) && events.is_a?(Array) && events.length <= MAX_EVENTS && events.all? { |event| valid_event?(event) } raise RemoteError, "Change history is invalid" end @property_id = property_id.dup.freeze @events = Canonical.immutable(events) freeze end |
Instance Attribute Details
#events ⇒ Array[record] (readonly)
Returns the value of attribute events.
138 139 140 |
# File 'lib/analytics_ops/governance.rb', line 138 def events @events end |
#property_id ⇒ String (readonly)
Returns the value of attribute property_id.
138 139 140 |
# File 'lib/analytics_ops/governance.rb', line 138 def property_id @property_id end |
Instance Method Details
#to_h ⇒ record
151 152 153 |
# File 'lib/analytics_ops/governance.rb', line 151 def to_h { "experimental" => true, "property_id" => property_id, "events" => events } end |