brand.dev 0.0.1.pre.alpha.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +180 -0
  3. data/README.md +7 -3
  4. data/lib/brand_dev/errors.rb +22 -0
  5. data/lib/brand_dev/internal/transport/base_client.rb +10 -2
  6. data/lib/brand_dev/internal/type/array_of.rb +6 -1
  7. data/lib/brand_dev/internal/type/base_model.rb +77 -25
  8. data/lib/brand_dev/internal/type/boolean.rb +7 -1
  9. data/lib/brand_dev/internal/type/converter.rb +42 -34
  10. data/lib/brand_dev/internal/type/enum.rb +16 -5
  11. data/lib/brand_dev/internal/type/file_input.rb +6 -1
  12. data/lib/brand_dev/internal/type/hash_of.rb +6 -1
  13. data/lib/brand_dev/internal/type/union.rb +17 -9
  14. data/lib/brand_dev/internal/type/unknown.rb +7 -1
  15. data/lib/brand_dev/internal/util.rb +8 -9
  16. data/lib/brand_dev/models/brand_ai_query_params.rb +173 -0
  17. data/lib/brand_dev/models/brand_ai_query_response.rb +80 -0
  18. data/lib/brand_dev/models/brand_identify_from_transaction_params.rb +14 -1
  19. data/lib/brand_dev/models/brand_identify_from_transaction_response.rb +1 -29
  20. data/lib/brand_dev/models/brand_prefetch_params.rb +35 -0
  21. data/lib/brand_dev/models/brand_prefetch_response.rb +33 -0
  22. data/lib/brand_dev/models/brand_retrieve_by_ticker_params.rb +14 -1
  23. data/lib/brand_dev/models/brand_retrieve_by_ticker_response.rb +1 -29
  24. data/lib/brand_dev/models/brand_retrieve_naics_params.rb +11 -1
  25. data/lib/brand_dev/models/brand_retrieve_params.rb +24 -1
  26. data/lib/brand_dev/models/brand_retrieve_response.rb +1 -29
  27. data/lib/brand_dev/models/brand_retrieve_simplified_params.rb +35 -0
  28. data/lib/brand_dev/models/brand_retrieve_simplified_response.rb +280 -0
  29. data/lib/brand_dev/models/brand_screenshot_params.rb +49 -0
  30. data/lib/brand_dev/models/brand_screenshot_response.rb +64 -0
  31. data/lib/brand_dev/models/brand_styleguide_params.rb +36 -0
  32. data/lib/brand_dev/models/brand_styleguide_response.rb +769 -0
  33. data/lib/brand_dev/models.rb +13 -5
  34. data/lib/brand_dev/resources/brand.rb +165 -18
  35. data/lib/brand_dev/version.rb +1 -1
  36. data/lib/brand_dev.rb +10 -2
  37. data/rbi/brand_dev/errors.rbi +16 -0
  38. data/rbi/brand_dev/internal/type/boolean.rbi +2 -0
  39. data/rbi/brand_dev/internal/type/converter.rbi +15 -15
  40. data/rbi/brand_dev/internal/type/union.rbi +5 -0
  41. data/rbi/brand_dev/internal/type/unknown.rbi +2 -0
  42. data/rbi/brand_dev/internal/util.rbi +2 -0
  43. data/rbi/brand_dev/models/brand_ai_query_params.rbi +319 -0
  44. data/rbi/brand_dev/models/brand_ai_query_response.rbi +182 -0
  45. data/rbi/brand_dev/models/brand_identify_from_transaction_params.rbi +15 -0
  46. data/rbi/brand_dev/models/brand_identify_from_transaction_response.rbi +0 -69
  47. data/rbi/brand_dev/models/brand_prefetch_params.rbi +58 -0
  48. data/rbi/brand_dev/models/brand_prefetch_response.rbi +57 -0
  49. data/rbi/brand_dev/models/brand_retrieve_by_ticker_params.rbi +19 -1
  50. data/rbi/brand_dev/models/brand_retrieve_by_ticker_response.rbi +0 -69
  51. data/rbi/brand_dev/models/brand_retrieve_naics_params.rbi +19 -1
  52. data/rbi/brand_dev/models/brand_retrieve_params.rbi +30 -0
  53. data/rbi/brand_dev/models/brand_retrieve_response.rbi +0 -65
  54. data/rbi/brand_dev/models/brand_retrieve_simplified_params.rbi +61 -0
  55. data/rbi/brand_dev/models/brand_retrieve_simplified_response.rbi +667 -0
  56. data/rbi/brand_dev/models/brand_screenshot_params.rbi +105 -0
  57. data/rbi/brand_dev/models/brand_screenshot_response.rbi +135 -0
  58. data/rbi/brand_dev/models/brand_styleguide_params.rbi +60 -0
  59. data/rbi/brand_dev/models/brand_styleguide_response.rbi +1648 -0
  60. data/rbi/brand_dev/models.rbi +10 -1
  61. data/rbi/brand_dev/resources/brand.rbi +133 -6
  62. data/sig/brand_dev/errors.rbs +9 -0
  63. data/sig/brand_dev/internal/type/converter.rbs +7 -1
  64. data/sig/brand_dev/models/brand_ai_query_params.rbs +162 -0
  65. data/sig/brand_dev/models/brand_ai_query_response.rbs +79 -0
  66. data/sig/brand_dev/models/brand_identify_from_transaction_params.rbs +7 -1
  67. data/sig/brand_dev/models/brand_identify_from_transaction_response.rbs +0 -25
  68. data/sig/brand_dev/models/brand_prefetch_params.rbs +30 -0
  69. data/sig/brand_dev/models/brand_prefetch_response.rbs +28 -0
  70. data/sig/brand_dev/models/brand_retrieve_by_ticker_params.rbs +8 -1
  71. data/sig/brand_dev/models/brand_retrieve_by_ticker_response.rbs +0 -25
  72. data/sig/brand_dev/models/brand_retrieve_naics_params.rbs +8 -1
  73. data/sig/brand_dev/models/brand_retrieve_params.rbs +15 -1
  74. data/sig/brand_dev/models/brand_retrieve_response.rbs +0 -25
  75. data/sig/brand_dev/models/brand_retrieve_simplified_params.rbs +30 -0
  76. data/sig/brand_dev/models/brand_retrieve_simplified_response.rbs +292 -0
  77. data/sig/brand_dev/models/brand_screenshot_params.rbs +46 -0
  78. data/sig/brand_dev/models/brand_screenshot_response.rbs +63 -0
  79. data/sig/brand_dev/models/brand_styleguide_params.rbs +30 -0
  80. data/sig/brand_dev/models/brand_styleguide_response.rbs +925 -0
  81. data/sig/brand_dev/models.rbs +9 -1
  82. data/sig/brand_dev/resources/brand.rbs +35 -3
  83. metadata +46 -22
  84. data/lib/brand_dev/models/brand_search_params.rb +0 -22
  85. data/lib/brand_dev/models/brand_search_response.rb +0 -35
  86. data/rbi/brand_dev/models/brand_search_params.rbi +0 -40
  87. data/rbi/brand_dev/models/brand_search_response.rbi +0 -63
  88. data/sig/brand_dev/models/brand_search_params.rbs +0 -23
  89. data/sig/brand_dev/models/brand_search_response.rbs +0 -29
