Class: ScalarRubyTest::Resources::Ping

Inherits:
Object
  • Object
show all
Defined in:
lib/amritk-scalar-test/resources/ping.rb

Defined Under Namespace

Classes: RawResponses, ResultResponses

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Ping

Returns a new instance of Ping.



11
12
13
14
15
# File 'lib/amritk-scalar-test/resources/ping.rb', line 11

def initialize(client)
  @client = client
  @with_raw_response = RawResponses.new(client)
  @with_result = ResultResponses.new(@with_raw_response)
end

Instance Attribute Details

#with_raw_responseObject (readonly)

Returns the value of attribute with_raw_response.



9
10
11
# File 'lib/amritk-scalar-test/resources/ping.rb', line 9

def with_raw_response
  @with_raw_response
end

#with_resultObject (readonly)

Returns the value of attribute with_result.



9
10
11
# File 'lib/amritk-scalar-test/resources/ping.rb', line 9

def with_result
  @with_result
end

Instance Method Details

#ping(request_options: nil) ⇒ Object

Parameters:

  • request_options (Hash, nil)


19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/amritk-scalar-test/resources/ping.rb', line 19

def ping(params = {})
  parsed = Models::PingParams.dump_request(params)
  request_options = Runtime.request_options_hash(parsed.delete(:request_options))
  request_headers = Runtime.request_option_hash(request_options, :headers).merge(Runtime.request_option_hash(request_options, :extra_headers))
  response = @client.request(
    method: "GET",
    path: "/ping",
    headers: request_headers,
    request_options: request_options,
  )
  Runtime.deserialize(response, "PingResponse")
end