View Source Reydenx.Action (Reyden-X v0.1.2)

Provides access to order statistics methods, methods for changing the status of orders, as well as for checking the status of jobs

Summary

Functions

Change the time of the smooth set of viewers

Change the Number of Viewers

Disable smooth increase of viewers

Enable smooth increase of viewers

Types

@type p() :: pos_integer()
@type t() ::
  {:error,
   %Reydenx.Model.ResponseError{
     message: term(),
     path: term(),
     status_code: term()
   }}
  | {:ok,
     %Reydenx.Model.ActionResult{
       action: term(),
       order_id: term(),
       request_id: term(),
       task: term(),
       value: term()
     }}

Functions

Link to this function

add_views(token, order_id, value)

View Source (since 0.1.0)
@spec add_views(
  token :: %Reydenx.Model.Token{
    access_token: term(),
    expires_in: term(),
    token_type: term()
  },
  order_id :: p(),
  value :: p()
) :: t()

Add Views to Order

API Documentation

Examples:

### Success:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.add_views(token, 123456, 1000)
{:ok, %Reydenx.Model.ActionResult{
  request_id: "",
  order_id: 123456,
  action: "add:views",
  value: nil,
  task: %Reydenx.Model.Task{
    id: "h_Hg_ZWcjqRN2sd9GScBqg",
    url: "https://api.reyden-x.com/v1/orders/123456/task/h_Hg_ZWcjqRN2sd9GScBqg/status/",
    expires_at: "2024-07-09T09:21:29.577065+00:00"
  }
}}

### Fail:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.add_views(token, 123456, 1000)
{:error, %Reydenx.Model.ResponseError{
  path: "/",
  status_code: 404,
  message: "Not Found"
}}
Link to this function

cancel(token, order_id)

View Source (since 0.1.0)
@spec cancel(
  token :: %Reydenx.Model.Token{
    access_token: term(),
    expires_in: term(),
    token_type: term()
  },
  order_id :: p()
) :: t()

Cancel Order

API Documentation

Examples:

### Success:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.cancel(token, 123456)
{:ok, %Reydenx.Model.ActionResult{
  request_id: "",
  order_id: 123456,
  action: "cancel",
  value: nil,
  task: %Reydenx.Model.Task{
    id: "h_Hg_ZWcjqRN2sd9GScBqg",
    url: "https://api.reyden-x.com/v1/orders/123456/task/h_Hg_ZWcjqRN2sd9GScBqg/status/",
    expires_at: "2024-07-09T09:21:29.577065+00:00"
  }
}}

### Fail:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.cancel(token, 123456)
{:error, %Reydenx.Model.ResponseError{
  path: "/",
  status_code: 404,
  message: "Not Found"
}}
Link to this function

change_increase(token, order_id, value)

View Source (since 0.1.0)
@spec change_increase(
  token :: %Reydenx.Model.Token{
    access_token: term(),
    expires_in: term(),
    token_type: term()
  },
  order_id :: p(),
  value :: p()
) :: t()

Change the time of the smooth set of viewers

API Documentation

Examples:

### Success:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.change_increase(token, 123456, 1000)
{:ok, %Reydenx.Model.ActionResult{
  request_id: "",
  order_id: 123456,
  action: "change:increase:value",
  value: nil,
  task: %Reydenx.Model.Task{
    id: "h_Hg_ZWcjqRN2sd9GScBqg",
    url: "https://api.reyden-x.com/v1/orders/123456/task/h_Hg_ZWcjqRN2sd9GScBqg/status/",
    expires_at: "2024-07-09T09:21:29.577065+00:00"
  }
}}

### Fail:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.change_increase(token, 123456, 1000)
{:error, %Reydenx.Model.ResponseError{
  path: "/",
  status_code: 404,
  message: "Not Found"
}}
Link to this function

change_launch_mode(token, order_id, mode)

View Source (since 0.1.1)
@spec change_launch_mode(
  token :: %Reydenx.Model.Token{
    access_token: term(),
    expires_in: term(),
    token_type: term()
  },
  order_id :: p(),
  mode :: :auto | :manual
) :: t()