@@ -56,10 +56,14 @@ module BrandDev
56
56
  #
57
57
  # @param state [Hash{Symbol=>Object}] .
58
58
  #
59
- # @option state [Boolean, :strong] :strictness
59
+ # @option state [Boolean] :translate_names
60
+ #
61
+ # @option state [Boolean] :strictness
60
62
  #
61
63
  # @option state [Hash{Symbol=>Object}] :exactness
62
64
  #
65
+ # @option state [Class<StandardError>] :error
66
+ #
63
67
  # @option state [Integer] :branched
64
68
  #
65
69
  # @return [Symbol, Object]
@@ -70,8 +74,12 @@ module BrandDev
70
74
  if values.include?(val)
71
75
  exactness[:yes] += 1
72
76
  val
77
+ elsif values.first&.class == val.class
78
+ exactness[:maybe] += 1
79
+ value
73
80
  else
74
- exactness[values.first&.class == val.class ? :maybe : :no] += 1
81
+ exactness[:no] += 1
82
+ state[:error] = TypeError.new("#{value.class} can't be coerced into #{self}")
75
83
  value
76
84
  end
77
85
  end
@@ -91,11 +99,14 @@ module BrandDev
91
99
  #
92
100
  # @return [Object]
93
101
  def to_sorbet_type
