Class: TildaRuby::Resources::Projects

Inherits:
Object
  • Object
show all
Defined in:
lib/tilda_ruby/resources/projects.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Projects

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 Projects.

Parameters:



45
46
47
# File 'lib/tilda_ruby/resources/projects.rb', line 45

def initialize(client:)
  @client = client
end

Instance Method Details

#list(request_options: {}) ⇒ TildaRuby::Models::ProjectListResponse::UnionMember0, TildaRuby::Models::ProjectListResponse::ErrorResponse



33
34
35
36
37
38
39
40
# File 'lib/tilda_ruby/resources/projects.rb', line 33

def list(params = {})
  @client.request(
    method: :get,
    path: "v1/getprojectslist",
    model: TildaRuby::Models::ProjectListResponse,
    options: params[:request_options]
  )
end

#retrieve(projectid:, request_options: {}) ⇒ TildaRuby::Models::ProjectRetrieveResponse::UnionMember0, TildaRuby::Models::ProjectRetrieveResponse::ErrorResponse



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/tilda_ruby/resources/projects.rb', line 14

def retrieve(params)
  parsed, options = TildaRuby::ProjectRetrieveParams.dump_request(params)
  query = TildaRuby::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/getprojectinfo",
    query: query,
    model: TildaRuby::Models::ProjectRetrieveResponse,
    options: options
  )
end