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.



1894
1895
1896
# File 'lib/google/apis/forms_v1/classes.rb', line 1894

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)


1858
1859
1860
# File 'lib/google/apis/forms_v1/classes.rb', line 1858

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)


1865
1866
1867
# File 'lib/google/apis/forms_v1/classes.rb', line 1865

def error_type
  @error_type
end

#event_typeString

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

Returns:

  • (String)


1870
1871
1872
# File 'lib/google/apis/forms_v1/classes.rb', line 1870

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)


1876
1877
1878
# File 'lib/google/apis/forms_v1/classes.rb', line 1876

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)


1881
1882
1883
# File 'lib/google/apis/forms_v1/classes.rb', line 1881

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)


1887
1888
1889
# File 'lib/google/apis/forms_v1/classes.rb', line 1887

def state
  @state
end

#targetGoogle::Apis::FormsV1::WatchTarget

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



1892
1893
1894
# File 'lib/google/apis/forms_v1/classes.rb', line 1892

def target
  @target
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1899
1900
1901
1902
1903
1904
1905
1906
1907
# File 'lib/google/apis/forms_v1/classes.rb', line 1899

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