94
- case values
102
+ types = values.map { BrandDev::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
103
+ case types
95
104
  in []
96
105
  T.noreturn
97
- in [value, *_]
98
- T.all(BrandDev::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(value), self)
106
+ in [type]
107
+ type
108
+ else
109
+ T.any(*types)
99
110
  end
100
111
  end
101
112
 
@@ -45,10 +45,14 @@ module BrandDev
45
45
  #
46
46
  # @param state [Hash{Symbol=>Object}] .
47
47
  #
48
- # @option state [Boolean, :strong] :strictness
48
+ # @option state [Boolean] :translate_names
49
+ #
50
+ # @option state [Boolean] :strictness
49
51
  #
50
52
  # @option state [Hash{Symbol=>Object}] :exactness
51
53
  #
54
+ # @option state [Class<StandardError>] :error
55
+ #
52
56
  # @option state [Integer] :branched
53
57
  #
54
58
  # @return [StringIO, Object]
@@ -62,6 +66,7 @@ module BrandDev
62
66
  exactness[:yes] += 1
63
67
  value
64
68
  else
69
+ state[:error] = TypeError.new("#{value.class} can't be coerced into #{StringIO}")
65
70
  exactness[:no] += 1
66
71
  value
67
72
  end
@@ -77,10 +77,14 @@ module BrandDev
77
77
  #
78
78
  # @param state [Hash{Symbol=>Object}] .
79
79
  #
80
- # @option state [Boolean, :strong] :strictness
80
+ # @option state [Boolean] :translate_names
81
+ #
82
+ # @option state [Boolean] :strictness
81
83
  #
82
84
  # @option state [Hash{Symbol=>Object}] :exactness
83
85
  #
86
+ # @option state [Class<StandardError>] :error
87
+ #
84
88
  # @option state [Integer] :branched
85
89
  #
86
90
  # @return [Hash{Symbol=>Object}, Object]
@@ -89,6 +93,7 @@ module BrandDev
89
93
 
90
94
  unless value.is_a?(Hash)
91
95
  exactness[:no] += 1
96
+ state[:error] = TypeError.new("#{value.class} can't be coerced into #{Hash}")
92
97
  return value
93
98
  end
94
99
 
@@ -115,14 +115,23 @@ module BrandDev
115
115
 
116
116
  # @api private
117
117
  #
118
+ # Tries to efficiently coerce the given value to one of the known variants.
119
+ #
120
+ # If the value cannot match any of the known variants, the coercion is considered
121
+ # non-viable and returns the original value.
122
+ #
118
123
  # @param value [Object]
119
124
  #
120
125
  # @param state [Hash{Symbol=>Object}] .
121
126
  #
122
- # @option state [Boolean, :strong] :strictness
127
+ # @option state [Boolean] :translate_names
128
+ #
129
+ # @option state [Boolean] :strictness
123
130
  #
124
131
  # @option state [Hash{Symbol=>Object}] :exactness
125
132
  #
133
+ # @option state [Class<StandardError>] :error
134
+ #
126
135
  # @option state [Integer] :branched
127
136
  #
128
137
  # @return [Object]
@@ -133,7 +142,6 @@ module BrandDev
133
142
 
134
143
  strictness = state.fetch(:strictness)
135
144
  exactness = state.fetch(:exactness)
136
- state[:strictness] = strictness == :strong ? true : strictness
137
145
 
138
146
  alternatives = []
139
147
  known_variants.each do |_, variant_fn|
@@ -152,13 +160,10 @@ module BrandDev
152
160
  end
153
161
  end
154
162
 
155
- case alternatives.sort_by(&:first)
163
+ case alternatives.sort_by!(&:first)
156
164
  in []
157
165
  exactness[:no] += 1
158
- if strictness == :strong
159
- message = "no possible conversion of #{value.class} into a variant of #{target.inspect}"
160
- raise ArgumentError.new(message)
161
- end
166
+ state[:error] = ArgumentError.new("no matching variant for #{value.inspect}")
162
167
  value
163
168
  in [[_, exact, coerced], *]
164
169
  exact.each { exactness[_1] += _2 }
@@ -195,11 +200,14 @@ module BrandDev
195
200
  #
196
201
  # @return [Object]
197
202
  def to_sorbet_type
198
- case (v = variants)
203
+ types = variants.map { BrandDev::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq
204
+ case types
199
205
  in []
200
206
  T.noreturn
207
+ in [type]
208
+ type
201
209
  else
202
- T.any(*v.map { BrandDev::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) })
210
+ T.any(*types)
203
211
  end
204
212
  end
205
213
 
@@ -33,14 +33,20 @@ module BrandDev
33
33
  class << self
34
34
  # @api private
35
35
  #
36
+ # No coercion needed for Unknown type.
37
+ #
36
38
  # @param value [Object]
37
39
  #
38
40
  # @param state [Hash{Symbol=>Object}] .
39
41
  #
40
- # @option state [Boolean, :strong] :strictness
42
+ # @option state [Boolean] :translate_names
43
+ #
44
+ # @option state [Boolean] :strictness
41
45
  #
42
46
  # @option state [Hash{Symbol=>Object}] :exactness
43
47
  #
48
+ # @option state [Class<StandardError>] :error
49
+ #
44
50
  # @option state [Integer] :branched
45
51
  #
46
52
  # @return [Object]
@@ -497,7 +497,7 @@ module BrandDev
497
497
  # @param closing [Array<Proc>]
498
498
  # @param content_type [String, nil]
499
499
  private def write_multipart_content(y, val:, closing:, content_type: nil)
500
- content_type ||= "application/octet-stream"
500
+ content_line = "Content-Type: %s\r\n\r\n"
501
501
 
502
502
  case val
503
503
  in BrandDev::FilePart
@@ -508,24 +508,21 @@ module BrandDev
508
508
  content_type: val.content_type
509
509
  )
