Class: Sink::Resources::Responses::UnionTypes

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ UnionTypes

Returns a new instance of UnionTypes.

Parameters:



8
9
10
# File 'lib/sink/resources/responses/union_types.rb', line 8

def initialize(client:)
  @client = client
end

Instance Method Details

#mixed_types(opts = {}) ⇒ Boolean, ...

Endpoint with a top level union response of different types.

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



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

def mixed_types(opts = {})
  req = {
    method: :post,
    path: "/responses/unions/mixed_types",
    model: Sink::Unknown
  }
  @client.request(req, opts)
end

#nullable_union(opts = {}) ⇒ Sink::Models::SimpleObject, Sink::Models::UnionTypeNullableUnionResponse::UnnamedTypeWithunionParent5

Endpoint with a top level union response of floats and integers.

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



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

def nullable_union(opts = {})
  req = {
    method: :post,
    path: "/responses/unions/nullable",
    model: Sink::Unknown
  }
  @client.request(req, opts)
end

#numbers(opts = {}) ⇒ Float

Endpoint with a top level union response of floats and integers.

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (Float)


45
46
47
48
49
50
51
52
# File 'lib/sink/resources/responses/union_types.rb', line 45

def numbers(opts = {})
  req = {
    method: :post,
    path: "/responses/unions/numbers",
    model: Float
  }
  @client.request(req, opts)
end

#objects(opts = {}) ⇒ Sink::Models::SimpleObject, Sink::Models::UnionTypeObjectsResponse::UnnamedTypeWithunionParent6

Endpoint with a top level union response of just object variants.

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



59
60
61
62
63
64
65
66
# File 'lib/sink/resources/responses/union_types.rb', line 59

def objects(opts = {})
  req = {
    method: :post,
    path: "/responses/unions/objects",
    model: Sink::Unknown
  }
  @client.request(req, opts)
end

#super_mixed_types(opts = {}) ⇒ Boolean, ...

Endpoint with a top level union response of different types.

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (Boolean, Object, Sink::Models::SimpleObject, Sink::Models::UnionTypeSuperMixedTypesResponse::UnnamedTypeWithunionParent7, String)


73
74
75
76
77
78
79
80
# File 'lib/sink/resources/responses/union_types.rb', line 73

def super_mixed_types(opts = {})
  req = {
    method: :post,
    path: "/responses/unions/super_mixed_types",
    model: Sink::Unknown
  }
  @client.request(req, opts)
end

#unknown_variant(opts = {}) ⇒ Object, Sink::Models::SimpleObject

Endpoint with a top level union response with a variant that is ‘type: unknown`

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



87
88
89
90
91
92
93
94
# File 'lib/sink/resources/responses/union_types.rb', line 87

def unknown_variant(opts = {})
  req = {
    method: :post,
    path: "/responses/unions/unknown_variant",
    model: Sink::Unknown
  }
  @client.request(req, opts)
end