Class: Google::Apis::FormsV1::Watch

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

Overview

A watch for events for a form. When the designated event happens, a notification will be published to the specified target. The notification's attributes will include a formId key that has the ID of the watched form and an eventType key that has the string of the type. Messages are sent with at- least-once delivery and are only dropped in extraordinary circumstances. Typically all notifications should be reliably delivered within a few seconds; however, in some situations notifications may be delayed. A watch expires seven days after it is created unless it is renewed with watches.renew

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Watch

Returns a new instance of Watch.



1747
1748
1749
# File 'lib/google/apis/forms_v1/classes.rb', line 1747

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

Instance Attribute Details

#create_timeString

Output only. Timestamp of when this was created. Corresponds to the JSON property createTime

Returns:

  • (String)


1711
1712
1713
# File 'lib/google/apis/forms_v1/classes.rb', line 1711

def create_time
  @create_time
end

#error_typeString

Output only. The most recent error type for an attempted delivery. To begin watching the form again a call can be made to watches.renew which also clears this error information. Corresponds to the JSON property errorType

Returns:

  • (String)


1718
1719
1720
# File 'lib/google/apis/forms_v1/classes.rb', line 1718

def error_type
  @error_type
end

#event_typeString

Required. Which event type to watch for. Corresponds to the JSON property eventType

Returns:

  • (String)


1723
1724
1725
# File 'lib/google/apis/forms_v1/classes.rb', line 1723

def event_type
  @event_type
end

#expire_timeString

Output only. Timestamp for when this will expire. Each watches.renew call resets this to seven days in the future. Corresponds to the JSON property expireTime

Returns:

  • (String)


1729
1730
1731
# File 'lib/google/apis/forms_v1/classes.rb', line 1729

def expire_time
  @expire_time
end

#idString

Output only. The ID of this watch. See notes on CreateWatchRequest.watch_id. Corresponds to the JSON property id

Returns:

  • (String)


1734
1735
1736
# File 'lib/google/apis/forms_v1/classes.rb', line 1734

def id
  @id
end

#stateString

Output only. The current state of the watch. Additional details about suspended watches can be found by checking the error_type. Corresponds to the JSON property state

Returns:

  • (String)


1740
1741
1742
# File 'lib/google/apis/forms_v1/classes.rb', line 1740

def state
  @state
end

#targetGoogle::Apis::FormsV1::WatchTarget

The target for notification delivery. Corresponds to the JSON property target



1745
1746
1747
# File 'lib/google/apis/forms_v1/classes.rb', line 1745

def target
  @target
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1752
1753
1754
1755
1756
1757
1758
1759
1760
# File 'lib/google/apis/forms_v1/classes.rb', line 1752

def update!(**args)
  @create_time = args[:create_time] if args.key?(:create_time)
  @error_type = args[:error_type] if args.key?(:error_type)
  @event_type = args[:event_type] if args.key?(:event_type)
  @expire_time = args[:expire_time] if args.key?(:expire_time)
  @id = args[:id] if args.key?(:id)
  @state = args[:state] if args.key?(:state)
  @target = args[:target] if args.key?(:target)
end