510
510
  in Pathname
511
- y << "Content-Type: #{content_type}\r\n\r\n"
511
+ y << format(content_line, content_type || "application/octet-stream")
512
512
  io = val.open(binmode: true)
513
513
  closing << io.method(:close)
514
514
  IO.copy_stream(io, y)
515
515
  in IO
516
- y << "Content-Type: #{content_type}\r\n\r\n"
516
+ y << format(content_line, content_type || "application/octet-stream")
517
517
  IO.copy_stream(val, y)
518
518
  in StringIO
519
- y << "Content-Type: #{content_type}\r\n\r\n"
519
+ y << format(content_line, content_type || "application/octet-stream")
520
520
  y << val.string
521
- in String
522
- y << "Content-Type: #{content_type}\r\n\r\n"
523
- y << val.to_s
524
521
  in -> { primitive?(_1) }
525
- y << "Content-Type: text/plain\r\n\r\n"
522
+ y << format(content_line, content_type || "text/plain")
526
523
  y << val.to_s
527
524
  else
528
- y << "Content-Type: application/json\r\n\r\n"
525
+ y << format(content_line, content_type || "application/json")
529
526
  y << JSON.generate(val)
530
527
  end
531
528
  y << "\r\n"
@@ -563,6 +560,8 @@ module BrandDev
563
560
 
564
561
  # @api private
565
562
  #
563
+ # https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content
564
+ #
566
565
  # @param body [Object]
567
566
  #
568
567
  # @return [Array(String, Enumerable<String>)]
