Class: Lithic::Resources::NetworkPrograms

Inherits:
Object
  • Object
show all
Defined in:
lib/lithic/resources/network_programs.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ NetworkPrograms

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

Parameters:



59
60
61
# File 'lib/lithic/resources/network_programs.rb', line 59

def initialize(client:)
  @client = client
end

Instance Method Details

#list(begin_: nil, end_: nil, page_size: nil, request_options: {}) ⇒ Lithic::Internal::SinglePage<Lithic::Models::NetworkProgram>

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

List network programs.

Parameters:

  • begin_ (Time)

    Date string in RFC 3339 format. Only entries created after the specified time wi

  • end_ (Time)

    Date string in RFC 3339 format. Only entries created before the specified time w

  • page_size (Integer)

    Page size (for pagination).

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

Returns:

See Also:



44
45
46
47
48
49
50
51
52
53
54
# File 'lib/lithic/resources/network_programs.rb', line 44

def list(params = {})
  parsed, options = Lithic::NetworkProgramListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "v1/network_programs",
    query: parsed.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::SinglePage,
    model: Lithic::NetworkProgram,
    options: options
  )
end

#retrieve(network_program_token, request_options: {}) ⇒ Lithic::Models::NetworkProgram

Get network program.

Parameters:

  • network_program_token (String)

    Globally unique identifier for the network program.

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

Returns:

See Also:



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

def retrieve(network_program_token, params = {})
  @client.request(
    method: :get,
    path: ["v1/network_programs/%1$s", network_program_token],
    model: Lithic::NetworkProgram,
    options: params[:request_options]
  )
end