GS2-Notification

Create Client

notification_client = client('notification')

Method

create_notification

response = notification_client:create_notification(request)
if response.isError then
  -- エラー処理 --
  print(response.statusCode)
  print(response.errorMessage)
else
  -- 正常処理 --
  print(response.result)
end

通知を新規作成します

Request

{
  name=string,
  description=string,
}
  • name
  • [string] 通知の名前
  • description
  • [string] 通知の説明

Response

  • item
  • [Notification] 通知

create_subscribe

response = notification_client:create_subscribe(request)
if response.isError then
  -- エラー処理 --
  print(response.statusCode)
  print(response.errorMessage)
else
  -- 正常処理 --
  print(response.result)
end

購読を作成します

Request

{
  notificationName=string,
  endpoint=string,
  type=string,
}
  • notificationName
  • [string] 通知の名前を指定します。
  • endpoint
  • [string] 通知先
  • type
  • [string] 通知に利用する方式

Response

  • item
  • [Subscribe] 購読

delete_notification

response = notification_client:delete_notification(request)
if response.isError then
  -- エラー処理 --
  print(response.statusCode)
  print(response.errorMessage)
else
  -- 正常処理 --
  print(response.result)
end

通知を削除します

Request

{
  notificationName=string,
}
  • notificationName
  • [string] 通知の名前を指定します。

Response

None

delete_subscribe

response = notification_client:delete_subscribe(request)
if response.isError then
  -- エラー処理 --
  print(response.statusCode)
  print(response.errorMessage)
else
  -- 正常処理 --
  print(response.result)
end

購読を削除します

Request

{
  notificationName=string,
  subscribeId=string,
}
  • notificationName
  • [string] 通知の名前を指定します。
  • subscribeId
  • [string] 削除する購読IDを指定します。

Response

None

describe_notification

response = notification_client:describe_notification(request)
if response.isError then
  -- エラー処理 --
  print(response.statusCode)
  print(response.errorMessage)
else
  -- 正常処理 --
  print(response.result)
end

通知の一覧を取得します

Request

{
  pageToken=string,
  limit=number,
}
  • pageToken
  • [string] データの取得を開始する位置を指定するトークン
  • limit
  • [number] データの取得件数

Response

  • nextPageToken
  • [string] 次のページを読み込むためのトークン
  • items
  • [table<Notification>] 通知

describe_subscribe

response = notification_client:describe_subscribe(request)
if response.isError then
  -- エラー処理 --
  print(response.statusCode)
  print(response.errorMessage)
else
  -- 正常処理 --
  print(response.result)
end

購読の一覧を取得します

Request

{
  notificationName=string,
  pageToken=string,
  limit=number,
}
  • notificationName
  • [string] 通知の名前を指定します。
  • pageToken
  • [string] データの取得を開始する位置を指定するトークン
  • limit
  • [number] データの取得件数

Response

  • nextPageToken
  • [string] 次のページを読み込むためのトークン
  • items
  • [table<Subscribe>] 購読

get_notification

response = notification_client:get_notification(request)
if response.isError then
  -- エラー処理 --
  print(response.statusCode)
  print(response.errorMessage)
else
  -- 正常処理 --
  print(response.result)
end

通知を取得します

Request

{
  notificationName=string,
}
  • notificationName
  • [string] 通知の名前を指定します。

Response

  • item
  • [Notification] 通知

get_subscribe

response = notification_client:get_subscribe(request)
if response.isError then
  -- エラー処理 --
  print(response.statusCode)
  print(response.errorMessage)
else
  -- 正常処理 --
  print(response.result)
end

購読を取得します

Request

{
  notificationName=string,
  subscribeId=string,
}
  • notificationName
  • [string] 通知の名前を指定します。
  • subscribeId
  • [string] 取得する購読IDを指定します。

Response

  • item
  • [Subscribe] 購読

update_notification

response = notification_client:update_notification(request)
if response.isError then
  -- エラー処理 --
  print(response.statusCode)
  print(response.errorMessage)
else
  -- 正常処理 --
  print(response.result)
end

通知を更新します

Request

{
  notificationName=string,
  description=string,
}
  • notificationName
  • [string] 通知の名前を指定します。
  • description
  • [string] 通知の説明

Response

  • item
  • [Notification] 通知

Model

Notification

  • createAt
  • [number] 作成日時(エポック秒)
  • name
  • [string] 通知名
  • notificationId
  • [string] 通知GRN
  • ownerId
  • [string] オーナーID
  • updateAt
  • [number] 最終更新日時(エポック秒)
  • description
  • [string] 説明文

Subscribe

  • endpoint
  • [string] type = email: メールアドレス

type = http/https: URL

  • type
  • [string] 通知方法
  • ownerId
  • [string] オーナーID
  • notificationId
  • [string] 通知GRN
  • subscribeId
  • [string] 購読GRN
  • updateAt
  • [number] 最終更新日時(エポック秒)
  • createAt
  • [number] 作成日時(エポック秒)