@@ -0,0 +1,173 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrandDev
4
+ module Models
5
+ # @see BrandDev::Resources::Brand#ai_query
6
+ class BrandAIQueryParams < BrandDev::Internal::Type::BaseModel
7
+ extend BrandDev::Internal::Type::RequestParameters::Converter
8
+ include BrandDev::Internal::Type::RequestParameters
9
+
10
+ # @!attribute data_to_extract
11
+ # Array of data points to extract from the website
12
+ #
13
+ # @return [Array<BrandDev::Models::BrandAIQueryParams::DataToExtract>]
14
+ required :data_to_extract,
15
+ -> { BrandDev::Internal::Type::ArrayOf[BrandDev::BrandAIQueryParams::DataToExtract] }
16
+
17
+ # @!attribute domain
18
+ # The domain name to analyze
19
+ #
20
+ # @return [String]
21
+ required :domain, String
22
+
23
+ # @!attribute specific_pages
24
+ # Optional object specifying which pages to analyze
25
+ #
26
+ # @return [BrandDev::Models::BrandAIQueryParams::SpecificPages, nil]
27
+ optional :specific_pages, -> { BrandDev::BrandAIQueryParams::SpecificPages }
28
+
29
+ # @!attribute timeout_ms
30
+ # Optional timeout in milliseconds for the request. If the request takes longer
31
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
32
+ # value is 300000ms (5 minutes).
33
+ #
34
+ # @return [Integer, nil]
35
+ optional :timeout_ms, Integer, api_name: :timeoutMS
36
+
37
+ # @!method initialize(data_to_extract:, domain:, specific_pages: nil, timeout_ms: nil, request_options: {})
38
+ # Some parameter documentations has been truncated, see
39
+ # {BrandDev::Models::BrandAIQueryParams} for more details.
40
+ #
41
+ # @param data_to_extract [Array<BrandDev::Models::BrandAIQueryParams::DataToExtract>] Array of data points to extract from the website
42
+ #
43
+ # @param domain [String] The domain name to analyze
44
+ #
45
+ # @param specific_pages [BrandDev::Models::BrandAIQueryParams::SpecificPages] Optional object specifying which pages to analyze
46
+ #
47
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
48
+ #
49
+ # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
50
+
51
+ class DataToExtract < BrandDev::Internal::Type::BaseModel
52
+ # @!attribute datapoint_description
53
+ # Description of what to extract
54
+ #
55
+ # @return [String]
56
+ required :datapoint_description, String
57
+
58
+ # @!attribute datapoint_example
59
+ # Example of the expected value
60
+ #
61
+ # @return [String]
62
+ required :datapoint_example, String
63
+
64
+ # @!attribute datapoint_name
65
+ # Name of the data point to extract
66
+ #
67
+ # @return [String]
68
+ required :datapoint_name, String
69
+
70
+ # @!attribute datapoint_type
71
+ # Type of the data point
72
+ #
73
+ # @return [Symbol, BrandDev::Models::BrandAIQueryParams::DataToExtract::DatapointType]
74
+ required :datapoint_type, enum: -> { BrandDev::BrandAIQueryParams::DataToExtract::DatapointType }
75
+
76
+ # @!method initialize(datapoint_description:, datapoint_example:, datapoint_name:, datapoint_type:)
77
+ # @param datapoint_description [String] Description of what to extract
78
+ #
79
+ # @param datapoint_example [String] Example of the expected value
80
+ #
81
+ # @param datapoint_name [String] Name of the data point to extract
82
+ #
83
+ # @param datapoint_type [Symbol, BrandDev::Models::BrandAIQueryParams::DataToExtract::DatapointType] Type of the data point
84
+
85
+ # Type of the data point
86
+ #
87
+ # @see BrandDev::Models::BrandAIQueryParams::DataToExtract#datapoint_type
88
+ module DatapointType
89
+ extend BrandDev::Internal::Type::Enum
90
+
91
+ TEXT = :text
92
+ NUMBER = :number
93
+ DATE = :date
94
+ BOOLEAN = :boolean
95
+ LIST = :list
96
+ URL = :url
97
+
98
+ # @!method self.values
99
+ # @return [Array<Symbol>]
100
+ end
101
+ end
102
+
103
+ class SpecificPages < BrandDev::Internal::Type::BaseModel
104
+ # @!attribute about_us
105
+ # Whether to analyze the about us page
106
+ #
107
+ # @return [Boolean, nil]
108
+ optional :about_us, BrandDev::Internal::Type::Boolean
109
+
110
+ # @!attribute blog
111
+ # Whether to analyze the blog
112
+ #
113
+ # @return [Boolean, nil]
114
+ optional :blog, BrandDev::Internal::Type::Boolean
115
+
116
+ # @!attribute careers
117
+ # Whether to analyze the careers page
118
+ #
119
+ # @return [Boolean, nil]
120
+ optional :careers, BrandDev::Internal::Type::Boolean
121
+
122
+ # @!attribute contact_us
123
+ # Whether to analyze the contact us page
124
+ #
125
+ # @return [Boolean, nil]
126
+ optional :contact_us, BrandDev::Internal::Type::Boolean
127
+
128
+ # @!attribute faq
129
+ # Whether to analyze the FAQ page
130
+ #
131
+ # @return [Boolean, nil]
132
+ optional :faq, BrandDev::Internal::Type::Boolean
133
+
134
+ # @!attribute home_page
135
+ # Whether to analyze the home page
136
+ #
137
+ # @return [Boolean, nil]
138
+ optional :home_page, BrandDev::Internal::Type::Boolean
139
+
140
+ # @!attribute privacy_policy
141
+ # Whether to analyze the privacy policy page
142
+ #
143
+ # @return [Boolean, nil]
144
+ optional :privacy_policy, BrandDev::Internal::Type::Boolean
145
+
146
+ # @!attribute terms_and_conditions
147
+ # Whether to analyze the terms and conditions page
148
+ #
149
+ # @return [Boolean, nil]
150
+ optional :terms_and_conditions, BrandDev::Internal::Type::Boolean
151
+
152
+ # @!method initialize(about_us: nil, blog: nil, careers: nil, contact_us: nil, faq: nil, home_page: nil, privacy_policy: nil, terms_and_conditions: nil)
153
+ # Optional object specifying which pages to analyze
154
+ #
155
+ # @param about_us [Boolean] Whether to analyze the about us page
156
+ #
157
+ # @param blog [Boolean] Whether to analyze the blog
158
+ #
159
+ # @param careers [Boolean] Whether to analyze the careers page
160
+ #
161
+ # @param contact_us [Boolean] Whether to analyze the contact us page
162
+ #
163
+ # @param faq [Boolean] Whether to analyze the FAQ page
164
+ #
165
+ # @param home_page [Boolean] Whether to analyze the home page
166
+ #
167
+ # @param privacy_policy [Boolean] Whether to analyze the privacy policy page
168
+ #
169
+ # @param terms_and_conditions [Boolean] Whether to analyze the terms and conditions page
170
+ end
171
+ end
172
+ end
173
+ end
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrandDev
4
+ module Models
5
+ # @see BrandDev::Resources::Brand#ai_query
6
+ class BrandAIQueryResponse < BrandDev::Internal::Type::BaseModel
7
+ # @!attribute data_extracted
8
+ # Array of extracted data points
9
+ #
10
+ # @return [Array<BrandDev::Models::BrandAIQueryResponse::DataExtracted>, nil]
11
+ optional :data_extracted,
12
+ -> { BrandDev::Internal::Type::ArrayOf[BrandDev::Models::BrandAIQueryResponse::DataExtracted] }
13
+
14
+ # @!attribute domain
15
+ # The domain that was analyzed
16
+ #
17
+ # @return [String, nil]
18
+ optional :domain, String
19
+
20
+ # @!attribute urls_analyzed
21
+ # List of URLs that were analyzed
22
+ #
23
+ # @return [Array<String>, nil]
24
+ optional :urls_analyzed, BrandDev::Internal::Type::ArrayOf[String]
25
+
26
+ # @!method initialize(data_extracted: nil, domain: nil, urls_analyzed: nil)
27
+ # @param data_extracted [Array<BrandDev::Models::BrandAIQueryResponse::DataExtracted>] Array of extracted data points
28
+ #
29
+ # @param domain [String] The domain that was analyzed
30
+ #
31
+ # @param urls_analyzed [Array<String>] List of URLs that were analyzed
32
+
33
+ class DataExtracted < BrandDev::Internal::Type::BaseModel
34
+ # @!attribute datapoint_name
35
+ # Name of the extracted data point
36
+ #
37
+ # @return [String, nil]
38
+ optional :datapoint_name, String
39
+
40
+ # @!attribute datapoint_value
41
+ # Value of the extracted data point
42
+ #
43
+ # @return [String, Float, Boolean, Array<String>, Array<Float>, nil]
44
+ optional :datapoint_value,
45
+ union: -> { BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue }
46
+
47
+ # @!method initialize(datapoint_name: nil, datapoint_value: nil)
48
+ # @param datapoint_name [String] Name of the extracted data point
49
+ #
50
+ # @param datapoint_value [String, Float, Boolean, Array<String>, Array<Float>] Value of the extracted data point
51
+
52
+ # Value of the extracted data point
53
+ #
54
+ # @see BrandDev::Models::BrandAIQueryResponse::DataExtracted#datapoint_value
55
+ module DatapointValue
56
+ extend BrandDev::Internal::Type::Union
57
+
58
+ variant String
59
+
60
+ variant Float
61
+
62
+ variant BrandDev::Internal::Type::Boolean
63
+
64
+ variant -> { BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::StringArray }
65
+
66
+ variant -> { BrandDev::Models::BrandAIQueryResponse::DataExtracted::DatapointValue::FloatArray }
67
+
68
+ # @!method self.variants
69
+ # @return [Array(String, Float, Boolean, Array<String>, Array<Float>)]
70
+
71
+ # @type [BrandDev::Internal::Type::Converter]
72
+ StringArray = BrandDev::Internal::Type::ArrayOf[String]
73
+
74
+ # @type [BrandDev::Internal::Type::Converter]
75
+ FloatArray = BrandDev::Internal::Type::ArrayOf[Float]
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
@@ -13,9 +13,22 @@ module BrandDev
13
13
  # @return [String]
