brand.dev 0.6.0 → 0.8.0

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.
@@ -84,10 +84,9 @@ module BrandDev
84
84
 
85
85
  # @api private
86
86
  sig do
87
- params(
88
- status: Integer,
89
- headers: T.any(T::Hash[String, String], Net::HTTPHeader)
90
- ).returns(T::Boolean)
87
+ params(status: Integer, headers: T::Hash[String, String]).returns(
88
+ T::Boolean
89
+ )
91
90
  end
92
91
  def should_retry?(status, headers:)
93
92
  end
@@ -97,7 +96,7 @@ module BrandDev
97
96
  params(
98
97
  request: BrandDev::Internal::Transport::BaseClient::RequestInput,
99
98
  status: Integer,
100
- response_headers: T.any(T::Hash[String, String], Net::HTTPHeader)
99
+ response_headers: T::Hash[String, String]
101
100
  ).returns(BrandDev::Internal::Transport::BaseClient::RequestInput)
102
101
  end
103
102
  def follow_redirect(request, status:, response_headers:)
@@ -30,7 +30,7 @@ module BrandDev
30
30
  params(
31
31
  client: BrandDev::Internal::Transport::BaseClient,
32
32
  req: BrandDev::Internal::Transport::BaseClient::RequestComponents,
33
- headers: T.any(T::Hash[String, String], Net::HTTPHeader),
33
+ headers: T::Hash[String, String],
34
34
  page_data: T.anything
35
35
  ).void
36
36
  end
@@ -361,7 +361,7 @@ module BrandDev
361
361
  # Assumes each chunk in stream has `Encoding::BINARY`.
362
362
  sig do
363
363
  params(
364
- headers: T.any(T::Hash[String, String], Net::HTTPHeader),
364
+ headers: T::Hash[String, String],
365
365
  stream: T::Enumerable[String],
366
366
  suppress_error: T::Boolean
367
367
  ).returns(T.anything)
@@ -54,14 +54,31 @@ module BrandDev
54
54
  attr_writer :name
55
55
 
56
56
  # Stock ticker symbol to retrieve brand data for (e.g., 'AAPL', 'GOOGL', 'BRK.A').
57
- # Must be 1-6 characters, letters/numbers/dots only. Cannot be used with domain or
58
- # name parameters.
57
+ # Must be 1-15 characters, letters/numbers/dots only. Cannot be used with domain
58
+ # or name parameters.
59
59
  sig { returns(T.nilable(String)) }
60
60
  attr_reader :ticker
61
61
 
62
62
  sig { params(ticker: String).void }
63
63
  attr_writer :ticker
64
64
 
65
+ # Optional stock exchange for the ticker. Only used when ticker parameter is
66
+ # provided. Defaults to assume ticker is American if not specified.
67
+ sig do
68
+ returns(
69
+ T.nilable(BrandDev::BrandRetrieveParams::TickerExchange::OrSymbol)
70
+ )
71
+ end
72
+ attr_reader :ticker_exchange
73
+
74
+ sig do
75
+ params(
76
+ ticker_exchange:
77
+ BrandDev::BrandRetrieveParams::TickerExchange::OrSymbol
78
+ ).void
79
+ end
80
+ attr_writer :ticker_exchange
81
+
65
82
  # Optional timeout in milliseconds for the request. If the request takes longer
66
83
  # than this value, it will be aborted with a 408 status code. Maximum allowed
67
84
  # value is 300000ms (5 minutes).
@@ -79,6 +96,8 @@ module BrandDev
79
96
  max_speed: T::Boolean,
80
97
  name: String,
81
98
  ticker: String,
99
+ ticker_exchange:
100
+ BrandDev::BrandRetrieveParams::TickerExchange::OrSymbol,
82
101
  timeout_ms: Integer,
83
102
  request_options: BrandDev::RequestOptions::OrHash
84
103
  ).returns(T.attached_class)
@@ -99,9 +118,12 @@ module BrandDev
99
118
  # parameters.
100
119
  name: nil,
101
120
  # Stock ticker symbol to retrieve brand data for (e.g., 'AAPL', 'GOOGL', 'BRK.A').
102
- # Must be 1-6 characters, letters/numbers/dots only. Cannot be used with domain or
103
- # name parameters.
121
+ # Must be 1-15 characters, letters/numbers/dots only. Cannot be used with domain
122
+ # or name parameters.
104
123
  ticker: nil,
124
+ # Optional stock exchange for the ticker. Only used when ticker parameter is
125
+ # provided. Defaults to assume ticker is American if not specified.
126
+ ticker_exchange: nil,
105
127
  # Optional timeout in milliseconds for the request. If the request takes longer
106
128
  # than this value, it will be aborted with a 408 status code. Maximum allowed
