Class: Google::Apis::MerchantapiPromotionsV1beta::Interval

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/merchantapi_promotions_v1beta/classes.rb,
lib/google/apis/merchantapi_promotions_v1beta/representations.rb,
lib/google/apis/merchantapi_promotions_v1beta/representations.rb

Overview

Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Interval

Returns a new instance of Interval.



420
421
422
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 420

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#end_timeString

Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end. Corresponds to the JSON property endTime

Returns:

  • (String)


412
413
414
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 412

def end_time
  @end_time
end

#start_timeString

Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start. Corresponds to the JSON property startTime

Returns:

  • (String)


418
419
420
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 418

def start_time
  @start_time
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



425
426
427
428
# File 'lib/google/apis/merchantapi_promotions_v1beta/classes.rb', line 425

def update!(**args)
  @end_time = args[:end_time] if args.key?(:end_time)
  @start_time = args[:start_time] if args.key?(:start_time)
end