Class: ContextDev::Models::NewsSearchParams::SearchBy

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/context_dev/models/news_search_params.rb,
sig/context_dev/models/news_search_params.rbs

Defined Under Namespace

Modules: Entity, Type

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(isin:, type: :isin) ⇒ Object

Identify the company by International Securities Identification Number.

Parameters:

  • isin (String)

    International Securities Identification Number.

  • type (Symbol, :isin) (defaults to: :isin)


61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/context_dev/models/news_search_params.rb', line 61

class SearchBy < ContextDev::Internal::Type::BaseModel
  # @!attribute entity
  #   The company to search news for, identified by name, domain, ticker, or ISIN.
  #
  #   @return [ContextDev::Models::NewsSearchParams::SearchBy::Entity::Name, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Domain, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Isin]
  required :entity, union: -> { ContextDev::NewsSearchParams::SearchBy::Entity }

  # @!attribute type
  #   How to search. Only entity search is supported.
  #
  #   @return [Symbol, ContextDev::Models::NewsSearchParams::SearchBy::Type]
  required :type, enum: -> { ContextDev::NewsSearchParams::SearchBy::Type }

  # @!method initialize(entity:, type:)
  #   What to search for.
  #
  #   @param entity [ContextDev::Models::NewsSearchParams::SearchBy::Entity::Name, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Domain, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Isin] The company to search news for, identified by name, domain, ticker, or ISIN.
  #
  #   @param type [Symbol, ContextDev::Models::NewsSearchParams::SearchBy::Type] How to search. Only entity search is supported.

  # The company to search news for, identified by name, domain, ticker, or ISIN.
  #
  # @see ContextDev::Models::NewsSearchParams::SearchBy#entity
  module Entity
    extend ContextDev::Internal::Type::Union

    discriminator :type

    # Identify the company by name.
    variant :name, -> { ContextDev::NewsSearchParams::SearchBy::Entity::Name }

    # Identify the company by website domain.
    variant :domain, -> { ContextDev::NewsSearchParams::SearchBy::Entity::Domain }

    # Identify the company by stock ticker, optionally scoped to an exchange.
    variant :ticker, -> { ContextDev::NewsSearchParams::SearchBy::Entity::Ticker }

    # Identify the company by International Securities Identification Number.
    variant :isin, -> { ContextDev::NewsSearchParams::SearchBy::Entity::Isin }

    class Name < ContextDev::Internal::Type::BaseModel
      # @!attribute name
      #   Company name.
      #
      #   @return [String]
      required :name, String

      # @!attribute type
      #
      #   @return [Symbol, :name]
      required :type, const: :name

      # @!method initialize(name:, type: :name)
      #   Identify the company by name.
      #
      #   @param name [String] Company name.
      #
      #   @param type [Symbol, :name]
    end

    class Domain < ContextDev::Internal::Type::BaseModel
      # @!attribute domain
      #   Company website domain, such as apple.com.
      #
      #   @return [String]
      required :domain, String

      # @!attribute type
      #
      #   @return [Symbol, :domain]
      required :type, const: :domain

      # @!method initialize(domain:, type: :domain)
      #   Identify the company by website domain.
      #
      #   @param domain [String] Company website domain, such as apple.com.
      #
      #   @param type [Symbol, :domain]
    end

    class Ticker < ContextDev::Internal::Type::BaseModel
      # @!attribute ticker
      #   Public-company ticker.
      #
      #   @return [String]
      required :ticker, String

      # @!attribute type
      #
      #   @return [Symbol, :ticker]
      required :type, const: :ticker

      # @!attribute exchange
      #   Stock exchange the ticker trades on, used to disambiguate tickers listed on
      #   multiple exchanges.
      #
      #   @return [Symbol, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker::Exchange, nil]
      optional :exchange, enum: -> { ContextDev::NewsSearchParams::SearchBy::Entity::Ticker::Exchange }

      # @!method initialize(ticker:, exchange: nil, type: :ticker)
      #   Some parameter documentations has been truncated, see
      #   {ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker} for more
      #   details.
      #
      #   Identify the company by stock ticker, optionally scoped to an exchange.
      #
      #   @param ticker [String] Public-company ticker.
      #
      #   @param exchange [Symbol, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker::Exchange] Stock exchange the ticker trades on, used to disambiguate tickers listed on mult
      #
      #   @param type [Symbol, :ticker]

      # Stock exchange the ticker trades on, used to disambiguate tickers listed on
      # multiple exchanges.
      #
      # @see ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker#exchange
      module Exchange
        extend ContextDev::Internal::Type::Enum

        AMEX = :AMEX
        AMS = :AMS
        AQS = :AQS
        ASX = :ASX
        ATH = :ATH
        BER = :BER
        BME = :BME
        BRU = :BRU
        BSE = :BSE
        BUD = :BUD
        BUE = :BUE
        BVC = :BVC
        CBOE = :CBOE
        CNQ = :CNQ
        CPH = :CPH
        DFM = :DFM
        DOH = :DOH
        DUB = :DUB
        DUS = :DUS
        DXE = :DXE
        EGX = :EGX
        FSX = :FSX
        HAM = :HAM
        HEL = :HEL
        HKSE = :HKSE
        HOSE = :HOSE
        ICE = :ICE
        IOB = :IOB
        IST = :IST
        JKT = :JKT
        JNB = :JNB
        JPX = :JPX
        KLS = :KLS
        KOE = :KOE
        KSC = :KSC
        KUW = :KUW
        LIS = :LIS
        LSE = :LSE
        MCX = :MCX
        MEX = :MEX
        MIL = :MIL
        MUN = :MUN
        NASDAQ = :NASDAQ
        NEO = :NEO
        NSE = :NSE
        NYSE = :NYSE
        NZE = :NZE
        OSL = :OSL
        OTC = :OTC
        PAR = :PAR
        PNK = :PNK
        PRA = :PRA
        RIS = :RIS
        SAO = :SAO
        SAU = :SAU
        SES = :SES
        SET = :SET
        SGO = :SGO
        SHH = :SHH
        SHZ = :SHZ
        SIX = :SIX
        STO = :STO
        STU = :STU
        TAI = :TAI
        TAL = :TAL
        TLV = :TLV
        TSX = :TSX
        TSXV = :TSXV
        TWO = :TWO
        VIE = :VIE
        WSE = :WSE
        XETRA = :XETRA

        # @!method self.values
        #   @return [Array<Symbol>]
      end
    end

    class Isin < ContextDev::Internal::Type::BaseModel
      # @!attribute isin
      #   International Securities Identification Number.
      #
      #   @return [String]
      required :isin, String

      # @!attribute type
      #
      #   @return [Symbol, :isin]
      required :type, const: :isin

      # @!method initialize(isin:, type: :isin)
      #   Identify the company by International Securities Identification Number.
      #
      #   @param isin [String] International Securities Identification Number.
      #
      #   @param type [Symbol, :isin]
    end

    # @!method self.variants
    #   @return [Array(ContextDev::Models::NewsSearchParams::SearchBy::Entity::Name, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Domain, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Ticker, ContextDev::Models::NewsSearchParams::SearchBy::Entity::Isin)]
  end

  # How to search. Only entity search is supported.
  #
  # @see ContextDev::Models::NewsSearchParams::SearchBy#type
  module Type
    extend ContextDev::Internal::Type::Enum

    ENTITY = :entity

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#entityContextDev::Models::NewsSearchParams::SearchBy::Entity::Name, ...

The company to search news for, identified by name, domain, ticker, or ISIN.



66
# File 'lib/context_dev/models/news_search_params.rb', line 66

required :entity, union: -> { ContextDev::NewsSearchParams::SearchBy::Entity }

#typeSymbol, ContextDev::Models::NewsSearchParams::SearchBy::Type

How to search. Only entity search is supported.

Parameters:

  • value (ContextDev::Models::NewsSearchParams::SearchBy::type_)

Returns:



72
# File 'lib/context_dev/models/news_search_params.rb', line 72

required :type, enum: -> { ContextDev::NewsSearchParams::SearchBy::Type }

Instance Method Details

#to_hash{

Returns:

  • ({)


78
# File 'sig/context_dev/models/news_search_params.rbs', line 78

def to_hash: -> {