Change Launch Parameters

API Documentation

Examples:

### Success:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.change_launch_mode(token, 123456, :auto)
{:ok, %Reydenx.Model.ActionResult{
  request_id: "",
  order_id: 123456,
  action: "change:launch",
  value: nil,
  task: %Reydenx.Model.Task{
    id: "h_Hg_ZWcjqRN2sd9GScBqg",
    url: "https://api.reyden-x.com/v1/orders/123456/task/h_Hg_ZWcjqRN2sd9GScBqg/status/",
    expires_at: "2024-07-09T09:21:29.577065+00:00"
  }
}}

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.change_launch_mode(token, 123456, :manual)
{:ok, %Reydenx.Model.ActionResult{
  request_id: "",
  order_id: 123456,
  action: "change:launch",
  value: nil,
  task: %Reydenx.Model.Task{
    id: "h_Hg_ZWcjqRN2sd9GScBqg",
    url: "https://api.reyden-x.com/v1/orders/123456/task/h_Hg_ZWcjqRN2sd9GScBqg/status/",
    expires_at: "2024-07-09T09:21:29.577065+00:00"
  }
}}

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.change_launch_mode(token, 123456, :delay, 60)
{:ok, %Reydenx.Model.ActionResult{
  request_id: "",
  order_id: 123456,
  action: "change:launch",
  value: 60,
  task: %Reydenx.Model.Task{
    id: "h_Hg_ZWcjqRN2sd9GScBqg",
    url: "https://api.reyden-x.com/v1/orders/123456/task/h_Hg_ZWcjqRN2sd9GScBqg/status/",
    expires_at: "2024-07-09T09:21:29.577065+00:00"
  }
}}

### Fail:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.change_launch_mode(token, 123456, :auto)
{:error, %Reydenx.Model.ResponseError{
  path: "/",
  status_code: 404,
  message: "Not Found"
}}
Link to this function

change_launch_mode(token, order_id, mode, delay_time)

View Source (since 0.1.1)
@spec change_launch_mode(
  token :: %Reydenx.Model.Token{
    access_token: term(),
    expires_in: term(),
    token_type: term()
  },
  order_id :: p(),
  mode :: :delay,
  delay_time :: p()
) :: t()
Link to this function

change_online(token, order_id, value)

View Source (since 0.1.0)
@spec change_online(
  token :: %Reydenx.Model.Token{
    access_token: term(),
    expires_in: term(),
    token_type: term()
  },
  order_id :: p(),
  value :: p()
) :: t()

Change the Number of Viewers

API Documentation

Examples:

### Success:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.change_online(token, 123456, 1000)
{:ok, %Reydenx.Model.ActionResult{
  request_id: "",
  order_id: 123456,
  action: "change:online",
  value: nil,
  task: %Reydenx.Model.Task{
    id: "h_Hg_ZWcjqRN2sd9GScBqg",
    url: "https://api.reyden-x.com/v1/orders/123456/task/h_Hg_ZWcjqRN2sd9GScBqg/status/",
    expires_at: "2024-07-09T09:21:29.577065+00:00"
  }
}}

### Fail:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.change_online(token, 123456, 1000)
{:error, %Reydenx.Model.ResponseError{
  path: "/",
  status_code: 404,
  message: "Not Found"
}}
Link to this function

increase_off(token, order_id)

View Source (since 0.1.0)
@spec increase_off(
  token :: %Reydenx.Model.Token{
    access_token: term(),
    expires_in: term(),
    token_type: term()
  },
  order_id :: p()
) :: t()

Disable smooth increase of viewers

API Documentation

Examples:

### Success:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.increase_off(token, 123456)
{:ok, %Reydenx.Model.ActionResult{
  request_id: "",
  order_id: 123456,
  action: "increase:off",
  value: nil,
  task: %Reydenx.Model.Task{
    id: "h_Hg_ZWcjqRN2sd9GScBqg",
    url: "https://api.reyden-x.com/v1/orders/123456/task/h_Hg_ZWcjqRN2sd9GScBqg/status/",
    expires_at: "2024-07-09T09:21:29.577065+00:00"
  }
}}