107
129
  # value is 300000ms (5 minutes).
@@ -119,6 +141,8 @@ module BrandDev
119
141
  max_speed: T::Boolean,
120
142
  name: String,
121
143
  ticker: String,
144
+ ticker_exchange:
145
+ BrandDev::BrandRetrieveParams::TickerExchange::OrSymbol,
122
146
  timeout_ms: Integer,
123
147
  request_options: BrandDev::RequestOptions
124
148
  }
@@ -407,6 +431,389 @@ module BrandDev
407
431
  def self.values
408
432
  end
409
433
  end
434
+
435
+ # Optional stock exchange for the ticker. Only used when ticker parameter is
436
+ # provided. Defaults to assume ticker is American if not specified.
437
+ module TickerExchange
438
+ extend BrandDev::Internal::Type::Enum
439
+
440
+ TaggedSymbol =
441
+ T.type_alias do
442
+ T.all(Symbol, BrandDev::BrandRetrieveParams::TickerExchange)
443
+ end
444
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
445
+
446
+ AMEX =
447
+ T.let(
448
+ :AMEX,
449
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
450
+ )
451
+ AMS =
452
+ T.let(
453
+ :AMS,
454
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
455
+ )
456
+ AQS =
457
+ T.let(
458
+ :AQS,
459
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
460
+ )
461
+ ASX =
462
+ T.let(
463
+ :ASX,
464
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
465
+ )
466
+ ATH =
467
+ T.let(
468
+ :ATH,
469
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
470
+ )
471
+ BER =
472
+ T.let(
473
+ :BER,
474
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
475
+ )
476
+ BME =
477
+ T.let(
478
+ :BME,
479
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
480
+ )
481
+ BRU =
482
+ T.let(
483
+ :BRU,
484
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
485
+ )
486
+ BSE =
487
+ T.let(
488
+ :BSE,
489
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
490
+ )
491
+ BUD =
492
+ T.let(
493
+ :BUD,
494
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
495
+ )
496
+ BUE =
497
+ T.let(
498
+ :BUE,
499
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
500
+ )
501
+ BVC =
502
+ T.let(
503
+ :BVC,
504
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
505
+ )
506
+ CBOE =
507
+ T.let(
508
+ :CBOE,
509
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
510
+ )
511
+ CNQ =
512
+ T.let(
513
+ :CNQ,
514
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
515
+ )
516
+ CPH =
517
+ T.let(
518
+ :CPH,
519
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
520
+ )
521
+ DFM =
522
+ T.let(
523
+ :DFM,
524
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
525
+ )
526
+ DOH =
527
+ T.let(
528
+ :DOH,
529
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
530
+ )
531
+ DUB =
532
+ T.let(
533
+ :DUB,
534
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
535
+ )
536
+ DUS =
537
+ T.let(
538
+ :DUS,
539
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
540
+ )
541
+ DXE =
542
+ T.let(
543
+ :DXE,
544
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
545
+ )
546
+ EGX =
547
+ T.let(
548
+ :EGX,
549
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
550
+ )
551
+ FSX =
552
+ T.let(
553
+ :FSX,
554
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
555
+ )
556
+ HAM =
557
+ T.let(
558
+ :HAM,
559
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
560
+ )
561
+ HEL =
562
+ T.let(
563
+ :HEL,
564
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
565
+ )
566
+ HKSE =
567
+ T.let(
568
+ :HKSE,
569
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
570
+ )
571
+ HOSE =
572
+ T.let(
573
+ :HOSE,
574
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
575
+ )
576
+ ICE =
577
+ T.let(
578
+ :ICE,
579
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
580
+ )
581
+ IOB =
582
+ T.let(
583
+ :IOB,
584
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
585
+ )
586
+ IST =
587
+ T.let(
588
+ :IST,
589
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
590
+ )
591
+ JKT =
592
+ T.let(
593
+ :JKT,
594
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
595
+ )
596
+ JNB =
597
+ T.let(
598
+ :JNB,
599
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
600
+ )
601
+ JPX =
602
+ T.let(
603
+ :JPX,
604
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
605
+ )
606
+ KLS =
607
+ T.let(
608
+ :KLS,
609
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
610
+ )
611
+ KOE =
612
+ T.let(
613
+ :KOE,
614
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
615
+ )
616
+ KSC =
617
+ T.let(
618
+ :KSC,
619
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
620
+ )
621
+ KUW =
622
+ T.let(
623
+ :KUW,
624
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
625
+ )
626
+ LIS =
627
+ T.let(
628
+ :LIS,
629
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
630
+ )
631
+ LSE =
632
+ T.let(
633
+ :LSE,
634
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
635
+ )
636
+ MCX =
637
+ T.let(
638
+ :MCX,
639
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
640
+ )
641
+ MEX =
642
+ T.let(
643
+ :MEX,
644
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
645
+ )
646
+ MIL =
647
+ T.let(
648
+ :MIL,
649
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
650
+ )
651
+ MUN =
652
+ T.let(
653
+ :MUN,
654
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
655
+ )
656
+ NASDAQ =
657
+ T.let(
658
+ :NASDAQ,
659
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
660
+ )
661
+ NEO =
662
+ T.let(
663
+ :NEO,
664
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
665
+ )
666
+ NSE =
667
+ T.let(
668
+ :NSE,
669
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
670
+ )
671
+ NYSE =
672
+ T.let(
673
+ :NYSE,
674
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
675
+ )
676
+ NZE =
677
+ T.let(
678
+ :NZE,
679
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
680
+ )
681
+ OSL =
682
+ T.let(
683
+ :OSL,
684
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
685
+ )
686
+ OTC =
687
+ T.let(
688
+ :OTC,
689
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
690
+ )
691
+ PAR =
692
+ T.let(
693
+ :PAR,
694
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
695
+ )
696
+ PNK =
697
+ T.let(
698
+ :PNK,
699
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
700
+ )
701
+ PRA =
702
+ T.let(
703
+ :PRA,
704
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
705
+ )
706
+ RIS =
707
+ T.let(
708
+ :RIS,
709
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
710
+ )
711
+ SAO =
712
+ T.let(
713
+ :SAO,
714
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
715
+ )
716
+ SAU =
717
+ T.let(
718
+ :SAU,
719
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
720
+ )
721
+ SES =
722
+ T.let(
723
+ :SES,
724
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
725
+ )
726
+ SET =
727
+ T.let(
728
+ :SET,
729
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
730
+ )
731
+ SGO =
732
+ T.let(
733
+ :SGO,
734
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
735
+ )
736
+ SHH =
737
+ T.let(
738
+ :SHH,
739
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
740
+ )
741
+ SHZ =
742
+ T.let(
743
+ :SHZ,
744
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
745
+ )
746
+ SIX =
747
+ T.let(
748
+ :SIX,
749
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
750
+ )
751
+ STO =
752
+ T.let(
753
+ :STO,
754
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
755
+ )
756
+ STU =
757
+ T.let(
758
+ :STU,
759
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
760
+ )
761
+ TAI =
762
+ T.let(
763
+ :TAI,
764
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
765
+ )
766
+ TAL =
767
+ T.let(
768
+ :TAL,
769
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
770
+ )
771
+ TLV =
772
+ T.let(
773
+ :TLV,
774
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
775
+ )
776
+ TSX =
777
+ T.let(
778
+ :TSX,
779
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
780
+ )
781
+ TSXV =
782
+ T.let(
783
+ :TSXV,
784
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
785
+ )
786
+ TWO =
787
+ T.let(
788
+ :TWO,
789
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
790
+ )
791
+ VIE =
792
+ T.let(
793
+ :VIE,
794
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
795
+ )
796
+ WSE =
797
+ T.let(
798
+ :WSE,
799
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
800
+ )
801
+ XETRA =
802
+ T.let(
803
+ :XETRA,
804
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
805
+ )
806
+
807
+ sig do
808
+ override.returns(
809
+ T::Array[
810
+ BrandDev::BrandRetrieveParams::TickerExchange::TaggedSymbol
811
+ ]
812
+ )
813
+ end
814
+ def self.values
815
+ end
816
+ end
410
817
  end
