Class: Sink::Resources::Envelopes

Inherits:
Object
  • Object
show all
Defined in:
lib/sink/resources/envelopes.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Envelopes

Returns a new instance of Envelopes.

Parameters:



7
8
9
# File 'lib/sink/resources/envelopes.rb', line 7

def initialize(client:)
  @client = client
end

Instance Method Details

#explicit(opts = {}) ⇒ Sink::Models::Address

Endpoint with a response wrapped within a ‘data` property.

Parameters:

  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



16
17
18
19
20
21
22
23
24
# File 'lib/sink/resources/envelopes.rb', line 16

def explicit(opts = {})
  req = {
    method: :get,
    path: "/envelopes/data",
    unwrap: :data,
    model: Sink::Models::Address
  }
  @client.request(req, opts)
end

#implicit(opts = {}) ⇒ Sink::Models::Address

Endpoint with a response wrapped within a ‘items` property.

Parameters:

  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



31
32
33
34
35
36
37
38
39
# File 'lib/sink/resources/envelopes.rb', line 31

def implicit(opts = {})
  req = {
    method: :get,
    path: "/envelopes/items",
    unwrap: :items,
    model: Sink::Models::Address
  }
  @client.request(req, opts)
end

#inline_response(opts = {}) ⇒ Sink::Models::EnvelopeInlineResponseResponse

Endpoint with a response wrapped within a ‘items` property that doesn’t use a

$ref.

Parameters:

  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



47
48
49
50
51
52
53
54
55
# File 'lib/sink/resources/envelopes.rb', line 47

def inline_response(opts = {})
  req = {
    method: :get,
    path: "/envelopes/items/inline_response",
    unwrap: :items,
    model: Sink::Models::EnvelopeInlineResponseResponse
  }
  @client.request(req, opts)
end

#wrapped_array(opts = {}) ⇒ Array<Sink::Models::ObjectWithChildRef>

Endpoint with a response wrapped within a ‘items` property that is an array

type.

Parameters:

  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



63
64
65
66
67
68
69
70
71
# File 'lib/sink/resources/envelopes.rb', line 63

def wrapped_array(opts = {})
  req = {
    method: :get,
    path: "/envelopes/items/wrapped_array",
    unwrap: :items,
    model: Sink::ArrayOf.new(Sink::Models::ObjectWithChildRef)
  }
  @client.request(req, opts)
end