Class: Increase::Resources::Programs

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/programs.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Programs

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

Parameters:



57
58
59
# File 'lib/increase/resources/programs.rb', line 57

def initialize(client:)
  @client = client
end

Instance Method Details

#list(cursor: nil, limit: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::Program>

Some parameter documentations has been truncated, see Models::ProgramListParams for more details.

List Programs

Parameters:

  • cursor (String)

    Return the page of entries after this one.

  • limit (Integer)

    Limit the size of the list that is returned. The default (and maximum) is 100 ob

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/increase/resources/programs.rb', line 42

def list(params = {})
  parsed, options = Increase::ProgramListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "programs",
    query: parsed,
    page: Increase::Internal::Page,
    model: Increase::Program,
    options: options
  )
end

#retrieve(program_id, request_options: {}) ⇒ Increase::Models::Program

Retrieve a Program

Parameters:

  • program_id (String)

    The identifier of the Program to retrieve.

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



17
18
19
20
21
22
23
24
# File 'lib/increase/resources/programs.rb', line 17

def retrieve(program_id, params = {})
  @client.request(
    method: :get,
    path: ["programs/%1$s", program_id],
    model: Increase::Program,
    options: params[:request_options]
  )
end