411
818
  end
412
819
  end
@@ -18,8 +18,8 @@ module BrandDev
18
18
 
19
19
  # Optional parameter to prioritize screenshot capture for styleguide extraction.
20
20
  # If 'speed', optimizes for faster capture with basic quality. If 'quality',
21
- # optimizes for higher quality with longer wait times. Defaults to 'speed' if not
22
- # provided.
21
+ # optimizes for higher quality with longer wait times. Defaults to 'quality' if
22
+ # not provided.
23
23
  sig do
24
24
  returns(
25
25
  T.nilable(BrandDev::BrandStyleguideParams::Prioritize::OrSymbol)
@@ -57,8 +57,8 @@ module BrandDev
57
57
  domain:,
58
58
  # Optional parameter to prioritize screenshot capture for styleguide extraction.
59
59
  # If 'speed', optimizes for faster capture with basic quality. If 'quality',
60
- # optimizes for higher quality with longer wait times. Defaults to 'speed' if not
61
- # provided.
60
+ # optimizes for higher quality with longer wait times. Defaults to 'quality' if
61
+ # not provided.
62
62
  prioritize: nil,
63
63
  # Optional timeout in milliseconds for the request. If the request takes longer
64
64
  # than this value, it will be aborted with a 408 status code. Maximum allowed
@@ -83,8 +83,8 @@ module BrandDev
83
83
 
84
84
  # Optional parameter to prioritize screenshot capture for styleguide extraction.
85
85
  # If 'speed', optimizes for faster capture with basic quality. If 'quality',
86
- # optimizes for higher quality with longer wait times. Defaults to 'speed' if not
87
- # provided.
86
+ # optimizes for higher quality with longer wait times. Defaults to 'quality' if
87
+ # not provided.
88
88
  module Prioritize
89
89
  extend BrandDev::Internal::Type::Enum
90
90
 
@@ -13,6 +13,8 @@ module BrandDev
13
13
  max_speed: T::Boolean,
14
14
  name: String,
15
15
  ticker: String,
16
+ ticker_exchange:
17
+ BrandDev::BrandRetrieveParams::TickerExchange::OrSymbol,
16
18
  timeout_ms: Integer,
17
19
  request_options: BrandDev::RequestOptions::OrHash
18
20
  ).returns(BrandDev::Models::BrandRetrieveResponse)