### Fail:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.increase_off(token, 123456)
{:error, %Reydenx.Model.ResponseError{
  path: "/",
  status_code: 404,
  message: "Not Found"
}}
Link to this function

increase_on(token, order_id, value)

View Source (since 0.1.0)
@spec increase_on(
  token :: %Reydenx.Model.Token{
    access_token: term(),
    expires_in: term(),
    token_type: term()
  },
  order_id :: p(),
  value :: p()
) :: t()

Enable smooth increase of viewers

API Documentation

Examples:

### Success:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.increase_on(token, 123456, 1000)
{:ok, %Reydenx.Model.ActionResult{
  request_id: "",
  order_id: 123456,
  action: "increase:on",
  value: nil,
  task: %Reydenx.Model.Task{
    id: "h_Hg_ZWcjqRN2sd9GScBqg",
    url: "https://api.reyden-x.com/v1/orders/123456/task/h_Hg_ZWcjqRN2sd9GScBqg/status/",
    expires_at: "2024-07-09T09:21:29.577065+00:00"
  }
}}

### Fail:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.increase_on(token, 123456, 1000)
{:error, %Reydenx.Model.ResponseError{
  path: "/",
  status_code: 404,
  message: "Not Found"
}}
Link to this function

run(token, order_id)

View Source (since 0.1.0)
@spec run(
  token :: %Reydenx.Model.Token{
    access_token: term(),
    expires_in: term(),
    token_type: term()
  },
  order_id :: p()
) :: t()

Run Order

API Documentation

Examples:

### Success:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.run(token, 123456)
{:ok, %Reydenx.Model.ActionResult{
  request_id: "",
  order_id: 123456,
  action: "run",
  value: nil,
  task: %Reydenx.Model.Task{
    id: "h_Hg_ZWcjqRN2sd9GScBqg",
    url: "https://api.reyden-x.com/v1/orders/123456/task/h_Hg_ZWcjqRN2sd9GScBqg/status/",
    expires_at: "2024-07-09T09:21:29.577065+00:00"
  }
}}

### Fail:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.run(token, 123456)
{:error, %Reydenx.Model.ResponseError{
  path: "/",
  status_code: 404,
  message: "Not Found"
}}
Link to this function

stop(token, order_id)

View Source (since 0.1.0)
@spec stop(
  token :: %Reydenx.Model.Token{
    access_token: term(),
    expires_in: term(),
    token_type: term()
  },
  order_id :: p()
) :: t()

Stop Order

API Documentation

Examples:

### Success:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.stop(token, 123456)
{:ok, %Reydenx.Model.ActionResult{
  request_id: "",
  order_id: 123456,
  action: "stop",
  value: nil,
  task: %Reydenx.Model.Task{
    id: "h_Hg_ZWcjqRN2sd9GScBqg",
    url: "https://api.reyden-x.com/v1/orders/123456/task/h_Hg_ZWcjqRN2sd9GScBqg/status/",
    expires_at: "2024-07-09T09:21:29.577065+00:00"
  }
}}

### Fail:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.stop(token, 123456)
{:error, %Reydenx.Model.ResponseError{
  path: "/",
  status_code: 404,
  message: "Not Found"
}}
Link to this function

task_status(token, order_id, task_id)

View Source (since 0.1.0)
@spec task_status(
  token :: %Reydenx.Model.Token{
    access_token: term(),
    expires_in: term(),
    token_type: term()
  },
  order_id :: p(),
  task_id :: String.t()
) :: {:error, Reydenx.Model.ResponseError} | {:ok, Reydenx.Model.TaskStatus}

Check the Task Status

API Documentation

Examples:

### Success:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.task_status(token, "some_task_id")
{:ok, %Reydenx.Model.TaskStatus{}}

### Fail:

iex> {:ok, token} = Reydenx.new()
iex> Reydenx.Action.task_status(token, "some_task_id")
{:error, %Reydenx.Model.ResponseError{
  path: "/",
  status_code: 404,
  message: "Not Found"
}}