目录

Class info
public final class Channel extends GenericJson
Notification channel class used to monitor resource changes.

Public Constructor Summary

Constructor name

Channel() 

Constructor for the Channel class.

Public Method Summary

Return typeMethod name
String

getUrl()

Obtains the server URL for receiving notifications sent through the notification channel.

Channel

setUrl (String url)

Sets the server URL for receiving notifications sent through the notification channel.

String

getId()

Obtains the unique ID of the notification channel.

Channel

setId (String id)

Sets the unique ID of the notification channel.

String

getCategory()

Obtains the resource type, which is always api#channel.

Channel

setCategory(String category)

Sets the resource type, which is always api#channel.

String

getResourceId()

Obtains the ID of a resource being monitored on the channel.

Channel

setResourceId (String resourceId) 

Sets the ID of a resource being monitored on the channel.

String

getResourceUri() 

Obtains the version-specific identifier of a resource.

Channel

setResourceUri(String resourceUri) 

Sets the version-specific identifier of a resource.

String

getUserToken()

Obtains an arbitrary string to be sent to the server URL.

Channel

setUserToken (String userToken)

Sets an arbitrary string to be sent to the server URL.

String

getType() 

Obtains the type of the delivery mechanism used for the channel, which is always web_hook.

Channel

setType (String type) 

Sets the type of the delivery mechanism used for the channel, which is always web_hook.

Long

getExpirationTime()

Obtains the date and time when the notification channel expires.

Channel

setExpirationTime(Long expirationTime)

Sets the date and time when the notification channel expires.

Map<String,String>

getParams()

Obtains additional parameters for controlling delivery channel behavior.

Channel

setParams(Map<String,String> params)

Sets additional parameters for controlling delivery channel behavior.

Boolean

getPayload()

Checks whether the payload of the delivery channel is required.

Channel

setPayload(Boolean payload)

Sets whether the payload of the delivery channel is required.

Channel

set(String fieldName, Object value)

Sets the given field value for the given field name.

Channel

clone()

Clones a Channel object.

Public Constructors

constructor
Channel()
Constructs a Channel object.

Public Methods

Method
public String getUrl()
Obtains the server URL for receiving notifications sent through the notification channel.

Return

typedesc
StringServer URL for receiving notifications sent through the notification channel.
Method


public Channel setUrl(String url)

Sets the server URL for receiving notifications sent through the notification channel.

Parameters

Parameter nameParameter desc
urlServer URL for receiving notifications sent through the notification channel. The URL must be an HTTPS URL starting with https://.

Return

typedesc
ChannelA Channel object.
Method


public String getId()

Obtains the unique ID of the notification channel.

Return

typedesc
StringUnique ID of the notification channel.
Method


public Channel setId(String id)

Sets the unique ID of the notification channel.

Parameters

Parameter nameParameter desc
idUnique ID of the notification channel.

Return

typedesc
ChannelA Channel object.
Method


public String getCategory()

Obtains the resource type, which is always api#channel.

Return

typedesc
StringResource type, which is always api#channel.
Method


public Channel setCategory(String category)

Sets the resource type, which is always api#channel.

Parameters

Parameter nameParameter desc
categoryResource type, which is always api#channel.

Return

typedesc
ChannelA Channel object.
Method


public String getResourceId()

Obtains the ID of a resource being monitored on the channel.

Return

typedesc
StringID of a resource being monitored on the channel.
Method


public Channel setResourceId(String resourceId)

Sets the ID of a resource being monitored on the channel.

Parameters

Parameter nameParameter desc
resourceIdID of a resource being monitored on the channel, which is mandatory in the response.

Return

typedesc
ChannelA Channel object.
Method


public String getResourceUri()

Obtains the version-specific identifier of a resource.

Return

typedesc
StringVersion-specific identifier of a resource.
Method


public Channel setResourceUri(String resourceUri)

Sets the version-specific identifier of a resource.

Parameters

Parameter nameParameter desc
resourceUriVersion-specific identifier of a resource, which is mandatory in the response.

Return

typedesc
ChannelA Channel object.
Method


public String getUserToken()

Obtains an arbitrary string to be sent to the server URL.

Return

typedesc
StringArbitrary string to be sent to the server URL.
Method


public Channel setUserToken(String userToken)

Sets an arbitrary string to be sent to the server URL.

Parameters

Parameter nameParameter desc
userTokenArbitrary string. This parameter is optional and is contained in a message callback notification sent to an API caller. You can set this parameter if the callback notification received by an API caller needs to contain userToken information. The value can contain a maximum of 64 characters, including digits and case-insensitive letters.

Return

typedesc
ChannelA Channel object.
Method


public String getType()

Obtains the type of the delivery mechanism used for the channel, which is always web_hook, indicating that callback notifications are sent through webhooks.

Return

typedesc
StringType of the delivery mechanism used for the channel, which is always web_hook, indicating that callback notifications are sent through webhooks.
Method


public Channel setType(String type)

Sets the type of the delivery mechanism used for the channel, which is always web_hook, indicating that callback notifications are sent through webhooks.

Parameters

Parameter nameParameter desc
typeType of the delivery mechanism used for the channel, which is always web_hook, indicating that callback notifications are sent through webhooks.

Return

typedesc
ChannelA Channel object.
Method


public Long getExpirationTime()

Obtains the date and time when the notification channel expires, expressed as a Unix timestamp in milliseconds. The maximum validity period of a file resource is one day, and that of a change resource is one week.

Return

typedesc
LongDate and time when the notification channel expires.
Method


public Channel setExpirationTime (Long expirationTime)

Sets the date and time when the notification channel expires.

Parameters

Parameter nameParameter desc
expirationTimeDate and time when the notification channel expires, expressed as a Unix timestamp in milliseconds. The maximum validity period of a file resource is one day, and that of a change resource is one week. If this parameter is not specified, the validity period of a change resource is one week by default.

Return

typedesc
ChannelA Channel object.
Method


public Map<String,String> getParams()

Obtains additional parameters for controlling delivery channel behavior.

Return

typedesc
Map<String,String>Additional parameters for controlling delivery channel behavior.
Method


public Channel setParams(Map<String,String> params)

Sets additional parameters for controlling delivery channel behavior.

Parameters

Parameter nameParameter desc
paramsAdditional parameters for controlling delivery channel behavior.

Return

typedesc
ChannelA Channel object.
Method


public Boolean getPayload()

Checks whether the payload of the delivery channel is required.

Return

typedesc
BooleanWhether the payload of the delivery channel is required.
Method


public Channel setPayload(Boolean payload)

Sets whether the payload of the delivery channel is required.

Parameters

Parameter nameParameter desc
payloadIndicates whether the payload of the delivery channel is required. The value true indicates that the payload of the delivery channel is required and the value false indicates not.

Return

typedesc
ChannelA Channel object.
Method


public Channel clone()

Clones a Channel object.

Return

typedesc
ChannelA Channel object.
Method


public Channel set(String fieldName,Object value)

Sets the given field value for the given field name.

Parameters

Parameter nameParameter desc
fieldNameField name.
valueField value.

Return

typedesc
ChannelA Channel object.