Class: TerminalShop::Resources::App

Inherits:
Object
  • Object
show all
Defined in:
lib/terminal_shop/resources/app.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ App

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of App.

Parameters:



89
90
91
# File 'lib/terminal_shop/resources/app.rb', line 89

def initialize(client:)
  @client = client
end

Instance Method Details

#create(name: , redirect_uri: , request_options: {}) ⇒ TerminalShop::Models::AppCreateResponse

Create an app.

Parameters:

Returns:

See Also:



17
18
19
20
21
22
23
24
25
26
# File 'lib/terminal_shop/resources/app.rb', line 17

def create(params)
  parsed, options = TerminalShop::AppCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "app",
    body: parsed,
    model: TerminalShop::Models::AppCreateResponse,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ TerminalShop::Models::AppDeleteResponse

Delete the app with the given ID.

Parameters:

Returns:

See Also:



57
58
59
60
61
62
63
64
# File 'lib/terminal_shop/resources/app.rb', line 57

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["app/%1$s", id],
    model: TerminalShop::Models::AppDeleteResponse,
    options: params[:request_options]
  )
end

#get(id, request_options: {}) ⇒ TerminalShop::Models::AppGetResponse

Get the app with the given ID.

Parameters:

Returns:

See Also:



77
78
79
80
81
82
83
84
# File 'lib/terminal_shop/resources/app.rb', line 77

def get(id, params = {})
  @client.request(
    method: :get,
    path: ["app/%1$s", id],
    model: TerminalShop::Models::AppGetResponse,
    options: params[:request_options]
  )
end

#list(request_options: {}) ⇒ TerminalShop::Models::AppListResponse

List the current user’s registered apps.

Parameters:

Returns:

See Also:



37
38
39
40
41
42
43
44
# File 'lib/terminal_shop/resources/app.rb', line 37

def list(params = {})
  @client.request(
    method: :get,
    path: "app",
    model: TerminalShop::Models::AppListResponse,
    options: params[:request_options]
  )
end