14
14
  required :transaction_info, String
15
15
 
16
- # @!method initialize(transaction_info:, request_options: {})
16
+ # @!attribute timeout_ms
17
+ # Optional timeout in milliseconds for the request. If the request takes longer
18
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
19
+ # value is 300000ms (5 minutes).
20
+ #
21
+ # @return [Integer, nil]
22
+ optional :timeout_ms, Integer
23
+
24
+ # @!method initialize(transaction_info:, timeout_ms: nil, request_options: {})
25
+ # Some parameter documentations has been truncated, see
26
+ # {BrandDev::Models::BrandIdentifyFromTransactionParams} for more details.
27
+ #
17
28
  # @param transaction_info [String] Transaction information to identify the brand
18
29
  #
30
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
31
+ #
19
32
  # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
20
33
  end
21
34
  end
@@ -63,13 +63,6 @@ module BrandDev
63
63
  # @return [String, nil]
64
64
  optional :domain, String
65
65
 
66
- # @!attribute fonts
67
- # An array of fonts used by the brand's website
68
- #
69
- # @return [Array<BrandDev::Models::BrandIdentifyFromTransactionResponse::Brand::Font>, nil]
70
- optional :fonts,
71
- -> { BrandDev::Internal::Type::ArrayOf[BrandDev::Models::BrandIdentifyFromTransactionResponse::Brand::Font] }
72
-
73
66
  # @!attribute logos
