Class: Sink::Resources::Types

Inherits:
Object
  • Object
show all
Defined in:
lib/sink/resources/types.rb,
lib/sink/resources/types/maps.rb,
lib/sink/resources/types/enums.rb,
lib/sink/resources/types/allofs.rb,
lib/sink/resources/types/arrays.rb,
lib/sink/resources/types/unions.rb,
lib/sink/resources/types/objects.rb,
lib/sink/resources/types/primitives.rb,
lib/sink/resources/types/read_only_params.rb,
lib/sink/resources/types/write_only_responses.rb

Defined Under Namespace

Classes: Allofs, Arrays, Enums, Maps, Objects, Primitives, ReadOnlyParams, Unions, WriteOnlyResponses

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Types

Returns a new instance of Types.

Parameters:



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/sink/resources/types.rb', line 34

def initialize(client:)
  @client = client
  @primitives = Sink::Resources::Types::Primitives.new(client: client)
  @read_only_params = Sink::Resources::Types::ReadOnlyParams.new(client: client)
  @write_only_responses = Sink::Resources::Types::WriteOnlyResponses.new(client: client)
  @maps = Sink::Resources::Types::Maps.new(client: client)
  @enums = Sink::Resources::Types::Enums.new(client: client)
  @allofs = Sink::Resources::Types::Allofs.new(client: client)
  @unions = Sink::Resources::Types::Unions.new(client: client)
  @objects = Sink::Resources::Types::Objects.new(client: client)
  @arrays = Sink::Resources::Types::Arrays.new(client: client)
end

Instance Attribute Details

#allofsSink::Resources::Types::Allofs (readonly)



22
23
24
# File 'lib/sink/resources/types.rb', line 22

def allofs
  @allofs
end

#arraysSink::Resources::Types::Arrays (readonly)



31
32
33
# File 'lib/sink/resources/types.rb', line 31

def arrays
  @arrays
end

#enumsSink::Resources::Types::Enums (readonly)



19
20
21
# File 'lib/sink/resources/types.rb', line 19

def enums
  @enums
end

#mapsSink::Resources::Types::Maps (readonly)



16
17
18
# File 'lib/sink/resources/types.rb', line 16

def maps
  @maps
end

#objectsSink::Resources::Types::Objects (readonly)



28
29
30
# File 'lib/sink/resources/types.rb', line 28

def objects
  @objects
end

#primitivesSink::Resources::Types::Primitives (readonly)



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

def primitives
  @primitives
end

#read_only_paramsSink::Resources::Types::ReadOnlyParams (readonly)



10
11
12
# File 'lib/sink/resources/types.rb', line 10

def read_only_params
  @read_only_params
end

#unionsSink::Resources::Types::Unions (readonly)



25
26
27
# File 'lib/sink/resources/types.rb', line 25

def unions
  @unions
end

#write_only_responsesSink::Resources::Types::WriteOnlyResponses (readonly)



13
14
15
# File 'lib/sink/resources/types.rb', line 13

def write_only_responses
  @write_only_responses
end

Instance Method Details

#dates(params = {}, opts = {}) ⇒ Sink::Models::TypeDatesResponse

Endpoint that has date types should generate params/responses with rich date

types.

Parameters:

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

    Attributes to send in this request. @option params [Date] :required_date @option params [Date] :required_nullable_date @option params [Array<Date>, nil] :list_date @option params [Date, Integer, nil] :oneof_date @option params [Date, nil] :optional_date

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

    Options to specify HTTP behaviour for this request.

Returns:



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

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

#datetimes(params = {}, opts = {}) ⇒ Sink::Models::TypeDatetimesResponse

Endpoint that has date-time types.

Parameters:

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

    Attributes to send in this request. @option params [Time] :required_datetime @option params [Time] :required_nullable_datetime @option params [Array<Time>, nil] :list_datetime @option params [Integer, Time, nil] :oneof_datetime union type coming from the ‘oneof_datetime` property @option params [Time, nil] :optional_datetime

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

    Options to specify HTTP behaviour for this request.

Returns:



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

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