@@ -33,9 +35,12 @@ module BrandDev
33
35
  # parameters.
34
36
  name: nil,
35
37
  # Stock ticker symbol to retrieve brand data for (e.g., 'AAPL', 'GOOGL', 'BRK.A').
36
- # Must be 1-6 characters, letters/numbers/dots only. Cannot be used with domain or
37
- # name parameters.
38
+ # Must be 1-15 characters, letters/numbers/dots only. Cannot be used with domain
39
+ # or name parameters.
38
40
  ticker: nil,
41
+ # Optional stock exchange for the ticker. Only used when ticker parameter is
42
+ # provided. Defaults to assume ticker is American if not specified.
43
+ ticker_exchange: nil,
39
44
  # Optional timeout in milliseconds for the request. If the request takes longer
40
45
  # than this value, it will be aborted with a 408 status code. Maximum allowed
41
46
  # value is 300000ms (5 minutes).
@@ -208,8 +213,8 @@ module BrandDev
208
213
  domain:,
209
214
  # Optional parameter to prioritize screenshot capture for styleguide extraction.
210
215
  # If 'speed', optimizes for faster capture with basic quality. If 'quality',
211
- # optimizes for higher quality with longer wait times. Defaults to 'speed' if not
212
- # provided.
216
+ # optimizes for higher quality with longer wait times. Defaults to 'quality' if
217
+ # not provided.
213
218
  prioritize: nil,
214
219
  # Optional timeout in milliseconds for the request. If the request takes longer
215
220
  # than this value, it will be aborted with a 408 status code. Maximum allowed
@@ -21,11 +21,14 @@ module BrandDev
21
21
 
22
22
  attr_accessor status: Integer?
23
23
 
24
+ attr_accessor headers: ::Hash[String, String]?
25
+
24
26
  attr_accessor body: top?
25
27
 
26
28
  def initialize: (
27
29
  url: URI::Generic,
28
30
  ?status: Integer?,
31
+ ?headers: ::Hash[String, String]?,
29
32
  ?body: Object?,
30
33
  ?request: nil,
31
34
  ?response: nil,
@@ -37,6 +40,7 @@ module BrandDev
37
40
  def initialize: (
38
41
  url: URI::Generic,
39
42
  ?status: nil,
43
+ ?headers: ::Hash[String, String]?,
40
44
  ?body: nil,
41
45
  ?request: nil,
42
46
  ?response: nil,
@@ -48,6 +52,7 @@ module BrandDev
48
52
  def initialize: (
49
53
  url: URI::Generic,
50
54
  ?status: nil,
55
+ ?headers: ::Hash[String, String]?,
51
56
  ?body: nil,
52
57
  ?request: nil,
53
58
  ?response: nil,
@@ -59,6 +64,7 @@ module BrandDev
59
64
  def self.for: (
60
65
  url: URI::Generic,
61
66
  status: Integer,
67
+ headers: ::Hash[String, String]?,
62
68
  body: Object?,
63
69
  request: nil,
64
70
  response: nil,
@@ -68,6 +74,7 @@ module BrandDev
68
74
  def initialize: (
69
75
  url: URI::Generic,
70
76
  status: Integer,
77
+ headers: ::Hash[String, String]?,
71
78
  body: Object?,
72
79
  request: nil,
73
80
  response: nil,
@@ -14,7 +14,7 @@ module BrandDev
14
14
 
15
15
  def initialize: (
16
16
  Pathname | StringIO | IO | String content,
17
- ?filename: String?,
17
+ ?filename: (Pathname | String)?,
18
18
  ?content_type: String?
19
19
  ) -> void
20
20
  end