74
67
  # An array of logos associated with the brand
75
68
  #
@@ -103,7 +96,7 @@ module BrandDev
103
96
  # @return [String, nil]
104
97
  optional :title, String
105
98
 
106
- # @!method initialize(address: nil, backdrops: nil, colors: nil, description: nil, domain: nil, fonts: nil, logos: nil, slogan: nil, socials: nil, stock: nil, title: nil)
99
+ # @!method initialize(address: nil, backdrops: nil, colors: nil, description: nil, domain: nil, logos: nil, slogan: nil, socials: nil, stock: nil, title: nil)
107
100
  # Some parameter documentations has been truncated, see
108
101
  # {BrandDev::Models::BrandIdentifyFromTransactionResponse::Brand} for more
109
102
  # details.
@@ -120,8 +113,6 @@ module BrandDev
120
113
  #
121
114
  # @param domain [String] The domain name of the brand
122
115
  #
123
- # @param fonts [Array<BrandDev::Models::BrandIdentifyFromTransactionResponse::Brand::Font>] An array of fonts used by the brand's website
124
- #
125
116
  # @param logos [Array<BrandDev::Models::BrandIdentifyFromTransactionResponse::Brand::Logo>] An array of logos associated with the brand
126
117
  #
127
118
  # @param slogan [String] The brand's slogan
