Class: Sink::Resources::Types::Unions

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Unions

Returns a new instance of Unions.

Parameters:



8
9
10
# File 'lib/sink/resources/types/unions.rb', line 8

def initialize(client:)
  @client = client
end

Instance Method Details

#array_param_discriminated_by_property_name(params = {}, opts = {}) ⇒ String

Endpoint with an array request param schema with items discriminated union that

just defines the `propertyName` config

Parameters:

  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [Array<Sink::Models::UnionDiscriminatedVariantA, Sink::Models::UnionDiscriminatedVariantB>] :body

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (String)


21
22
23
24
25
26
27
28
29
30
# File 'lib/sink/resources/types/unions.rb', line 21

def array_param_discriminated_by_property_name(params = {}, opts = {})
  req = {
    method: :post,
    path: "/types/unions/array_param_discriminated_by_property_name",
    body: params[:body],
    headers: {"Content-Type" => "application/json"},
    model: String
  }
  @client.request(req, opts)
end

#array_param_discriminated_with_basic_mapping(params = {}, opts = {}) ⇒ String

Endpoint with an array request param schema with items discriminated union that

also defines the `mapping` config

Parameters:

  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [Array<Sink::Models::UnionDiscriminatedVariantA, Sink::Models::UnionDiscriminatedVariantB>] :body

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (String)


41
42
43
44
45
46
47
48
49
50
# File 'lib/sink/resources/types/unions.rb', line 41

def array_param_discriminated_with_basic_mapping(params = {}, opts = {})
  req = {
    method: :post,
    path: "/types/unions/array_param_discriminated_with_basic_mapping",
    body: params[:body],
    headers: {"Content-Type" => "application/json"},
    model: String
  }
  @client.request(req, opts)
end

#param_discriminated_by_property_name(params = {}, opts = {}) ⇒ String

Endpoint with a request param schema that is a discriminated union that just

defines the `propertyName` config

Parameters:

  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [String] :value @option params [Symbol, Type, nil] :type

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (String)


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

def param_discriminated_by_property_name(params = {}, opts = {})
  req = {
    method: :post,
    path: "/types/unions/param_discriminated_by_property_name",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: String
  }
  @client.request(req, opts)
end

#param_discriminated_with_basic_mapping(params = {}, opts = {}) ⇒ String

Endpoint with a request param schema that is a discriminated union that also

defines the `mapping` config

Parameters:

  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [String] :value @option params [Symbol, Type, nil] :type

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

    Options to specify HTTP behaviour for this request.

Returns:

  • (String)


83
84
85
86
87
88
89
90
91
92
# File 'lib/sink/resources/types/unions.rb', line 83

def param_discriminated_with_basic_mapping(params = {}, opts = {})
  req = {
    method: :post,
    path: "/types/unions/param_discriminated_with_basic_mapping",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: String
  }
  @client.request(req, opts)
end

#response_discriminated_by_property_name(opts = {}) ⇒ Sink::Models::UnionDiscriminatedVariantA, Sink::Models::UnionDiscriminatedVariantB

Endpoint with a response schema that is a discriminated union that just defines

the `propertyName` config

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



100
101
102
103
104
105
106
107
# File 'lib/sink/resources/types/unions.rb', line 100

def response_discriminated_by_property_name(opts = {})
  req = {
    method: :get,
    path: "/types/unions/response_discriminated_by_property_name",
    model: Sink::Unknown
  }
  @client.request(req, opts)
end

#response_discriminated_with_basic_mapping(opts = {}) ⇒ Sink::Models::UnionDiscriminatedVariantA, Sink::Models::UnionDiscriminatedVariantB

Endpoint with a response schema that is a discriminated union that also defines

the `mapping` config

Parameters:

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

    Options to specify HTTP behaviour for this request.

Returns:



115
116
117
118
119
120
121
122
# File 'lib/sink/resources/types/unions.rb', line 115

def response_discriminated_with_basic_mapping(opts = {})
  req = {
    method: :get,
    path: "/types/unions/response_discriminated_with_basic_mapping",
    model: Sink::Unknown
  }
  @client.request(req, opts)
end