GS2-Script

Create Client

script_client = client('script')

Method

create_script

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

スクリプトを新規作成します

Request

{
  description=string,
  name=string,
  script=string,
}
  • description
  • [string] 説明文
  • name
  • [string] スクリプトの名前
  • script
  • [string] Luaスクリプト

Response

  • item
  • [Script] スクリプト

delete_script

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

スクリプトを削除します

Request

{
  scriptName=string,
}
  • scriptName
  • [string] スクリプトの名前を指定します。

Response

None

describe_script

response = script_client:describe_script(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<Script>] スクリプト

get_script

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

スクリプトを取得します

Request

{
  scriptName=string,
}
  • scriptName
  • [string] スクリプトの名前を指定します。

Response

  • item
  • [Script] スクリプト

update_script

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

スクリプトを更新します

Request

{
  scriptName=string,
  description=string,
  script=string,
}
  • scriptName
  • [string] スクリプトの名前を指定します。
  • description
  • [string] 説明文
  • script
  • [string] Luaスクリプト

Response

  • item
  • [Script] スクリプト

Model

Script

  • scriptId
  • [string] スクリプトGRN
  • createAt
  • [number] 作成日時(エポック秒)
  • name
  • [string] スクリプト名
  • script
  • [string] スクリプトデータ
  • ownerId
  • [string] オーナーID
  • updateAt
  • [number] 最終更新日時(エポック秒)
  • description
  • [string] 説明文