@@ -283,25 +274,6 @@ module BrandDev
283
274
  # @param name [String] Name of the color
284
275
  end
285
276
 
286
- class Font < BrandDev::Internal::Type::BaseModel
287
- # @!attribute name
288
- # Name of the font
289
- #
290
- # @return [String, nil]
291
- optional :name, String
292
-
293
- # @!attribute usage
294
- # Usage of the font, e.g., 'title', 'body', 'button'
295
- #
296
- # @return [String, nil]
297
- optional :usage, String
298
-
299
- # @!method initialize(name: nil, usage: nil)
300
- # @param name [String] Name of the font
301
- #
302
- # @param usage [String] Usage of the font, e.g., 'title', 'body', 'button'
303
- end
304
-
305
277
  class Logo < BrandDev::Internal::Type::BaseModel
306
278
  # @!attribute colors
307
279
  # Array of colors in the logo
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrandDev
4
+ module Models
5
+ # @see BrandDev::Resources::Brand#prefetch
6
+ class BrandPrefetchParams < BrandDev::Internal::Type::BaseModel
7
+ extend BrandDev::Internal::Type::RequestParameters::Converter
8
+ include BrandDev::Internal::Type::RequestParameters
9
+
10
+ # @!attribute domain
11
+ # Domain name to prefetch brand data for
12
+ #
13
+ # @return [String]
14
+ required :domain, String
15
+
16
+ # @!attribute timeout_ms
17
+ # Optional timeout in milliseconds for the request. If the request takes longer
18
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
19
+ # value is 300000ms (5 minutes).
20
+ #
21
+ # @return [Integer, nil]
22
+ optional :timeout_ms, Integer, api_name: :timeoutMS
23
+
24
+ # @!method initialize(domain:, timeout_ms: nil, request_options: {})
25
+ # Some parameter documentations has been truncated, see
26
+ # {BrandDev::Models::BrandPrefetchParams} for more details.
27
+ #
28
+ # @param domain [String] Domain name to prefetch brand data for
29
+ #
30
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
31
+ #
32
+ # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrandDev
4
+ module Models
5
+ # @see BrandDev::Resources::Brand#prefetch
6
+ class BrandPrefetchResponse < BrandDev::Internal::Type::BaseModel
7
+ # @!attribute domain
8
+ # The domain that was queued for prefetching
9
+ #
10
+ # @return [String, nil]
11
+ optional :domain, String
12
+
13
+ # @!attribute message
14
+ # Success message
15
+ #
16
+ # @return [String, nil]
17
+ optional :message, String
18
+
19
+ # @!attribute status
20
+ # Status of the response, e.g., 'ok'
21
+ #
22
+ # @return [String, nil]
23
+ optional :status, String
24
+
25
+ # @!method initialize(domain: nil, message: nil, status: nil)
26
+ # @param domain [String] The domain that was queued for prefetching
27
+ #
28
+ # @param message [String] Success message
29
+ #
30
+ # @param status [String] Status of the response, e.g., 'ok'
31
+ end
32
+ end
33
+ end
@@ -13,9 +13,22 @@ module BrandDev
13
13
  # @return [String]
14
14
  required :ticker, String
15
15
 
16
- # @!method initialize(ticker:, request_options: {})
16
+ # @!attribute timeout_ms
17
+ # Optional timeout in milliseconds for the request. If the request takes longer
18
+ # than this value, it will be aborted with a 408 status code. Maximum allowed
19
+ # value is 300000ms (5 minutes).
20
+ #
21
+ # @return [Integer, nil]
22
+ optional :timeout_ms, Integer
23
+
24
+ # @!method initialize(ticker:, timeout_ms: nil, request_options: {})
25
+ # Some parameter documentations has been truncated, see
26
+ # {BrandDev::Models::BrandRetrieveByTickerParams} for more details.
27
+ #
17
28
  # @param ticker [String] Stock ticker symbol to retrieve brand data for (e.g. AAPL, TSLA, etc.)
18
29
  #
30
+ # @param timeout_ms [Integer] Optional timeout in milliseconds for the request. If the request takes longer th
31
+ #
19
32
  # @param request_options [BrandDev::RequestOptions, Hash{Symbol=>Object}]
20
33
  end
21
34
  end