From 544f6764d40aa492e5959b2d13ce0e675fe676ef Mon Sep 17 00:00:00 2001 From: Dylan Knutson Date: Thu, 31 Jul 2025 02:57:30 +0000 Subject: [PATCH] add telegram-bot-ruby --- Gemfile | 3 + Gemfile.lock | 42 + sorbet/rbi/gems/dry-core@1.1.0.rbi | 9 + sorbet/rbi/gems/dry-inflector@1.2.0.rbi | 9 + sorbet/rbi/gems/dry-logic@1.6.0.rbi | 9 + sorbet/rbi/gems/dry-struct@1.8.0.rbi | 925 ++++ sorbet/rbi/gems/dry-types@1.8.3.rbi | 3971 ++++++++++++++++ sorbet/rbi/gems/faraday-multipart@1.1.1.rbi | 9 + sorbet/rbi/gems/faraday-net_http@3.4.1.rbi | 9 + sorbet/rbi/gems/faraday@2.13.4.rbi | 9 + sorbet/rbi/gems/ice_nine@0.11.2.rbi | 9 + sorbet/rbi/gems/json@2.13.2.rbi | 2032 ++++++++ sorbet/rbi/gems/multipart-post@2.4.1.rbi | 9 + sorbet/rbi/gems/net-http@0.6.0.rbi | 4096 ++++++++++++++++ sorbet/rbi/gems/telegram-bot-ruby@2.4.0.rbi | 4716 +++++++++++++++++++ sorbet/rbi/gems/uri@1.0.3.rbi | 2426 ++++++++++ sorbet/rbi/todo.rbi | 11 + sorbet/tapioca/require.rb | 5 + 18 files changed, 18299 insertions(+) create mode 100644 sorbet/rbi/gems/dry-core@1.1.0.rbi create mode 100644 sorbet/rbi/gems/dry-inflector@1.2.0.rbi create mode 100644 sorbet/rbi/gems/dry-logic@1.6.0.rbi create mode 100644 sorbet/rbi/gems/dry-struct@1.8.0.rbi create mode 100644 sorbet/rbi/gems/dry-types@1.8.3.rbi create mode 100644 sorbet/rbi/gems/faraday-multipart@1.1.1.rbi create mode 100644 sorbet/rbi/gems/faraday-net_http@3.4.1.rbi create mode 100644 sorbet/rbi/gems/faraday@2.13.4.rbi create mode 100644 sorbet/rbi/gems/ice_nine@0.11.2.rbi create mode 100644 sorbet/rbi/gems/json@2.13.2.rbi create mode 100644 sorbet/rbi/gems/multipart-post@2.4.1.rbi create mode 100644 sorbet/rbi/gems/net-http@0.6.0.rbi create mode 100644 sorbet/rbi/gems/telegram-bot-ruby@2.4.0.rbi create mode 100644 sorbet/rbi/gems/uri@1.0.3.rbi diff --git a/Gemfile b/Gemfile index 0ae19754..6abc2296 100644 --- a/Gemfile +++ b/Gemfile @@ -132,6 +132,9 @@ gem "dtext_rb", ref: "5ef8fd7a5205c832f4c18197911717e7d491494e" gem "charlock_holmes" +# Telegram Bot API +gem "telegram-bot-ruby" + # gem "pghero", git: "https://github.com/dymk/pghero", ref: "e314f99" gem "pghero", "~> 3.6" gem "pg_query", ">= 2" diff --git a/Gemfile.lock b/Gemfile.lock index 87b5f124..5af65396 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -176,6 +176,28 @@ GEM rubyzip (~> 2.0) domain_name (0.6.20240107) drb (2.2.3) + dry-core (1.1.0) + concurrent-ruby (~> 1.0) + logger + zeitwerk (~> 2.6) + dry-inflector (1.2.0) + dry-logic (1.6.0) + bigdecimal + concurrent-ruby (~> 1.0) + dry-core (~> 1.1) + zeitwerk (~> 2.6) + dry-struct (1.8.0) + dry-core (~> 1.1) + dry-types (~> 1.8, >= 1.8.2) + ice_nine (~> 0.11) + zeitwerk (~> 2.6) + dry-types (1.8.3) + bigdecimal (~> 3.0) + concurrent-ruby (~> 1.0) + dry-core (~> 1.0) + dry-inflector (~> 1.0) + dry-logic (~> 1.4) + zeitwerk (~> 2.6) enumerable-statistics (2.0.8) erubi (1.13.1) et-orbi (1.2.11) @@ -189,6 +211,14 @@ GEM faiss (0.3.2) numo-narray rice (>= 4.0.2) + faraday (2.13.4) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-multipart (1.1.1) + multipart-post (~> 2.0) + faraday-net_http (3.4.1) + net-http (>= 0.5.0) ffi (1.17.1-aarch64-linux-gnu) ffi (1.17.1-aarch64-linux-musl) ffi (1.17.1-arm64-darwin) @@ -240,6 +270,7 @@ GEM http-form_data (2.3.0) i18n (1.14.7) concurrent-ruby (~> 1.0) + ice_nine (0.11.2) io-console (0.8.0) irb (1.14.3) rdoc (>= 4.0.0) @@ -247,6 +278,7 @@ GEM jbuilder (2.13.0) actionview (>= 5.0.0) activesupport (>= 5.0.0) + json (2.13.2) kaminari (1.2.2) activesupport (>= 4.1.0) kaminari-actionview (= 1.2.2) @@ -288,8 +320,11 @@ GEM mmh3 (1.2.0) msgpack (1.7.5) multi_json (1.15.0) + multipart-post (2.4.1) neighbor (0.5.1) activerecord (>= 7) + net-http (0.6.0) + uri net-imap (0.5.4) date net-protocol @@ -625,6 +660,11 @@ GEM spoom (>= 1.2.0) thor (>= 1.2.0) yard-sorbet + telegram-bot-ruby (2.4.0) + dry-struct (~> 1.6) + faraday (~> 2.0) + faraday-multipart (~> 1.0) + zeitwerk (~> 2.6) thor (1.3.2) thruster (0.1.11-aarch64-linux) thruster (0.1.11-arm64-darwin) @@ -638,6 +678,7 @@ GEM concurrent-ruby (~> 1.0) unicode_plot (0.0.5) enumerable-statistics (>= 2.0.1) + uri (1.0.3) useragent (0.16.11) warden (1.2.9) rack (>= 2.0.9) @@ -759,6 +800,7 @@ DEPENDENCIES table_print tailwindcss-rails (~> 3.0) tapioca (= 0.16.6) + telegram-bot-ruby thruster timeout turbo-rails diff --git a/sorbet/rbi/gems/dry-core@1.1.0.rbi b/sorbet/rbi/gems/dry-core@1.1.0.rbi new file mode 100644 index 00000000..b490a067 --- /dev/null +++ b/sorbet/rbi/gems/dry-core@1.1.0.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `dry-core` gem. +# Please instead update this file by running `bin/tapioca gem dry-core`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/dry-inflector@1.2.0.rbi b/sorbet/rbi/gems/dry-inflector@1.2.0.rbi new file mode 100644 index 00000000..72f898c2 --- /dev/null +++ b/sorbet/rbi/gems/dry-inflector@1.2.0.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `dry-inflector` gem. +# Please instead update this file by running `bin/tapioca gem dry-inflector`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/dry-logic@1.6.0.rbi b/sorbet/rbi/gems/dry-logic@1.6.0.rbi new file mode 100644 index 00000000..08b676f2 --- /dev/null +++ b/sorbet/rbi/gems/dry-logic@1.6.0.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `dry-logic` gem. +# Please instead update this file by running `bin/tapioca gem dry-logic`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/dry-struct@1.8.0.rbi b/sorbet/rbi/gems/dry-struct@1.8.0.rbi new file mode 100644 index 00000000..cd54cce0 --- /dev/null +++ b/sorbet/rbi/gems/dry-struct@1.8.0.rbi @@ -0,0 +1,925 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `dry-struct` gem. +# Please instead update this file by running `bin/tapioca gem dry-struct`. + + +# source://dry-struct//lib/dry/struct/class_interface.rb#5 +module Dry + class << self + # source://dry-core/1.1.0/lib/dry/core.rb#52 + def Equalizer(*keys, **options); end + + # Constructor method for easily creating a {Dry::Struct}. + # + # @example + # require 'dry-struct' + # + # module Types + # include Dry.Types() + # end + # + # Person = Dry.Struct(name: Types::String, age: Types::Integer) + # matz = Person.new(name: "Matz", age: 52) + # matz.name #=> "Matz" + # matz.age #=> 52 + # + # Test = Dry.Struct(expected: Types::String) { schema(schema.strict) } + # Test[expected: "foo", unexpected: "bar"] + # #=> Dry::Struct::Error: [Test.new] unexpected keys [:unexpected] in Hash input + # @return [Dry::Struct] + # + # source://dry-struct//lib/dry/struct.rb#30 + def Struct(attributes = T.unsafe(nil), &block); end + + # source://dry-types/1.8.3/lib/dry/types.rb#253 + def Types(*namespaces, default: T.unsafe(nil), **aliases); end + end +end + +# Typed {Struct} with virtus-like DSL for defining schema. +# +# ### Differences between dry-struct and virtus +# +# {Struct} look somewhat similar to [Virtus][] but there are few significant differences: +# +# * {Struct}s don't provide attribute writers and are meant to be used +# as "data objects" exclusively. +# * Handling of attribute values is provided by standalone type objects from +# [`dry-types`][]. +# * Handling of attribute hashes is provided by standalone hash schemas from +# [`dry-types`][]. +# * Struct classes quack like [`dry-types`][], which means you can use them +# in hash schemas, as array members or sum them +# +# {Struct} class can specify a constructor type, which uses [hash schemas][] +# to handle attributes in `.new` method. +# +# [`dry-types`]: https://github.com/dry-rb/dry-types +# [Virtus]: https://github.com/solnic/virtus +# [hash schemas]: http://dry-rb.org/gems/dry-types/hash-schemas +# +# @example +# require 'dry-struct' +# +# module Types +# include Dry.Types() +# end +# +# class Book < Dry::Struct +# attribute :title, Types::String +# attribute :subtitle, Types::String.optional +# end +# +# rom_n_roda = Book.new( +# title: 'Web Development with ROM and Roda', +# subtitle: nil +# ) +# rom_n_roda.title #=> 'Web Development with ROM and Roda' +# rom_n_roda.subtitle #=> nil +# +# refactoring = Book.new( +# title: 'Refactoring', +# subtitle: 'Improving the Design of Existing Code' +# ) +# refactoring.title #=> 'Refactoring' +# refactoring.subtitle #=> 'Improving the Design of Existing Code' +# +# source://dry-struct//lib/dry/struct/class_interface.rb#6 +class Dry::Struct + include ::Dry::Core::Constants + include ::Dry::Core::Equalizer::Methods + extend ::Dry::Core::Extensions + extend ::Dry::Core::Constants + extend ::Dry::Core::ClassAttributes + extend ::Dry::Types::Type + extend ::Dry::Types::Builder + extend ::Dry::Struct::ClassInterface + extend ::Dry::Core::Deprecations::Interface + + # @param attributes [Hash, #each] + # @return [Struct] a new instance of Struct + # + # source://dry-struct//lib/dry/struct.rb#126 + def initialize(attributes); end + + # Retrieves value of previously defined attribute by its' `name` + # + # @example + # class Book < Dry::Struct + # attribute :title, Types::String + # attribute :subtitle, Types::String.optional + # end + # + # rom_n_roda = Book.new( + # title: 'Web Development with ROM and Roda', + # subtitle: nil + # ) + # rom_n_roda[:title] #=> 'Web Development with ROM and Roda' + # rom_n_roda[:subtitle] #=> nil + # @param name [String] + # @return [Object] + # + # source://dry-struct//lib/dry/struct.rb#147 + def [](name); end + + # Returns the value of attribute attributes. + # + # source://dry-struct//lib/dry/struct.rb#122 + def __attributes__; end + + # Create a copy of {Dry::Struct} with overriden attributes + # + # @example + # class Book < Dry::Struct + # attribute :title, Types::String + # attribute :subtitle, Types::String.optional + # end + # + # rom_n_roda = Book.new( + # title: 'Web Development with ROM and Roda', + # subtitle: '2nd edition' + # ) + # #=> # + # + # rom_n_roda.new(subtitle: '3rd edition') + # #=> # + # @param changeset [Hash{Symbol => Object}] + # @return [Struct] + # + # source://dry-struct//lib/dry/struct.rb#202 + def __new__(changeset); end + + # Returns the value of attribute attributes. + # + # source://dry-struct//lib/dry/struct.rb#122 + def attributes; end + + # Pattern matching support + # + # @api private + # + # source://dry-struct//lib/dry/struct.rb#224 + def deconstruct_keys(_keys); end + + # @return [String] + # + # source://dry-struct//lib/dry/struct.rb#215 + def inspect; end + + # Create a copy of {Dry::Struct} with overriden attributes + # + # @example + # class Book < Dry::Struct + # attribute :title, Types::String + # attribute :subtitle, Types::String.optional + # end + # + # rom_n_roda = Book.new( + # title: 'Web Development with ROM and Roda', + # subtitle: '2nd edition' + # ) + # #=> # + # + # rom_n_roda.new(subtitle: '3rd edition') + # #=> # + # @param changeset [Hash{Symbol => Object}] + # @return [Struct] + # + # source://dry-struct//lib/dry/struct.rb#202 + def new(changeset); end + + # Converts the {Dry::Struct} to a hash with keys representing + # each attribute (as symbols) and their corresponding values + # + # @example + # class Book < Dry::Struct + # attribute :title, Types::String + # attribute :subtitle, Types::String.optional + # end + # + # rom_n_roda = Book.new( + # title: 'Web Development with ROM and Roda', + # subtitle: nil + # ) + # rom_n_roda.to_hash + # #=> {title: 'Web Development with ROM and Roda', subtitle: nil} + # @return [Hash{Symbol => Object}] + # + # source://dry-struct//lib/dry/struct.rb#174 + def to_h; end + + # Converts the {Dry::Struct} to a hash with keys representing + # each attribute (as symbols) and their corresponding values + # TODO: remove in 2.0 + # + # @example + # class Book < Dry::Struct + # attribute :title, Types::String + # attribute :subtitle, Types::String.optional + # end + # + # rom_n_roda = Book.new( + # title: 'Web Development with ROM and Roda', + # subtitle: nil + # ) + # rom_n_roda.to_hash + # #=> {title: 'Web Development with ROM and Roda', subtitle: nil} + # @return [Hash{Symbol => Object}] + # + # source://dry-struct//lib/dry/struct.rb#174 + def to_hash; end + + class << self + # source://dry-struct//lib/dry/struct.rb#94 + def loader; end + + def prepend(*_arg0); end + end +end + +# Class-level interface of {Struct} and {Value} +# +# source://dry-struct//lib/dry/struct/class_interface.rb#8 +module Dry::Struct::ClassInterface + include ::Dry::Core::Constants + include ::Dry::Core::ClassAttributes + include ::Dry::Types::Type + include ::Dry::Types::Builder + + # @param other [Object, Dry::Struct] + # @return [Boolean] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#331 + def ===(other); end + + # Make the struct abstract. This class will be used as a default + # parent class for nested structs + # + # source://dry-struct//lib/dry/struct/class_interface.rb#387 + def abstract; end + + # Adds an attribute for this {Struct} with given `name` and `type` + # and modifies {.schema} accordingly. + # + # @example with nested structs + # class Language < Dry::Struct + # attribute :name, Types::String + # attribute :details, Dry::Struct do + # attribute :type, Types::String + # end + # end + # + # Language.schema # new lines for readability + # # => # rule=[type?(String)]> + # details: Language::Details + # }> fn=Kernel.Hash>]> + # + # ruby = Language.new(name: 'Ruby', details: { type: 'OO' }) + # ruby.name #=> 'Ruby' + # ruby.details #=> # + # ruby.details.type #=> 'OO' + # @example with a nested array of structs + # class Language < Dry::Struct + # attribute :name, Types::String + # attribute :versions, Types::Array.of(Types::String) + # attribute :celebrities, Types::Array.of(Dry::Struct) do + # attribute :name, Types::String + # attribute :pseudonym, Types::String + # end + # end + # + # Language.schema # new lines for readability + # => # rule=[type?(String)]> + # versions: Constrained< + # Array rule=[type?(String)]> + # > rule=[type?(Array)]> + # celebrities: Constrained rule=[type?(Array)]> + # }> fn=Kernel.Hash>]> + # + # ruby = Language.new( + # name: 'Ruby', + # versions: %w(1.8.7 1.9.8 2.0.1), + # celebrities: [ + # { name: 'Yukihiro Matsumoto', pseudonym: 'Matz' }, + # { name: 'Aaron Patterson', pseudonym: 'tenderlove' } + # ] + # ) + # ruby.name #=> 'Ruby' + # ruby.versions #=> ['1.8.7', '1.9.8', '2.0.1'] + # ruby.celebrities + # #=> [ + # #, + # # + # ] + # ruby.celebrities[0].name #=> 'Yukihiro Matsumoto' + # ruby.celebrities[0].pseudonym #=> 'Matz' + # ruby.celebrities[1].name #=> 'Aaron Patterson' + # ruby.celebrities[1].pseudonym #=> 'tenderlove' + # @param name [Symbol] name of the defined attribute + # @param type [Dry::Types::Type, nil] or superclass of nested type + # @raise [RepeatedAttributeError] when trying to define attribute with the + # same name as previously defined one + # @return [Dry::Struct] + # @yield If a block is given, it will be evaluated in the context of + # a new struct class, and set as a nested type for the given + # attribute. A class with a matching name will also be defined for + # the nested type. + # + # source://dry-struct//lib/dry/struct/class_interface.rb#86 + def attribute(name, type = T.unsafe(nil), &_arg2); end + + # Adds an omittable (key is not required on initialization) attribute for this {Struct} + # + # @example + # class User < Dry::Struct + # attribute :name, Types::String + # attribute? :email, Types::String + # end + # + # User.new(name: 'John') # => # + # @param name [Symbol] name of the defined attribute + # @param type [Dry::Types::Type, nil] or superclass of nested type + # @return [Dry::Struct] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#139 + def attribute?(*args, &_arg1); end + + # Gets the list of attribute names + # + # @return [Array] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#357 + def attribute_names; end + + # @example + # class Book < Dry::Struct + # attributes( + # title: Types::String, + # author: Types::String + # ) + # end + # + # Book.schema + # # => # rule=[type?(String)]> + # # author: Constrained rule=[type?(String)]> + # # }> fn=Kernel.Hash>]> + # @param new_schema [Hash{Symbol => Dry::Types::Type}] + # @raise [RepeatedAttributeError] when trying to define attribute with the + # same name as previously defined one + # @return [Dry::Struct] + # @see #attribute + # + # source://dry-struct//lib/dry/struct/class_interface.rb#173 + def attributes(new_schema); end + + # Add atributes from another struct + # + # @example + # class Address < Dry::Struct + # attribute :city, Types::String + # attribute :country, Types::String + # end + # + # class User < Dry::Struct + # attribute :name, Types::String + # attributes_from Address + # end + # + # User.new(name: 'Quispe', city: 'La Paz', country: 'Bolivia') + # @example with nested structs + # class User < Dry::Struct + # attribute :name, Types::String + # attribute :address do + # attributes_from Address + # end + # end + # @param struct [Dry::Struct] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#114 + def attributes_from(struct); end + + # @api private + # + # source://dry-struct//lib/dry/struct/class_interface.rb#261 + def call_safe(input, &_arg1); end + + # @api private + # + # source://dry-struct//lib/dry/struct/class_interface.rb#270 + def call_unsafe(input); end + + # @return [true] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#335 + def constrained?; end + + # @param constructor [#call, nil] + # @param block [#call, nil] + # @return [Dry::Struct::Constructor] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#288 + def constructor(constructor = T.unsafe(nil), **_arg1, &block); end + + # @return [false] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#327 + def default?; end + + # @param args [({Symbol => Object})] + # @return [Dry::Types::Result::Failure] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#320 + def failure(*args); end + + # Checks if this {Struct} has the given attribute + # + # @param key [Symbol] Attribute name + # @return [Boolean] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#352 + def has_attribute?(key); end + + # @api private + # + # source://dry-struct//lib/dry/struct/class_interface.rb#279 + def load(attributes); end + + # @return [{Symbol => Object}] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#362 + def meta(meta = T.unsafe(nil)); end + + # @param attributes [Hash{Symbol => Object}, Dry::Struct] + # @raise [Struct::Error] if the given attributes don't conform {#schema} + # + # source://dry-struct//lib/dry/struct/class_interface.rb#239 + def new(attributes = T.unsafe(nil), safe = T.unsafe(nil), &_arg2); end + + # @return [false] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#341 + def optional?; end + + # @return [self] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#338 + def primitive; end + + # @param other [Object, Dry::Struct] + # @return [Boolean] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#331 + def primitive?(other); end + + # @param klass [Class] + # @param args [({Symbol => Object})] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#324 + def result(klass, *args); end + + # @param args [({Symbol => Object})] + # @return [Dry::Types::Result::Success] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#316 + def success(*args); end + + # Dump to the AST + # + # @api public + # @return [Array] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#396 + def to_ast(meta: T.unsafe(nil)); end + + # @return [Proc] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#344 + def to_proc; end + + # Add an arbitrary transformation for input hash keys. + # + # @example + # class Book < Dry::Struct + # transform_keys(&:to_sym) + # + # attribute :title, Types::String + # end + # + # Book.new('title' => "The Old Man and the Sea") + # # => # + # @param proc [#call, nil] + # @param block [#call, nil] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#221 + def transform_keys(proc = T.unsafe(nil), &block); end + + # Add an arbitrary transformation for new attribute types. + # + # @example + # class Book < Dry::Struct + # transform_types { |t| t.meta(struct: :Book) } + # + # attribute :title, Types::String + # end + # + # Book.schema.key(:title).meta # => { struct: :Book } + # @param proc [#call, nil] + # @param block [#call, nil] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#204 + def transform_types(proc = T.unsafe(nil), &block); end + + # @param input [Hash{Symbol => Object}, Dry::Struct] + # @return [Dry::Types::Result] + # @yieldparam failure [Dry::Types::Result::Failure] + # @yieldreturn [Dry::Types::Result] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#296 + def try(input); end + + # @param input [Hash{Symbol => Object}, Dry::Struct] + # @private + # @return [Dry::Types::Result] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#306 + def try_struct(input); end + + # Build a sum type + # + # @param type [Dry::Types::Type] + # @return [Dry::Types::Sum] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#377 + def |(type); end + + private + + # Constructs a type + # + # @return [Dry::Types::Type, Dry::Struct] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#430 + def build_type(name, type = T.unsafe(nil), &_arg2); end + + # @param new_keys [Hash{Symbol => Dry::Types::Type, Dry::Struct}] + # @raise [RepeatedAttributeError] when trying to define attribute with the + # same name as previously defined one + # + # source://dry-struct//lib/dry/struct/class_interface.rb#228 + def check_schema_duplication(new_keys); end + + # Retrieves default attributes from defined {.schema}. + # Used in a {Struct} constructor if no attributes provided to {.new} + # + # @return [Hash{Symbol => Object}] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#411 + def default_attributes(default_schema = T.unsafe(nil)); end + + # @api private + # + # source://dry-struct//lib/dry/struct/class_interface.rb#452 + def define_accessors(keys); end + + # Checks if the given type is a Dry::Struct + # + # @param type [Dry::Types::Type] + # @return [Boolean] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#422 + def struct?(type); end + + # Stores an object for building nested struct classes + # + # @return [StructBuilder] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#402 + def struct_builder; end + + # @api private + # @return [Boolean] + # + # source://dry-struct//lib/dry/struct/class_interface.rb#468 + def valid_method_name?(key); end +end + +# source://dry-struct//lib/dry/struct/compiler.rb#5 +class Dry::Struct::Compiler < ::Dry::Types::Compiler + # source://dry-struct//lib/dry/struct/compiler.rb#6 + def visit_struct(node); end +end + +# source://dry-struct//lib/dry/struct/constructor.rb#5 +class Dry::Struct::Constructor < ::Dry::Types::Constructor + # source://dry-types/1.8.3/lib/dry/types/constructor.rb#16 + def primitive; end +end + +# Raised when given input doesn't conform schema and constructor type +# +# source://dry-struct//lib/dry/struct/errors.rb#6 +class Dry::Struct::Error < ::Dry::Types::CoercionError; end + +# Helper for {Struct#to_hash} implementation +# +# source://dry-struct//lib/dry/struct/hashify.rb#6 +module Dry::Struct::Hashify + class << self + # Converts value to hash recursively + # + # @param value [#to_hash, #map, Object] + # @return [Hash, Array] + # + # source://dry-struct//lib/dry/struct/hashify.rb#10 + def [](value); end + end +end + +# Raised when a struct doesn't have an attribute +# +# source://dry-struct//lib/dry/struct/errors.rb#18 +class Dry::Struct::MissingAttributeError < ::KeyError + # @return [MissingAttributeError] a new instance of MissingAttributeError + # + # source://dry-struct//lib/dry/struct/errors.rb#19 + def initialize(attribute:, klass:); end +end + +# When struct class stored in ast was garbage collected because no alive objects exists +# This shouldn't happen in a working application +# +# source://dry-struct//lib/dry/struct/errors.rb#26 +class Dry::Struct::RecycledStructError < ::RuntimeError + # @return [RecycledStructError] a new instance of RecycledStructError + # + # source://dry-struct//lib/dry/struct/errors.rb#27 + def initialize; end +end + +# Raised when defining duplicate attributes +# +# source://dry-struct//lib/dry/struct/errors.rb#9 +class Dry::Struct::RepeatedAttributeError < ::ArgumentError + # @param key [Symbol] attribute name that is the same as previously defined one + # @return [RepeatedAttributeError] a new instance of RepeatedAttributeError + # + # source://dry-struct//lib/dry/struct/errors.rb#12 + def initialize(key); end +end + +# @private +# +# source://dry-struct//lib/dry/struct/struct_builder.rb#6 +class Dry::Struct::StructBuilder < ::Dry::Struct::Compiler + # @return [StructBuilder] a new instance of StructBuilder + # + # source://dry-struct//lib/dry/struct/struct_builder.rb#9 + def initialize(struct); end + + # @param attr_name [Symbol|String] the name of the nested type + # @param type [Dry::Struct, Dry::Types::Type::Array, Undefined] the superclass + # of the nested struct + # @yield the body of the nested struct + # + # source://dry-struct//lib/dry/struct/struct_builder.rb#18 + def call(attr_name, type, &block); end + + # Returns the value of attribute struct. + # + # source://dry-struct//lib/dry/struct/struct_builder.rb#7 + def struct; end + + private + + # @return [Boolean] + # + # source://dry-struct//lib/dry/struct/struct_builder.rb#48 + def array?(type); end + + # source://dry-struct//lib/dry/struct/struct_builder.rb#75 + def check_name(name); end + + # source://dry-struct//lib/dry/struct/struct_builder.rb#64 + def const_name(type, attr_name); end + + # @return [Boolean] + # + # source://dry-struct//lib/dry/struct/struct_builder.rb#52 + def optional?(type); end + + # source://dry-struct//lib/dry/struct/struct_builder.rb#54 + def parent(type); end + + # @return [Boolean] + # + # source://dry-struct//lib/dry/struct/struct_builder.rb#46 + def type?(type); end + + # source://dry-struct//lib/dry/struct/struct_builder.rb#89 + def visit_array(node); end + + # source://dry-struct//lib/dry/struct/struct_builder.rb#84 + def visit_constrained(node); end + + # source://dry-struct//lib/dry/struct/struct_builder.rb#96 + def visit_constructor(node); end + + # source://dry-struct//lib/dry/struct/struct_builder.rb#94 + def visit_nominal(*_arg0); end +end + +# A sum type of two or more structs +# As opposed to Dry::Types::Sum::Constrained +# this type tries no to coerce data first. +# +# source://dry-struct//lib/dry/struct/sum.rb#8 +class Dry::Struct::Sum < ::Dry::Types::Sum::Constrained + # @return [boolean] + # + # source://dry-struct//lib/dry/struct/sum.rb#39 + def ===(value); end + + # source://dry-struct//lib/dry/struct/sum.rb#9 + def call(input); end + + # @param input [Hash{Symbol => Object}, Dry::Struct] + # @return [Dry::Types::Result] + # @yieldparam failure [Dry::Types::Result::Failure] + # @yieldreturn [Dry::Types::Result] + # + # source://dry-struct//lib/dry/struct/sum.rb#19 + def try(input); end + + # Build a new sum type + # + # @param type [Dry::Types::Type] + # @return [Dry::Types::Sum] + # + # source://dry-struct//lib/dry/struct/sum.rb#30 + def |(type); end + + protected + + # @private + # + # source://dry-struct//lib/dry/struct/sum.rb#44 + def try_struct(input, &block); end +end + +# @private +# +# source://dry-struct//lib/dry/struct/version.rb#6 +Dry::Struct::VERSION = T.let(T.unsafe(nil), String) + +# {Value} objects behave like {Struct}s but *deeply frozen* +# using [`ice_nine`](https://github.com/dkubb/ice_nine) +# +# @example +# class Location < Dry::Struct::Value +# attribute :lat, Types::Float +# attribute :lng, Types::Float +# end +# +# loc1 = Location.new(lat: 1.23, lng: 4.56) +# loc2 = Location.new(lat: 1.23, lng: 4.56) +# +# loc1.frozen? #=> true +# loc2.frozen? #=> true +# loc1 == loc2 #=> true +# @see https://github.com/dkubb/ice_nine +# +# source://dry-struct//lib/dry/struct/value.rb#26 +class Dry::Struct::Value < ::Dry::Struct + class << self + # @param attributes [Hash{Symbol => Object}, Dry::Struct] + # @return [Value] + # @see https://github.com/dkubb/ice_nine + # + # source://dry-struct//lib/dry/struct/value.rb#32 + def new(*_arg0); end + end +end + +# source://dry-struct//lib/dry/struct/printer.rb#6 +module Dry::Types + extend ::Dry::Core::Constants + + class << self + # source://dry-types/1.8.3/lib/dry/types/constraints.rb#13 + def Rule(options); end + + # source://dry-types/1.8.3/lib/dry/types.rb#115 + def [](name); end + + # source://dry-types/1.8.3/lib/dry/types.rb#163 + def const_missing(const); end + + # source://dry-types/1.8.3/lib/dry/types.rb#82 + def container; end + + # source://dry-types/1.8.3/lib/dry/types.rb#197 + def define_builder(method, &block); end + + # source://dry-types/1.8.3/lib/dry/types.rb#149 + def identifier(klass); end + + # source://dry-types/1.8.3/lib/dry/types.rb#73 + def included(*_arg0); end + + # source://dry-types/1.8.3/lib/dry/types.rb#33 + def loader; end + + # source://dry-core/1.1.0/lib/dry/core/deprecations.rb#202 + def module(*args, &block); end + + # source://dry-types/1.8.3/lib/dry/types.rb#104 + def register(name, type = T.unsafe(nil), &block); end + + # source://dry-types/1.8.3/lib/dry/types.rb#91 + def registered?(class_or_identifier); end + + # source://dry-types/1.8.3/lib/dry/types/constraints.rb#26 + def rule_compiler; end + + # source://dry-types/1.8.3/lib/dry/types.rb#158 + def type_map; end + end +end + +# @api private +# +# source://dry-struct//lib/dry/struct/printer.rb#8 +class Dry::Types::Printer + # source://dry-types/1.8.3/lib/dry/types/printer.rb#38 + def initialize; end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#43 + def call(type); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#49 + def visit(type, &_arg1); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#62 + def visit_any(_); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#64 + def visit_array(type); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#70 + def visit_array_member(array); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#152 + def visit_callable(callable); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#102 + def visit_composition(composition, &_arg1); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#91 + def visit_constrained(constrained); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#78 + def visit_constructor(constructor); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#126 + def visit_default(default); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#108 + def visit_enum(enum); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#250 + def visit_hash(hash); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#240 + def visit_key(key); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#146 + def visit_lax(lax); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#226 + def visit_map(map); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#140 + def visit_nominal(type); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#269 + def visit_options(options, meta = T.unsafe(nil)); end + + # source://dry-types/1.8.3/lib/dry/types/printer.rb#187 + def visit_schema(schema); end + + # @api private + # + # source://dry-types/1.8.3/lib/dry/types/printer.rb#78 + def visit_struct_constructor(constructor); end + + # @api private + # + # source://dry-struct//lib/dry/struct/printer.rb#12 + def visit_struct_sum(sum); end +end diff --git a/sorbet/rbi/gems/dry-types@1.8.3.rbi b/sorbet/rbi/gems/dry-types@1.8.3.rbi new file mode 100644 index 00000000..c9dad108 --- /dev/null +++ b/sorbet/rbi/gems/dry-types@1.8.3.rbi @@ -0,0 +1,3971 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `dry-types` gem. +# Please instead update this file by running `bin/tapioca gem dry-types`. + + +# Main library namespace +# +# @api public +# +# source://dry-types//lib/dry/types/constraints.rb#3 +module Dry + class << self + # source://dry-core/1.1.0/lib/dry/core.rb#52 + def Equalizer(*keys, **options); end + + # source://dry-struct/1.8.0/lib/dry/struct.rb#30 + def Struct(attributes = T.unsafe(nil), &block); end + + # Export registered types as a module with constants + # + # @api public + # @example no options + # + # module Types + # # imports all types as constants, uses modules for namespaces + # include Dry.Types() + # end + # # strict types are exported by default + # Types::Integer + # # => # rule=[type?(Integer)]>]> + # Types::Nominal::Integer + # # => #]> + # @example changing default types + # + # module Types + # include Dry.Types(default: :nominal) + # end + # Types::Integer + # # => #]> + # @example cherry-picking namespaces + # + # module Types + # include Dry.Types(:strict, :coercible) + # end + # # cherry-picking discards default types, + # # provide the :default option along with the list of + # # namespaces if you want the to be exported + # Types.constants # => [:Coercible, :Strict] + # @example custom names + # module Types + # include Dry.Types(coercible: :Kernel) + # end + # Types::Kernel::Integer + # # => # fn=Kernel.Integer>]> + # @param namespaces [Array] List of type namespaces to export + # @param default [Symbol] Default namespace to export + # @param aliases [Hash{Symbol => Symbol}] Optional renamings, like strict: :Draconian + # @return [Dry::Types::Module] + # @see Dry::Types::Module + # + # source://dry-types//lib/dry/types.rb#253 + def Types(*namespaces, default: T.unsafe(nil), **aliases); end + end +end + +# @api public +# @see Dry.Types +# +# source://dry-types//lib/dry/types/constraints.rb#7 +module Dry::Types + include ::Dry::Core::Constants + extend ::Dry::Core::Constants + extend ::Dry::Core::ClassAttributes + extend ::Dry::Core::Extensions + extend ::Dry::Core::Deprecations::Interface + + class << self + # @api public + # @param options [Hash] + # @return [Dry::Logic::Rule] + # + # source://dry-types//lib/dry/types/constraints.rb#13 + def Rule(options); end + + # Get a built-in type by its name + # + # @api public + # @param name [String, Class] + # @return [Type, Class] + # + # source://dry-types//lib/dry/types.rb#115 + def [](name); end + + # @api private + # + # source://dry-types//lib/dry/types.rb#163 + def const_missing(const); end + + # Return container with registered built-in type objects + # + # @api private + # @return [Container{String => Nominal}] + # + # source://dry-types//lib/dry/types.rb#82 + def container; end + + # Add a new type builder method. This is a public API for defining custom + # type constructors + # + # @api public + # @example simple custom type constructor + # Dry::Types.define_builder(:or_nil) do |type| + # type.optional.fallback(nil) + # end + # + # Dry::Types["integer"].or_nil.("foo") # => nil + # @example fallback alias + # Dry::Types.define_builder(:or) do |type, fallback| + # type.fallback(fallback) + # end + # + # Dry::Types["integer"].or(100).("foo") # => 100 + # @param method [Symbol] + # @param block [#call] + # + # source://dry-types//lib/dry/types.rb#197 + def define_builder(method, &block); end + + # Infer a type identifier from the provided class + # + # @api public + # @param klass [#to_s] + # @return [String] + # + # source://dry-types//lib/dry/types.rb#149 + def identifier(klass); end + + # @api private + # @private + # + # source://dry-types//lib/dry/types.rb#73 + def included(*_arg0); end + + # @api public + # + # source://dry-types//lib/dry/types.rb#33 + def loader; end + + # @api public + # + # source://dry-core/1.1.0/lib/dry/core/deprecations.rb#202 + def module(*args, &block); end + + # Register a new built-in type + # + # @api private + # @param name [String] + # @param type [Type] + # @param block [#call, nil] + # @return [Container{String => Nominal}] + # + # source://dry-types//lib/dry/types.rb#104 + def register(name, type = T.unsafe(nil), &block); end + + # Check if a give type is registered + # + # @api private + # @return [Boolean] + # + # source://dry-types//lib/dry/types.rb#91 + def registered?(class_or_identifier); end + + # @api private + # @return [Dry::Logic::RuleCompiler] + # + # source://dry-types//lib/dry/types/constraints.rb#26 + def rule_compiler; end + + # Cached type map + # + # @api private + # @return [Concurrent::Map] + # + # source://dry-types//lib/dry/types.rb#158 + def type_map; end + end +end + +# All built-in primitives +# +# @api public +# +# source://dry-types//lib/dry/types/core.rb#38 +Dry::Types::ALL_PRIMITIVES = T.let(T.unsafe(nil), Hash) + +# source://dry-types//lib/dry/types/any.rb#39 +Dry::Types::Any = T.let(T.unsafe(nil), Dry::Types::AnyClass) + +# Any is a nominal type that defines Object as the primitive class +# +# This type is useful in places where you can't be specific about the type +# and anything is acceptable. +# +# @api public +# +# source://dry-types//lib/dry/types/any.rb#11 +class Dry::Types::AnyClass < ::Dry::Types::Nominal + # @api private + # @return [AnyClass] a new instance of AnyClass + # + # source://dry-types//lib/dry/types/any.rb#15 + def initialize(**options); end + + # @api public + # @return [String] + # + # source://dry-types//lib/dry/types/any.rb#22 + def name; end + + # @api public + # @return [Array] + # + # source://dry-types//lib/dry/types/any.rb#36 + def to_ast(meta: T.unsafe(nil)); end + + # @api public + # @param new_options [Hash] + # @return [Type] + # + # source://dry-types//lib/dry/types/any.rb#29 + def with(**new_options); end + + class << self + # @api public + # + # source://dry-types//lib/dry/types/any.rb#12 + def name; end + end +end + +# Array type can be used to define an array with optional member type +# +# @api public +# +# source://dry-types//lib/dry/types/array.rb#8 +class Dry::Types::Array < ::Dry::Types::Nominal + # @api private + # + # source://dry-types//lib/dry/types/array.rb#27 + def constructor_type; end + + # Build an array type with a member type + # + # @api public + # @param type [Type, #call] + # @return [Array::Member] + # + # source://dry-types//lib/dry/types/array.rb#16 + def of(type); end +end + +# @api private +# +# source://dry-types//lib/dry/types/array/constructor.rb#8 +class Dry::Types::Array::Constructor < ::Dry::Types::Constructor + # @api private + # + # source://dry-types//lib/dry/types/array/constructor.rb#10 + def constructor_type; end + + # @api public + # @return [Lax] + # + # source://dry-types//lib/dry/types/array/constructor.rb#15 + def lax; end + + # @api public + # @see Dry::Types::Array#of + # + # source://dry-types//lib/dry/types/array/constructor.rb#20 + def of(member); end +end + +# Member arrays define their member type that is applied to each element +# +# @api public +# +# source://dry-types//lib/dry/types/array/member.rb#9 +class Dry::Types::Array::Member < ::Dry::Types::Array + # @api private + # @option options + # @param primitive [Class] + # @param options [Hash] + # @return [Member] a new instance of Member + # + # source://dry-types//lib/dry/types/array/member.rb#19 + def initialize(primitive, **options); end + + # @api private + # @param input [Object] + # @return [Array] + # + # source://dry-types//lib/dry/types/array/member.rb#45 + def call_safe(input); end + + # @api private + # @param input [Object] + # @return [Array] + # + # source://dry-types//lib/dry/types/array/member.rb#29 + def call_unsafe(input); end + + # @api private + # + # source://dry-types//lib/dry/types/array/member.rb#116 + def constructor_type; end + + # Build a lax type + # + # @api public + # @return [Lax] + # + # source://dry-types//lib/dry/types/array/member.rb#100 + def lax; end + + # @api public + # @return [Type] + # + # source://dry-types//lib/dry/types/array/member.rb#11 + def member; end + + # @api public + # @see Nominal#to_ast + # + # source://dry-types//lib/dry/types/array/member.rb#107 + def to_ast(meta: T.unsafe(nil)); end + + # @api public + # @param input [Array, Object] + # @param block [#call, nil] + # @return [Result, Logic::Result] + # @yieldparam failure [Failure] + # @yieldreturn [Result] + # + # source://dry-types//lib/dry/types/array/member.rb#73 + def try(input, &block); end +end + +# Common API for building types and composition +# +# @api public +# +# source://dry-types//lib/dry/types/builder.rb#8 +module Dry::Types::Builder + include ::Dry::Core::Constants + + # Compose two types into an Intersection type + # + # @api private + # @param other [Type] + # @return [Intersection, Intersection::Constrained] + # + # source://dry-types//lib/dry/types/builder.rb#37 + def &(other); end + + # Define a constructor for the type + # + # @api public + # @param constructor [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/builder.rb#138 + def <<(constructor = T.unsafe(nil), **options, &block); end + + # Compose two types into an Implication type + # + # @api private + # @param other [Type] + # @return [Implication, Implication::Constrained] + # + # source://dry-types//lib/dry/types/builder.rb#46 + def >(other); end + + # Define a constructor for the type + # + # @api public + # @param constructor [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/builder.rb#138 + def >>(constructor = T.unsafe(nil), **options, &block); end + + # Define a constructor for the type + # + # @api public + # @param constructor [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/builder.rb#138 + def append(constructor = T.unsafe(nil), **options, &block); end + + # Turn a type into a constrained type + # + # @api public + # @param options [Hash] constraining rule (see {Types.Rule}) + # @return [Constrained] + # + # source://dry-types//lib/dry/types/builder.rb#62 + def constrained(*_arg0, **_arg1, &_arg2); end + + # @api private + # @return [Class] + # + # source://dry-types//lib/dry/types/builder.rb#14 + def constrained_type; end + + # Define a constructor for the type + # + # @api public + # @param constructor [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/builder.rb#138 + def constructor(constructor = T.unsafe(nil), **options, &block); end + + # @api private + # @return [Class] + # + # source://dry-types//lib/dry/types/builder.rb#19 + def constructor_type; end + + # Turn a type into a type with a default value + # + # @api public + # @option [Boolean] + # @param input [Object] + # @param block [#call, nil] + # @param [Boolean] [Hash] a customizable set of options + # @raise [ConstraintError] + # @return [Default] + # + # source://dry-types//lib/dry/types/builder.rb#77 + def default(input = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # Define an enum on top of the existing type + # + # @api public + # @param values [Array] + # @return [Enum] + # + # source://dry-types//lib/dry/types/builder.rb#110 + def enum(*values); end + + # Use the given value on type mismatch + # + # @api public + # @option [Boolean] + # @param value [Object] + # @param fallback [#call, nil] + # @param [Boolean] [Hash] a customizable set of options + # @return [Constructor] + # + # source://dry-types//lib/dry/types/builder.rb#155 + def fallback(value = T.unsafe(nil), shared: T.unsafe(nil), &_fallback); end + + # Turn a type into a lax type that will rescue from type-errors and + # return the original input + # + # @api public + # @return [Lax] + # + # source://dry-types//lib/dry/types/builder.rb#127 + def lax; end + + # Turn a type into an optional type + # + # @api public + # @return [Sum] + # + # source://dry-types//lib/dry/types/builder.rb#53 + def optional; end + + # Define a constructor for the type + # + # @api public + # @param constructor [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/builder.rb#138 + def prepend(constructor = T.unsafe(nil), **options, &block); end + + # Compose two types into a Sum type + # + # @api private + # @param other [Type] + # @return [Sum, Sum::Constrained] + # + # source://dry-types//lib/dry/types/builder.rb#28 + def |(other); end + + private + + # @api private + # + # source://dry-types//lib/dry/types/builder.rb#193 + def compose(other, composition_class); end +end + +# Common API for building type objects in a convenient way +# +# @api public +# +# source://dry-types//lib/dry/types/builder_methods.rb#9 +module Dry::Types::BuilderMethods + # Build an array type. + # + # Shortcut for Array#of. + # + # @api public + # @example + # Types::Strings = Types.Array(Types::String) + # @param type [Dry::Types::Type] + # @return [Dry::Types::Array] + # + # source://dry-types//lib/dry/types/builder_methods.rb#26 + def Array(type); end + + # Build a type with a single value + # The equality check done with `equal?` + # + # @api public + # @param object [Object] + # @return [Dry::Types::Type] + # + # source://dry-types//lib/dry/types/builder_methods.rb#70 + def Constant(object); end + + # Build a constructor type + # If no constructor block given it uses .new method + # + # @api public + # @param klass [Class] + # @param cons [#call, nil] Value constructor + # @param block [#call, nil] Value constructor + # @return [Dry::Types::Type] + # + # source://dry-types//lib/dry/types/builder_methods.rb#80 + def Constructor(klass, cons = T.unsafe(nil), &block); end + + # Build a hash schema + # + # @api public + # @param type_map [Hash{Symbol => Dry::Types::Type}] + # @return [Dry::Types::Array] + # + # source://dry-types//lib/dry/types/builder_methods.rb#33 + def Hash(type_map); end + + # Build a type which values are instances of a given class + # Values are checked using `is_a?` call + # + # @api public + # @example + # Types::Error = Types.Instance(StandardError) + # Types::Error = Types.Strict(StandardError) + # Types.Strict(Integer) == Types::Strict::Int # => true + # @param klass [Class, Module] Class or module + # @return [Dry::Types::Type] + # + # source://dry-types//lib/dry/types/builder_methods.rb#46 + def Instance(klass); end + + # Builds a constrained nominal type accepting any value that + # responds to given methods + # + # @api public + # @example + # Types::Callable = Types.Interface(:call) + # Types::Contact = Types.Interface(:name, :address) + # @param methods [Array] Method names + # @return [Dry::Types::Contrained] + # + # source://dry-types//lib/dry/types/builder_methods.rb#131 + def Interface(*methods); end + + # Build a map type + # + # @api public + # @example + # Types::IntMap = Types.Map(Types::Strict::Integer, 'any') + # Types::IntStringMap = Types.Map(Types::Strict::Integer, Types::Strict::String) + # @param key_type [Type] Key type + # @param value_type [Type] Value type + # @return [Dry::Types::Map] + # + # source://dry-types//lib/dry/types/builder_methods.rb#117 + def Map(key_type, value_type); end + + # Build a nominal type + # + # @api public + # @param klass [Class] + # @return [Dry::Types::Type] + # + # source://dry-types//lib/dry/types/builder_methods.rb#97 + def Nominal(klass); end + + # Build a type which values are instances of a given class + # Values are checked using `is_a?` call + # + # @api public + # @example + # Types::Error = Types.Instance(StandardError) + # Types::Error = Types.Strict(StandardError) + # Types.Strict(Integer) == Types::Strict::Int # => true + # @param klass [Class, Module] Class or module + # @return [Dry::Types::Type] + # + # source://dry-types//lib/dry/types/builder_methods.rb#46 + def Strict(klass); end + + # Build a type with a single value + # The equality check done with `eql?` + # + # @api public + # @param value [Object] + # @return [Dry::Types::Type] + # + # source://dry-types//lib/dry/types/builder_methods.rb#62 + def Value(value); end + + # @api private + # + # source://dry-types//lib/dry/types/builder_methods.rb#11 + def included(base); end +end + +# All coercible types +# +# @api public +# +# source://dry-types//lib/dry/types/core.rb#43 +Dry::Types::COERCIBLE = T.let(T.unsafe(nil), Hash) + +# Base class for coercion errors raise by dry-types +# +# @api public +# +# source://dry-types//lib/dry/types/errors.rb#15 +class Dry::Types::CoercionError < ::StandardError + # @api private + # @return [CoercionError] a new instance of CoercionError + # + # source://dry-types//lib/dry/types/errors.rb#35 + def initialize(message, meta: T.unsafe(nil), backtrace: T.unsafe(nil)); end + + # Metadata associated with the error + # + # @api public + # @return [Object] + # + # source://dry-types//lib/dry/types/errors.rb#32 + def meta; end + + class << self + # @api private + # + # source://dry-types//lib/dry/types/errors.rb#17 + def handle(exception, meta: T.unsafe(nil)); end + end +end + +# Common coercion functions used by the built-in `Params` and `JSON` types +# +# @api public +# +# source://dry-types//lib/dry/types/coercions.rb#8 +module Dry::Types::Coercions + include ::Dry::Core::Constants + + # @api public + # @param input [#to_str, Object] + # @return [Date, Object] + # @see Date.parse + # + # source://dry-types//lib/dry/types/coercions.rb#18 + def to_date(input, &_arg1); end + + # @api public + # @param input [#to_str, Object] + # @return [DateTime, Object] + # @see DateTime.parse + # + # source://dry-types//lib/dry/types/coercions.rb#41 + def to_date_time(input, &_arg1); end + + # @api public + # @param input [#to_sym, Object] + # @raise CoercionError + # @return [Symbol, Object] + # + # source://dry-types//lib/dry/types/coercions.rb#87 + def to_symbol(input, &_arg1); end + + # @api public + # @param input [#to_str, Object] + # @return [Time, Object] + # @see Time.parse + # + # source://dry-types//lib/dry/types/coercions.rb#64 + def to_time(input, &_arg1); end + + private + + # Checks whether String is empty + # + # @api private + # @param value [String, Object] + # @return [Boolean] + # + # source://dry-types//lib/dry/types/coercions.rb#102 + def empty_str?(value); end +end + +# JSON-specific coercions +# +# @api public +# +# source://dry-types//lib/dry/types/coercions/json.rb#14 +module Dry::Types::Coercions::JSON + extend ::Dry::Core::Constants + extend ::Dry::Types::Coercions + + class << self + # @api public + # @param input [#to_d, Object] + # @raise CoercionError + # @return [BigDecimal, nil] + # + # source://dry-types//lib/dry/types/coercions/json.rb#41 + def to_decimal(input, &_arg1); end + + # @api public + # @param input [Object] + # @raise CoercionError + # @return [nil] if the input is nil + # + # source://dry-types//lib/dry/types/coercions/json.rb#24 + def to_nil(input, &_arg1); end + end +end + +# Params-specific coercions +# +# @api public +# +# source://dry-types//lib/dry/types/coercions/params.rb#12 +module Dry::Types::Coercions::Params + extend ::Dry::Core::Constants + extend ::Dry::Types::Coercions + + class << self + # @api public + # @param input [Array, String, Object] + # @raise CoercionError + # @return [Array, Object] + # + # source://dry-types//lib/dry/types/coercions/params.rb#135 + def to_ary(input, &_arg1); end + + # @api public + # @param input [#to_d, Object] + # @raise CoercionError + # @return [BigDecimal, nil, Object] + # + # source://dry-types//lib/dry/types/coercions/params.rb#116 + def to_decimal(input, &_arg1); end + + # @api public + # @param input [String, Object] + # @raise CoercionError + # @return [Boolean, Object] + # @see TRUE_VALUES + # @see FALSE_VALUES + # + # source://dry-types//lib/dry/types/coercions/params.rb#69 + def to_false(input, &_arg1); end + + # @api public + # @param input [#to_f, Object] + # @raise CoercionError + # @return [Float, nil, Object] + # + # source://dry-types//lib/dry/types/coercions/params.rb#103 + def to_float(input, &_arg1); end + + # @api public + # @param input [Hash, String, Object] + # @raise CoercionError + # @return [Hash, Object] + # + # source://dry-types//lib/dry/types/coercions/params.rb#154 + def to_hash(input, &_arg1); end + + # @api public + # @param input [#to_int, #to_i, Object] + # @raise CoercionError + # @return [Integer, nil, Object] + # + # source://dry-types//lib/dry/types/coercions/params.rb#86 + def to_int(input, &_arg1); end + + # @api public + # @param input [Object] + # @raise CoercionError + # @return [nil] if the input is an empty string or nil + # + # source://dry-types//lib/dry/types/coercions/params.rb#29 + def to_nil(input, &_arg1); end + + # @api public + # @param input [String, Object] + # @raise CoercionError + # @return [Boolean, Object] + # @see TRUE_VALUES + # @see FALSE_VALUES + # + # source://dry-types//lib/dry/types/coercions/params.rb#49 + def to_true(input, &_arg1); end + end +end + +# @api public +# +# source://dry-types//lib/dry/types/coercions/params.rb#15 +Dry::Types::Coercions::Params::BOOLEAN_MAP = T.let(T.unsafe(nil), Hash) + +# @api public +# +# source://dry-types//lib/dry/types/coercions/params.rb#14 +Dry::Types::Coercions::Params::FALSE_VALUES = T.let(T.unsafe(nil), Array) + +# @api public +# +# source://dry-types//lib/dry/types/coercions/params.rb#13 +Dry::Types::Coercions::Params::TRUE_VALUES = T.let(T.unsafe(nil), Array) + +# @api private +# +# source://dry-types//lib/dry/types/compiler.rb#6 +class Dry::Types::Compiler + extend ::Dry::Core::Deprecations::Interface + + # @api private + # @return [Compiler] a new instance of Compiler + # + # source://dry-types//lib/dry/types/compiler.rb#11 + def initialize(registry); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#15 + def call(ast); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#114 + def compile_fn(fn); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#9 + def registry; end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#17 + def visit(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#110 + def visit_any(meta); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#59 + def visit_array(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#22 + def visit_constrained(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#28 + def visit_constructor(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#100 + def visit_enum(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#65 + def visit_hash(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#80 + def visit_json_array(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#75 + def visit_json_hash(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#95 + def visit_key(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#34 + def visit_lax(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#105 + def visit_map(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#39 + def visit_nominal(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#90 + def visit_params_array(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#85 + def visit_params_hash(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#50 + def visit_rule(node); end + + # source://dry-core/1.1.0/lib/dry/core/deprecations.rb#168 + def visit_safe(*args, &block); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#70 + def visit_schema(node); end + + # @api private + # + # source://dry-types//lib/dry/types/compiler.rb#54 + def visit_sum(node); end +end + +# source://dry-types//lib/dry/types/composition.rb#9 +module Dry::Types::Composition + include ::Dry::Types::Type + include ::Dry::Core::Constants + include ::Dry::Types::Builder + include ::Dry::Types::Options + include ::Dry::Types::Meta + include ::Dry::Types::Printable + include ::Dry::Core::Equalizer::Methods + include ::Dry::Types::Composition::Constrained + + # @api private + # @param left [Type] + # @param right [Type] + # @param options [Hash] + # + # source://dry-types//lib/dry/types/composition.rb#50 + def initialize(left, right, **options); end + + # @api private + # @param input [Object] + # @raise [::NotImplementedError] + # @return [Object] + # + # source://dry-types//lib/dry/types/composition.rb#88 + def call_safe(input, &_arg1); end + + # @api private + # @param input [Object] + # @raise [::NotImplementedError] + # @return [Object] + # + # source://dry-types//lib/dry/types/composition.rb#81 + def call_unsafe(input); end + + # @api public + # @return [false] + # + # source://dry-types//lib/dry/types/composition.rb#69 + def constrained?; end + + # @api public + # @return [false] + # + # source://dry-types//lib/dry/types/composition.rb#64 + def default?; end + + # @api private + # + # source://dry-types//lib/dry/types/composition.rb#106 + def failure(input, _error = T.unsafe(nil)); end + + # @return [Type] + # + # source://dry-types//lib/dry/types/composition.rb#22 + def left; end + + # @api public + # @return [String] + # + # source://dry-types//lib/dry/types/composition.rb#59 + def name; end + + # @api public + # @return [Boolean] + # + # source://dry-types//lib/dry/types/composition.rb#74 + def optional?; end + + # @api private + # @param value [Object] + # @raise [::NotImplementedError] + # @return [Boolean] + # + # source://dry-types//lib/dry/types/composition.rb#120 + def primitive?(value); end + + # @return [Type] + # + # source://dry-types//lib/dry/types/composition.rb#25 + def right; end + + # @api private + # + # source://dry-types//lib/dry/types/composition.rb#96 + def success(input); end + + # @api public + # @see Nominal#to_ast + # + # source://dry-types//lib/dry/types/composition.rb#125 + def to_ast(meta: T.unsafe(nil)); end + + # Wrap the type with a proc + # + # @api public + # @return [Proc] + # + # source://dry-types//lib/dry/types/composition.rb#135 + def to_proc; end + + # @api public + # @param input [Object] + # @raise [::NotImplementedError] + # + # source://dry-types//lib/dry/types/composition.rb#93 + def try(input, &_arg1); end + + class << self + # @private + # + # source://dry-types//lib/dry/types/composition.rb#37 + def included(base); end + end +end + +# source://dry-types//lib/dry/types/composition.rb#27 +module Dry::Types::Composition::Constrained + # @return [Boolean] + # + # source://dry-types//lib/dry/types/composition.rb#32 + def constrained?; end + + # source://dry-types//lib/dry/types/composition.rb#28 + def rule; end +end + +# Constrained types apply rules to the input +# +# @api public +# +# source://dry-types//lib/dry/types/constrained.rb#8 +class Dry::Types::Constrained + include ::Dry::Types::Type + include ::Dry::Types::Options + include ::Dry::Types::Decorator + include ::Dry::Core::Constants + include ::Dry::Types::Builder + include ::Dry::Types::Printable + include ::Dry::Core::Equalizer::Methods + + # @api public + # @param type [Type] + # @param options [Hash] + # @return [Constrained] a new instance of Constrained + # + # source://dry-types//lib/dry/types/constrained.rb#23 + def initialize(type, **options); end + + # @api public + # @param value [Object] + # @return [Boolean] + # + # source://dry-types//lib/dry/types/constrained.rb#108 + def ===(value); end + + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/constrained.rb#44 + def call_safe(input, &_arg1); end + + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/constrained.rb#31 + def call_unsafe(input); end + + # @api public + # @param *nullary_rules [Array] a list of rules that do not require an additional + # argument (e.g., :odd) + # @param **unary_rules [Hash] a list of rules that require an additional argument + # (e.g., gt: 0) + # The parameters are merger to create a rules hash provided to {Types.Rule} and combined + # using {&} with previous {#rule} + # @return [Constrained] + # @see Dry::Logic::Operators#and + # + # source://dry-types//lib/dry/types/constrained.rb#90 + def constrained(*nullary_rules, **unary_rules); end + + # @api public + # @return [true] + # + # source://dry-types//lib/dry/types/constrained.rb#101 + def constrained?; end + + # @api private + # + # source://dry-types//lib/dry/types/constrained.rb#123 + def constructor_type; end + + # Build lax type. Constraints are not applicable to lax types hence unwrapping + # + # @api public + # @return [Lax] + # + # source://dry-types//lib/dry/types/constrained.rb#114 + def lax; end + + # @api public + # @return [Dry::Logic::Rule] + # + # source://dry-types//lib/dry/types/constrained.rb#16 + def rule; end + + # @api public + # @see Nominal#to_ast + # + # source://dry-types//lib/dry/types/constrained.rb#118 + def to_ast(meta: T.unsafe(nil)); end + + # Safe coercion attempt. It is similar to #call with a + # block given but returns a Result instance with metadata + # about errors (if any). + # + # @api public + # @overload try + # @overload try + # + # source://dry-types//lib/dry/types/constrained.rb#67 + def try(input, &_arg1); end + + private + + # @api private + # @param response [Object] + # @return [Boolean] + # + # source://dry-types//lib/dry/types/constrained.rb#132 + def decorate?(response); end + + # @api private + # @param positional_args [Array] + # @return [Hash] + # + # source://dry-types//lib/dry/types/constrained.rb#139 + def parse_arguments(positional_arguments); end +end + +# Common coercion-related API for constrained types +# +# @api public +# +# source://dry-types//lib/dry/types/constrained/coercible.rb#9 +class Dry::Types::Constrained::Coercible < ::Dry::Types::Constrained + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/constrained/coercible.rb#27 + def call_safe(input); end + + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/constrained/coercible.rb#13 + def call_unsafe(input); end + + # @api public + # @see Dry::Types::Constrained#try + # + # source://dry-types//lib/dry/types/constrained/coercible.rb#40 + def try(input, &_arg1); end +end + +# @api public +# +# source://dry-types//lib/dry/types/errors.rb#112 +class Dry::Types::ConstraintError < ::Dry::Types::CoercionError + # @api public + # @param result [String, #to_s] + # @param input [Object] + # @return [ConstraintError] a new instance of ConstraintError + # + # source://dry-types//lib/dry/types/errors.rb#120 + def initialize(result, input); end + + # @api public + # @return [Object] + # + # source://dry-types//lib/dry/types/errors.rb#116 + def input; end + + # @api public + # @return [String] + # + # source://dry-types//lib/dry/types/errors.rb#132 + def message; end + + # @api public + # @return [String, #to_s] + # + # source://dry-types//lib/dry/types/errors.rb#114 + def result; end + + # @api public + # @return [String] + # + # source://dry-types//lib/dry/types/errors.rb#132 + def to_s; end +end + +# Constructor types apply a function to the input that is supposed to return +# a new value. Coercion is a common use case for constructor types. +# +# @api public +# +# source://dry-types//lib/dry/types/constructor.rb#9 +class Dry::Types::Constructor < ::Dry::Types::Nominal + # Instantiate a new constructor type instance + # + # @api private + # @param type [Type] + # @param fn [Function] + # @param options [Hash] + # @return [Constructor] a new instance of Constructor + # + # source://dry-types//lib/dry/types/constructor.rb#62 + def initialize(type, fn: T.unsafe(nil), **options); end + + # Build a new constructor by prepending a block to the coercion function + # + # @api public + # @param new_fn [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/constructor.rb#140 + def <<(new_fn = T.unsafe(nil), **options, &block); end + + # Build a new constructor by appending a block to the coercion function + # + # @api public + # @param new_fn [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/constructor.rb#107 + def >>(new_fn = T.unsafe(nil), **options, &block); end + + # Build a new constructor by appending a block to the coercion function + # + # @api public + # @param new_fn [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/constructor.rb#107 + def append(new_fn = T.unsafe(nil), **options, &block); end + + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/constructor.rb#72 + def call_safe(input); end + + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/constructor.rb#80 + def call_unsafe(input); end + + # @api private + # @return [Class] + # + # source://dry-types//lib/dry/types/constructor.rb#122 + def constrained_type; end + + # Build a new constructor by appending a block to the coercion function + # + # @api public + # @param new_fn [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/constructor.rb#107 + def constructor(new_fn = T.unsafe(nil), **options, &block); end + + # @api public + # @return [#call] + # + # source://dry-types//lib/dry/types/constructor.rb#13 + def fn; end + + # Build a lax type + # + # @api public + # @return [Lax] + # + # source://dry-types//lib/dry/types/constructor.rb#149 + def lax; end + + # Build a new constructor by prepending a block to the coercion function + # + # @api public + # @param new_fn [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/constructor.rb#140 + def prepend(new_fn = T.unsafe(nil), **options, &block); end + + # @api public + # @see Nominal#to_ast + # + # source://dry-types//lib/dry/types/constructor.rb#127 + def to_ast(meta: T.unsafe(nil)); end + + # Wrap the type with a proc + # + # @api public + # @return [Proc] + # + # source://dry-types//lib/dry/types/constructor.rb#156 + def to_proc; end + + # @api public + # @param input [Object] + # @param block [#call, nil] + # @return [Logic::Result, Types::Result] + # @return [Object] if block given and try fails + # + # source://dry-types//lib/dry/types/constructor.rb#89 + def try(input, &_arg1); end + + # @api public + # @return [Type] + # + # source://dry-types//lib/dry/types/constructor.rb#16 + def type; end + + private + + # Delegates missing methods to {#type} + # + # @api private + # @param method [Symbol] + # @param args [Array] + # @param block [#call, nil] + # + # source://dry-types//lib/dry/types/constructor.rb#176 + def method_missing(method, *_arg1, **_arg2, &_arg3); end + + # @api private + # @param meth [Symbol] + # @param include_private [Boolean] + # @return [Boolean] + # + # source://dry-types//lib/dry/types/constructor.rb#165 + def respond_to_missing?(meth, include_private = T.unsafe(nil)); end + + class << self + # @api public + # @param input [Builder, Object] + # @param options [Hash] + # @param block [#call, nil] + # + # source://dry-types//lib/dry/types/constructor.rb#35 + def [](type, fn:, **options); end + + # @api public + # @param input [Builder, Object] + # @param options [Hash] + # @param block [#call, nil] + # + # source://dry-types//lib/dry/types/constructor.rb#25 + def new(input, fn: T.unsafe(nil), **options, &block); end + + # @api private + # + # source://dry-types//lib/dry/types/constructor.rb#46 + def wrapper_type; end + end +end + +# Function is used internally by Constructor types +# +# @api private +# +# source://dry-types//lib/dry/types/constructor/function.rb#11 +class Dry::Types::Constructor::Function + include ::Dry::Core::Equalizer::Methods + + # @api private + # @return [Function] a new instance of Function + # + # source://dry-types//lib/dry/types/constructor/function.rb#167 + def initialize(fn); end + + # @api private + # @return [Function] + # + # source://dry-types//lib/dry/types/constructor/function.rb#196 + def <<(other); end + + # @api private + # @return [Function] + # + # source://dry-types//lib/dry/types/constructor/function.rb#190 + def >>(other); end + + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/constructor/function.rb#172 + def [](input, &_arg1); end + + # @api private + # @return [Integer] + # + # source://dry-types//lib/dry/types/constructor/function.rb#176 + def arity; end + + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/constructor/function.rb#172 + def call(input, &_arg1); end + + # @api private + # + # source://dry-types//lib/dry/types/constructor/function.rb#165 + def fn; end + + # @api private + # @return [Array] + # + # source://dry-types//lib/dry/types/constructor/function.rb#181 + def to_ast; end + + # @api private + # @return [Boolean] + # + # source://dry-types//lib/dry/types/constructor/function.rb#178 + def wrapper?; end + + class << self + # Choose or build specialized invokation code for a callable + # + # @api private + # @param fn [#call] + # @raise [::ArgumentError] + # @return [Function] + # + # source://dry-types//lib/dry/types/constructor/function.rb#135 + def [](fn); end + + # @api private + # @return [Boolean] + # + # source://dry-types//lib/dry/types/constructor/function.rb#152 + def yields_block?(fn); end + end +end + +# Coercion via a method call on a known object +# +# @api private +# +# source://dry-types//lib/dry/types/constructor/function.rb#26 +class Dry::Types::Constructor::Function::MethodCall < ::Dry::Types::Constructor::Function + # @api private + # @return [MethodCall] a new instance of MethodCall + # + # source://dry-types//lib/dry/types/constructor/function.rb#110 + def initialize(fn); end + + # @api private + # + # source://dry-types//lib/dry/types/constructor/function.rb#108 + def name; end + + # @api private + # + # source://dry-types//lib/dry/types/constructor/function.rb#108 + def target; end + + # @api private + # + # source://dry-types//lib/dry/types/constructor/function.rb#116 + def to_ast; end + + class << self + # @api private + # @return [MethodCall] + # + # source://dry-types//lib/dry/types/constructor/function.rb#103 + def [](fn, safe); end + + # Choose or build the base class + # + # @api private + # @return [Function] + # + # source://dry-types//lib/dry/types/constructor/function.rb#32 + def call_class(method, public, safe); end + end +end + +# Coercion via a private method call +# +# @api private +# +# source://dry-types//lib/dry/types/constructor/function.rb#85 +class Dry::Types::Constructor::Function::MethodCall::PrivateCall < ::Dry::Types::Constructor::Function::MethodCall + # @api private + # + # source://dry-types//lib/dry/types/constructor/function.rb#86 + def call(input, &_arg1); end +end + +# Coercion via an unsafe private method call +# +# @api private +# +# source://dry-types//lib/dry/types/constructor/function.rb#92 +class Dry::Types::Constructor::Function::MethodCall::PrivateSafeCall < ::Dry::Types::Constructor::Function::MethodCall::PrivateCall + # @api private + # + # source://dry-types//lib/dry/types/constructor/function.rb#93 + def call(input, &_arg1); end +end + +# Coercion with a publicly accessible method call +# +# @api private +# +# source://dry-types//lib/dry/types/constructor/function.rb#53 +class Dry::Types::Constructor::Function::MethodCall::PublicCall < ::Dry::Types::Constructor::Function::MethodCall + class << self + # Choose or build the interface + # + # @api private + # @return [::Module] + # + # source://dry-types//lib/dry/types/constructor/function.rb#59 + def call_interface(method, safe); end + end +end + +# Wrapper for unsafe coercion functions +# +# @api private +# +# source://dry-types//lib/dry/types/constructor/function.rb#15 +class Dry::Types::Constructor::Function::Safe < ::Dry::Types::Constructor::Function + # @api private + # + # source://dry-types//lib/dry/types/constructor/function.rb#16 + def call(input, &_arg1); end +end + +# @api private +# +# source://dry-types//lib/dry/types/constructor/function.rb#119 +class Dry::Types::Constructor::Function::Wrapper < ::Dry::Types::Constructor::Function + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/constructor/function.rb#121 + def [](input, type, &_arg2); end + + # @api private + # + # source://dry-types//lib/dry/types/constructor/function.rb#128 + def arity; end + + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/constructor/function.rb#121 + def call(input, type, &_arg2); end +end + +# @api public +# +# source://dry-types//lib/dry/types/constructor/wrapper.rb#7 +module Dry::Types::Constructor::Wrapper + # Build a new constructor by prepending a block to the coercion function + # + # @api public + # @param new_fn [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/constructor/wrapper.rb#56 + def <<(new_fn = T.unsafe(nil), **options, &block); end + + # Define a constructor for the type + # + # @api public + # @param constructor [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/builder.rb#138 + def >>(constructor = T.unsafe(nil), **options, &block); end + + # Define a constructor for the type + # + # @api public + # @param constructor [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/builder.rb#138 + def append(constructor = T.unsafe(nil), **options, &block); end + + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/constructor/wrapper.rb#11 + def call_safe(input, &_arg1); end + + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/constructor/wrapper.rb#16 + def call_unsafe(input); end + + # Define a constructor for the type + # + # @api public + # @param constructor [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/builder.rb#138 + def constructor(constructor = T.unsafe(nil), **options, &block); end + + # @api public + # @return [Constructor] + # + # source://dry-types//lib/dry/types/constructor/wrapper.rb#73 + def lax; end + + # Build a new constructor by prepending a block to the coercion function + # + # @api public + # @param new_fn [#call, nil] + # @param options [Hash] + # @param block [#call, nil] + # @return [Constructor] + # + # source://dry-types//lib/dry/types/constructor/wrapper.rb#56 + def prepend(new_fn = T.unsafe(nil), **options, &block); end + + # @api public + # @param input [Object] + # @param block [#call, nil] + # @return [Logic::Result, Types::Result] + # @return [Object] if block given and try fails + # + # source://dry-types//lib/dry/types/constructor/wrapper.rb#25 + def try(input, &_arg1); end + + private + + # Replace underlying type + # + # @api private + # + # source://dry-types//lib/dry/types/constructor/wrapper.rb#84 + def __new__(type); end +end + +# Internal container for the built-in types +# +# @api private +# +# source://dry-types//lib/dry/types/container.rb#8 +class Dry::Types::Container + include ::Dry::Core::Container::Mixin::Initializer + include ::Dry::Core::Container::Mixin + extend ::Dry::Core::Container::Configuration + + # source://dry-core/1.1.0/lib/dry/core/container/mixin.rb#83 + def config; end +end + +# Common API for types +# +# @api public +# +# source://dry-types//lib/dry/types/decorator.rb#8 +module Dry::Types::Decorator + include ::Dry::Types::Options + + # @api public + # @param type [Type] + # + # source://dry-types//lib/dry/types/decorator.rb#15 + def initialize(type, *_arg1, **_arg2); end + + # @api public + # @return [Boolean] + # + # source://dry-types//lib/dry/types/decorator.rb#37 + def constrained?; end + + # @api public + # @return [Boolean] + # + # source://dry-types//lib/dry/types/decorator.rb#32 + def default?; end + + # Wrap the type with a proc + # + # @api public + # @return [Proc] + # + # source://dry-types//lib/dry/types/decorator.rb#54 + def to_proc; end + + # @api public + # @param input [Object] + # @param block [#call, nil] + # @return [Result, Logic::Result] + # @return [Object] if block given and try fails + # + # source://dry-types//lib/dry/types/decorator.rb#27 + def try(input, &_arg1); end + + # @api public + # @return [Type] + # + # source://dry-types//lib/dry/types/decorator.rb#12 + def type; end + + private + + # Replace underlying type + # + # @api private + # + # source://dry-types//lib/dry/types/decorator.rb#89 + def __new__(type); end + + # @api private + # @param response [Object] + # @return [Boolean] + # + # source://dry-types//lib/dry/types/decorator.rb#63 + def decorate?(response); end + + # Delegates missing methods to {#type} + # + # @api private + # @param meth [Symbol] + # @param args [Array] + # @param block [#call, nil] + # + # source://dry-types//lib/dry/types/decorator.rb#72 + def method_missing(meth, *_arg1, **_arg2, &_arg3); end + + # @api public + # @param meth [Symbol] + # @param include_private [Boolean] + # @return [Boolean] + # + # source://dry-types//lib/dry/types/decorator.rb#45 + def respond_to_missing?(meth, include_private = T.unsafe(nil)); end +end + +# Default types are useful when a missing value should be replaced by a default one +# +# @api public +# +# source://dry-types//lib/dry/types/default.rb#8 +class Dry::Types::Default + include ::Dry::Types::Type + include ::Dry::Types::Options + include ::Dry::Types::Decorator + include ::Dry::Core::Constants + include ::Dry::Types::Builder + include ::Dry::Types::Printable + include ::Dry::Core::Equalizer::Methods + + # @api private + # @param type [Type] + # @param value [Object] + # @return [Default] a new instance of Default + # + # source://dry-types//lib/dry/types/default.rb#53 + def initialize(type, value, **_arg2); end + + # @api private + # @param input [Object] + # @return [Object] value passed through {#type} or {#default} value + # + # source://dry-types//lib/dry/types/default.rb#108 + def call_safe(input = T.unsafe(nil), &_arg1); end + + # @api private + # @param input [Object] + # @return [Object] value passed through {#type} or {#default} value + # + # source://dry-types//lib/dry/types/default.rb#95 + def call_unsafe(input = T.unsafe(nil)); end + + # @api private + # @return [false] + # + # source://dry-types//lib/dry/types/default.rb#119 + def callable?; end + + # Build a constrained type + # + # @api public + # @param args [Array] see {Dry::Types::Builder#constrained} + # @return [Default] + # + # source://dry-types//lib/dry/types/default.rb#65 + def constrained(*_arg0, **_arg1, &_arg2); end + + # @api public + # @return [true] + # + # source://dry-types//lib/dry/types/default.rb#70 + def default?; end + + # @api public + # @return [Object] + # + # source://dry-types//lib/dry/types/default.rb#32 + def evaluate; end + + # @api public + # @param input [Object] + # @return [Result::Success] + # + # source://dry-types//lib/dry/types/default.rb#77 + def try(input = T.unsafe(nil), &_arg1); end + + # @api public + # @return [Boolean] + # + # source://dry-types//lib/dry/types/default.rb#88 + def valid?(value = T.unsafe(nil)); end + + # @api public + # @return [Object] + # + # source://dry-types//lib/dry/types/default.rb#32 + def value; end + + class << self + # @api private + # @param value [Object, #call] + # @return [Class] {Default} or {Default::Callable} + # + # source://dry-types//lib/dry/types/default.rb#41 + def [](value); end + end +end + +# @api private +# +# source://dry-types//lib/dry/types/default.rb#10 +class Dry::Types::Default::Callable < ::Dry::Types::Default + # @api private + # @return [true] + # + # source://dry-types//lib/dry/types/default.rb#20 + def callable?; end + + # Evaluates given callable + # + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/default.rb#15 + def evaluate; end +end + +# @api public +Dry::Types::Definition = Dry::Types::Nominal + +# Enum types can be used to define an enum on top of an existing type +# +# @api public +# +# source://dry-types//lib/dry/types/enum.rb#8 +class Dry::Types::Enum + include ::Dry::Types::Type + include ::Dry::Core::Equalizer::Methods + include ::Dry::Types::Options + include ::Dry::Types::Decorator + include ::Dry::Core::Constants + include ::Dry::Types::Builder + + # @api private + # @option options + # @param type [Type] + # @param options [Hash] + # @return [Enum] a new instance of Enum + # + # source://dry-types//lib/dry/types/enum.rb#28 + def initialize(type, **options); end + + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/enum.rb#44 + def call_safe(input, &_arg1); end + + # @api private + # @return [Object] + # + # source://dry-types//lib/dry/types/enum.rb#39 + def call_unsafe(input); end + + # @api private + # + # source://dry-types//lib/dry/types/enum.rb#52 + def default(*_arg0); end + + # Iterate over each enum value + # + # @api public + # @return [Array, Enumerator] + # + # source://dry-types//lib/dry/types/enum.rb#77 + def each_value(&_arg0); end + + # Check whether a value is in the enum + # + # @api public + # + # source://dry-types//lib/dry/types/type.rb#18 + def include?(input = T.unsafe(nil)); end + + # @api public + # @return [String] + # + # source://dry-types//lib/dry/types/enum.rb#70 + def inspect; end + + # @api public + # @return [Hash] + # + # source://dry-types//lib/dry/types/enum.rb#21 + def inverted_mapping; end + + # @api private + # @return [String] + # + # source://dry-types//lib/dry/types/enum.rb#91 + def joined_values; end + + # @api public + # @return [Hash] + # + # source://dry-types//lib/dry/types/enum.rb#18 + def mapping; end + + # @api public + # @return [String] + # + # source://dry-types//lib/dry/types/enum.rb#86 + def name; end + + # @api public + # @see Nominal#to_ast + # + # source://dry-types//lib/dry/types/enum.rb#63 + def to_ast(meta: T.unsafe(nil)); end + + # @api public + # @return [String] + # + # source://dry-types//lib/dry/types/enum.rb#70 + def to_s; end + + # @api public + # @see Dry::Types::Constrained#try + # + # source://dry-types//lib/dry/types/enum.rb#49 + def try(input, &_arg1); end + + # @api public + # @return [Array] + # + # source://dry-types//lib/dry/types/enum.rb#15 + def values; end + + private + + # Maps a value + # + # @api private + # @param input [Object] + # @return [Object] + # + # source://dry-types//lib/dry/types/enum.rb#110 + def map_value(input); end +end + +# Internal container for constructor functions used by the built-in types +# +# @api private +# +# source://dry-types//lib/dry/types/fn_container.rb#8 +class Dry::Types::FnContainer + class << self + # @api private + # + # source://dry-types//lib/dry/types/fn_container.rb#23 + def [](fn_name); end + + # @api private + # + # source://dry-types//lib/dry/types/fn_container.rb#10 + def container; end + + # @api private + # + # source://dry-types//lib/dry/types/fn_container.rb#15 + def register(function = T.unsafe(nil), &block); end + + # @api private + # + # source://dry-types//lib/dry/types/fn_container.rb#32 + def register_name(function); end + end +end + +# Hash types can be used to define maps and schemas +# +# @api public +# +# source://dry-types//lib/dry/types/hash.rb#8 +class Dry::Types::Hash < ::Dry::Types::Nominal + # @api private + # + # source://dry-types//lib/dry/types/hash.rb#77 + def constructor_type; end + + # Build a map type + # + # @api public + # @param key_type [Type] + # @param value_type [Type] + # @return [Map] + # + # source://dry-types//lib/dry/types/hash.rb#40 + def map(key_type, value_type); end + + # @api private + # + # source://dry-types//lib/dry/types/hash.rb#50 + def permissive(*_arg0); end + + # @api public + # @overload schema + # @overload schema + # + # source://dry-types//lib/dry/types/hash.rb#22 + def schema(keys_or_map, meta = T.unsafe(nil)); end + + # @api private + # + # source://dry-types//lib/dry/types/hash.rb#50 + def strict(*_arg0); end + + # @api private + # + # source://dry-types//lib/dry/types/hash.rb#50 + def strict_with_defaults(*_arg0); end + + # @api private + # + # source://dry-types//lib/dry/types/hash.rb#50 + def symbolized(*_arg0); end + + # @api public + # @param meta [Boolean] Whether to dump the meta to the AST + # @return [Array] An AST representation + # + # source://dry-types//lib/dry/types/hash.rb#95 + def to_ast(meta: T.unsafe(nil)); end + + # Whether the type transforms types of schemas created by {Dry::Types::Hash#schema} + # + # @api public + # @return [Boolean] + # + # source://dry-types//lib/dry/types/hash.rb#86 + def transform_types?; end + + # @api private + # + # source://dry-types//lib/dry/types/hash.rb#50 + def weak(*_arg0); end + + # Injects a type transformation function for building schemas + # + # @api public + # @param proc [#call, nil] + # @param block [#call, nil] + # @raise [::ArgumentError] + # @return [Hash] + # + # source://dry-types//lib/dry/types/hash.rb#67 + def with_type_transform(proc = T.unsafe(nil), &block); end + + private + + # @api private + # + # source://dry-types//lib/dry/types/hash.rb#104 + def build_keys(type_map); end + + # @api private + # + # source://dry-types//lib/dry/types/hash.rb#125 + def key_name(key); end + + # @api private + # + # source://dry-types//lib/dry/types/hash.rb#116 + def resolve_type(type); end +end + +# @api public +# +# source://dry-types//lib/dry/types/hash/constructor.rb#9 +class Dry::Types::Hash::Constructor < ::Dry::Types::Constructor + # @api private + # + # source://dry-types//lib/dry/types/hash/constructor.rb#11 + def constructor_type; end + + # @api public + # @return [Lax] + # + # source://dry-types//lib/dry/types/hash/constructor.rb#16 + def lax; end + + # @api public + # @see Dry::Types::Array#of + # + # source://dry-types//lib/dry/types/hash/constructor.rb#21 + def schema(*_arg0, **_arg1, &_arg2); end +end + +# @api public +# +# source://dry-types//lib/dry/types/hash.rb#9 +Dry::Types::Hash::NOT_REQUIRED = T.let(T.unsafe(nil), Hash) + +# Implication type +# +# @api public +# +# source://dry-types//lib/dry/types/implication.rb#8 +class Dry::Types::Implication + include ::Dry::Types::Type + include ::Dry::Core::Constants + include ::Dry::Types::Builder + include ::Dry::Types::Options + include ::Dry::Types::Meta + include ::Dry::Types::Printable + include ::Dry::Core::Equalizer::Methods + include ::Dry::Types::Composition + + # @api private + # @param input [Object] + # @return [Object] + # + # source://dry-types//lib/dry/types/implication.rb#31 + def call_safe(input, &_arg1); end + + # @api private + # @param input [Object] + # @return [Object] + # + # source://dry-types//lib/dry/types/implication.rb#18 + def call_unsafe(input); end + + # @api private + # @param value [Object] + # @return [Boolean] + # + # source://dry-types//lib/dry/types/implication.rb#55 + def primitive?(value); end + + # @api public + # @param input [Object] + # + # source://dry-types//lib/dry/types/implication.rb#42 + def try(input, &_arg1); end + + class << self + # source://dry-types//lib/dry/types/composition.rb#40 + def ast_type; end + + # source://dry-types//lib/dry/types/composition.rb#41 + def composition_name; end + + # @api public + # + # source://dry-types//lib/dry/types/implication.rb#11 + def operator; end + end +end + +# source://dry-types//lib/dry/types/implication.rb#0 +class Dry::Types::Implication::Constrained < ::Dry::Types::Implication + include ::Dry::Types::Composition::Constrained +end + +# @api public +# +# source://dry-types//lib/dry/types/inflector.rb#7 +Dry::Types::Inflector = T.let(T.unsafe(nil), Dry::Inflector) + +# Intersection type +# +# @api public +# +# source://dry-types//lib/dry/types/intersection.rb#12 +class Dry::Types::Intersection + include ::Dry::Types::Type + include ::Dry::Core::Constants + include ::Dry::Types::Builder + include ::Dry::Types::Options + include ::Dry::Types::Meta + include ::Dry::Types::Printable + include ::Dry::Core::Equalizer::Methods + include ::Dry::Types::Composition + + # @api private + # @param input [Object] + # @return [Object] + # + # source://dry-types//lib/dry/types/intersection.rb#31 + def call_safe(input, &_arg1); end + + # @api private + # @param input [Object] + # @return [Object] + # + # source://dry-types//lib/dry/types/intersection.rb#22 + def call_unsafe(input); end + + # @api private + # @param value [Object] + # @return [Boolean] + # + # source://dry-types//lib/dry/types/intersection.rb#51 + def primitive?(value); end + + # @api public + # @param input [Object] + # + # source://dry-types//lib/dry/types/intersection.rb#36 + def try(input); end + + private + + # @api private + # + # source://dry-types//lib/dry/types/intersection.rb#90 + def merge_results(left_result, right_result); end + + # @api private + # + # source://dry-types//lib/dry/types/intersection.rb#72 + def try_side(side, input); end + + # @api private + # + # source://dry-types//lib/dry/types/intersection.rb#58 + def try_sides(input, &block); end + + class << self + # source://dry-types//lib/dry/types/composition.rb#40 + def ast_type; end + + # source://dry-types//lib/dry/types/composition.rb#41 + def composition_name; end + + # @api public + # + # source://dry-types//lib/dry/types/intersection.rb#15 + def operator; end + end +end + +# source://dry-types//lib/dry/types/intersection.rb#0 +class Dry::Types::Intersection::Constrained < ::Dry::Types::Intersection + include ::Dry::Types::Composition::Constrained +end + +# Primitives with {Kernel} coercion methods +# +# @api public +# +# source://dry-types//lib/dry/types/core.rb#6 +Dry::Types::KERNEL_COERCIBLE = T.let(T.unsafe(nil), Hash) + +# Lax types rescue from type-related errors when constructors fail +# +# @api public +# +# source://dry-types//lib/dry/types/lax.rb#8 +class Dry::Types::Lax + include ::Dry::Types::Type + include ::Dry::Types::Options + include ::Dry::Types::Decorator + include ::Dry::Core::Constants + include ::Dry::Types::Builder + include ::Dry::Types::Printable + include ::Dry::Core::Equalizer::Methods + + # @api public + # @param input [Object] + # @return [Object] + # + # source://dry-types//lib/dry/types/lax.rb#22 + def [](input, &_arg1); end + + # @api public + # @param input [Object] + # @return [Object] + # + # source://dry-types//lib/dry/types/lax.rb#22 + def call(input, &_arg1); end + + # @api public + # @param input [Object] + # @return [Object] + # + # source://dry-types//lib/dry/types/lax.rb#22 + def call_safe(input, &_arg1); end + + # @api public + # @param input [Object] + # @return [Object] + # + # source://dry-types//lib/dry/types/lax.rb#22 + def call_unsafe(input, &_arg1); end + + # @api public + # @return [Lax] + # + # source://dry-types//lib/dry/types/lax.rb#48 + def lax; end + + # @api public + # @see Nominal#to_ast + # + # source://dry-types//lib/dry/types/lax.rb#43 + def to_ast(meta: T.unsafe(nil)); end + + # @api public + # @param input [Object] + # @param block [#call, nil] + # @return [Result, Logic::Result] + # @yieldparam failure [Failure] + # @yieldreturn [Result] + # + # source://dry-types//lib/dry/types/lax.rb#38 + def try(input, &_arg1); end + + private + + # @api private + # @param response [Object, Dry::Types::Constructor] + # @return [Boolean] + # + # source://dry-types//lib/dry/types/lax.rb#57 + def decorate?(response); end +end + +# Primitives with coercions through by convention `to_*` methods +# +# @api public +# +# source://dry-types//lib/dry/types/core.rb#16 +Dry::Types::METHOD_COERCIBLE = T.let(T.unsafe(nil), Hash) + +# By convention methods to coerce {METHOD_COERCIBLE} primitives +# +# @api public +# +# source://dry-types//lib/dry/types/core.rb#21 +Dry::Types::METHOD_COERCIBLE_METHODS = T.let(T.unsafe(nil), Hash) + +# Homogeneous mapping. It describes a hash with unknown keys that match a certain type. +# +# @api public +# @example +# type = Dry::Types['hash'].map( +# Dry::Types['integer'].constrained(gteq: 1, lteq: 10), +# Dry::Types['string'] +# ) +# +# type.(1 => 'right') +# # => {1 => 'right'} +# +# type.('1' => 'wrong') +# # Dry::Types::MapError: "1" violates constraints (type?(Integer, "1") +# # AND gteq?(1, "1") +# # AND lteq?(10, "1") failed) +# +# type.(11 => 'wrong') +# # Dry::Types::MapError: 11 violates constraints (lteq?(10, 11) failed) +# +# source://dry-types//lib/dry/types/map.rb#25 +class Dry::Types::Map < ::Dry::Types::Nominal + # @api public + # @return [Map] a new instance of Map + # + # source://dry-types//lib/dry/types/map.rb#26 + def initialize(primitive, key_type: T.unsafe(nil), value_type: T.unsafe(nil), meta: T.unsafe(nil)); end + + # @api private + # @param hash [Hash] + # @return [Hash] + # + # source://dry-types//lib/dry/types/map.rb#61 + def call_safe(hash); end + + # @api private + # @param hash [Hash] + # @return [Hash] + # + # source://dry-types//lib/dry/types/map.rb#50 + def call_unsafe(hash); end + + # @api public + # @return [Boolean] + # + # source://dry-types//lib/dry/types/map.rb#90 + def constrained?; end + + # @api public + # @return [Type] + # + # source://dry-types//lib/dry/types/map.rb#33 + def key_type; end + + # @api public + # @return [String] + # + # source://dry-types//lib/dry/types/map.rb#43 + def name; end + + # @api public + # @param meta [Boolean] Whether to dump the meta to the AST + # @return [Array] An AST representation + # + # source://dry-types//lib/dry/types/map.rb#80 + def to_ast(meta: T.unsafe(nil)); end + + # @api public + # @param hash [Hash] + # @return [Result] + # @yield [result] + # + # source://dry-types//lib/dry/types/map.rb#68 + def try(hash); end + + # @api public + # @return [Type] + # + # source://dry-types//lib/dry/types/map.rb#38 + def value_type; end + + private + + # @api public + # + # source://dry-types//lib/dry/types/map.rb#125 + def assert_primitive(input); end + + # @api private + # + # source://dry-types//lib/dry/types/map.rb#96 + def coerce(input); end +end + +# @api public +# +# source://dry-types//lib/dry/types/errors.rb#85 +class Dry::Types::MapError < ::Dry::Types::CoercionError; end + +# Storage for meta-data +# +# @api public +# +# source://dry-types//lib/dry/types/meta.rb#8 +module Dry::Types::Meta + # @api public + # + # source://dry-types//lib/dry/types/meta.rb#9 + def initialize(*args, meta: T.unsafe(nil), **options); end + + # @api public + # @overload meta + # @overload meta + # + # source://dry-types//lib/dry/types/meta.rb#29 + def meta(data = T.unsafe(nil)); end + + # Resets meta + # + # @api public + # @return [Dry::Types::Type] + # + # source://dry-types//lib/dry/types/meta.rb#44 + def pristine; end + + # @api public + # @param options [Hash] new_options + # @return [Type] + # + # source://dry-types//lib/dry/types/meta.rb#19 + def with(**options); end +end + +# @api public +# +# source://dry-types//lib/dry/types/errors.rb#90 +class Dry::Types::MissingKeyError < ::Dry::Types::SchemaKeyError + # @api public + # @param key [String, Symbol] + # @return [MissingKeyError] a new instance of MissingKeyError + # + # source://dry-types//lib/dry/types/errors.rb#95 + def initialize(key); end + + # @api public + # @return [Symbol] + # + # source://dry-types//lib/dry/types/errors.rb#92 + def key; end +end + +# Export types registered in a container as module constants. +# +# @api public +# @example +# module Types +# include Dry.Types(:strict, :coercible, :nominal, default: :strict) +# end +# +# Types.constants +# # => [:Class, :Strict, :Symbol, :Integer, :Float, :String, :Array, :Hash, +# # :Decimal, :Nil, :True, :False, :Bool, :Date, :Nominal, :DateTime, :Range, +# # :Coercible, :Time] +# +# source://dry-types//lib/dry/types/module.rb#19 +class Dry::Types::Module < ::Module + # @api public + # @return [Module] a new instance of Module + # + # source://dry-types//lib/dry/types/module.rb#20 + def initialize(registry, *args, **kwargs); end + + # @api private + # + # source://dry-types//lib/dry/types/module.rb#74 + def registry_tree; end + + # @api private + # + # source://dry-types//lib/dry/types/module.rb#42 + def type_constants(*namespaces, default: T.unsafe(nil), **aliases); end + + private + + # @api private + # + # source://dry-types//lib/dry/types/module.rb#89 + def check_parameters(*namespaces, default: T.unsafe(nil), **aliases); end + + # @api private + # + # source://dry-types//lib/dry/types/module.rb#109 + def define_constants(constants, mod = T.unsafe(nil)); end +end + +# Collection of multiple errors +# +# @api public +# +# source://dry-types//lib/dry/types/errors.rb#48 +class Dry::Types::MultipleError < ::Dry::Types::CoercionError + # @api public + # @param errors [Array] + # @return [MultipleError] a new instance of MultipleError + # + # source://dry-types//lib/dry/types/errors.rb#53 + def initialize(errors); end + + # @api public + # @return [Array] + # + # source://dry-types//lib/dry/types/errors.rb#50 + def errors; end + + # @api public + # @return string + # + # source://dry-types//lib/dry/types/errors.rb#59 + def message; end + + # @api public + # @return [Array] + # + # source://dry-types//lib/dry/types/errors.rb#62 + def meta; end +end + +# Primitives that are non-coercible +# +# @api public +# +# source://dry-types//lib/dry/types/core.rb#26 +Dry::Types::NON_COERCIBLE = T.let(T.unsafe(nil), Hash) + +# All built-in primitives except {NilClass} +# +# @api public +# +# source://dry-types//lib/dry/types/core.rb#46 +Dry::Types::NON_NIL = T.let(T.unsafe(nil), Hash) + +# Nominal types define a primitive class and do not apply any constructors or constraints +# +# Use these types for annotations and the base for building more complex types on top of them. +# +# @api public +# +# source://dry-types//lib/dry/types/nominal.rb#10 +class Dry::Types::Nominal + include ::Dry::Types::Type + include ::Dry::Types::Options + include ::Dry::Types::Meta + include ::Dry::Core::Constants + include ::Dry::Types::Builder + include ::Dry::Types::Printable + include ::Dry::Core::Equalizer::Methods + + # @api private + # @param primitive [Type, Class] + # @param options [Hash] + # @return [Nominal] a new instance of Nominal + # + # source://dry-types//lib/dry/types/nominal.rb#42 + def initialize(primitive, **options); end + + # @api private + # @param input [BasicObject] + # @return [BasicObject] + # + # source://dry-types//lib/dry/types/nominal.rb#80 + def call_safe(input, &_arg1); end + + # @api private + # @param input [BasicObject] + # @return [BasicObject] + # + # source://dry-types//lib/dry/types/nominal.rb#73 + def call_unsafe(input); end + + # @api private + # + # source://dry-types//lib/dry/types/nominal.rb#121 + def coerce(input, &_arg1); end + + # @api public + # @return [false] + # + # source://dry-types//lib/dry/types/nominal.rb#61 + def constrained?; end + + # @api public + # @return [false] + # + # source://dry-types//lib/dry/types/nominal.rb#56 + def default?; end + + # @api public + # @raise [::ArgumentError] + # @return [Result::Failure] + # + # source://dry-types//lib/dry/types/nominal.rb#105 + def failure(input, error); end + + # Return self. Nominal types are lax by definition + # + # @api public + # @return [Nominal] + # + # source://dry-types//lib/dry/types/nominal.rb#163 + def lax; end + + # @api public + # @return [String] + # + # source://dry-types//lib/dry/types/nominal.rb#51 + def name; end + + # @api public + # @return [false] + # + # source://dry-types//lib/dry/types/nominal.rb#66 + def optional?; end + + # @api public + # @return [Class] + # + # source://dry-types//lib/dry/types/nominal.rb#19 + def primitive; end + + # Checks whether value is of a #primitive class + # + # @api public + # @param value [Object] + # @return [Boolean] + # + # source://dry-types//lib/dry/types/nominal.rb#118 + def primitive?(value); end + + # @api public + # @return [Result::Success] + # + # source://dry-types//lib/dry/types/nominal.rb#98 + def success(input); end + + # Return AST representation of a type nominal + # + # @api public + # @return [Array] + # + # source://dry-types//lib/dry/types/nominal.rb#154 + def to_ast(meta: T.unsafe(nil)); end + + # Wrap the type with a proc + # + # @api public + # @return [Proc] + # + # source://dry-types//lib/dry/types/nominal.rb#170 + def to_proc; end + + # @api public + # @param input [Object] + # @return [Result, Logic::Result] when a block is not provided + # @return [nil] otherwise + # @yieldparam failure [Failure] + # @yieldreturn [Result] + # + # source://dry-types//lib/dry/types/nominal.rb#91 + def try(input, &_arg1); end + + # @api private + # + # source://dry-types//lib/dry/types/nominal.rb#132 + def try_coerce(input); end + + class << self + # @api private + # @param primitive [Class] + # @return [Type] + # + # source://dry-types//lib/dry/types/nominal.rb#26 + def [](primitive); end + end +end + +# @api public +# +# source://dry-types//lib/dry/types/nominal.rb#36 +Dry::Types::Nominal::ALWAYS = T.let(T.unsafe(nil), Proc) + +# Common API for types with options +# +# @api private +# +# source://dry-types//lib/dry/types/options.rb#8 +module Dry::Types::Options + # @api private + # @see Nominal#initialize + # + # source://dry-types//lib/dry/types/options.rb#15 + def initialize(*args, **options); end + + # @api private + # @return [Hash] + # + # source://dry-types//lib/dry/types/options.rb#10 + def options; end + + # @api private + # @param new_options [Hash] + # @return [Type] + # + # source://dry-types//lib/dry/types/options.rb#25 + def with(**new_options); end +end + +# source://dry-types//lib/dry/types/printer.rb#293 +Dry::Types::PRINTER = T.let(T.unsafe(nil), Dry::Types::Printer) + +# PredicateInferrer returns the list of predicates used by a type. +# +# @api public +# +# source://dry-types//lib/dry/types/predicate_inferrer.rb#8 +class Dry::Types::PredicateInferrer + include ::Dry::Core::Cache::Methods + extend ::Dry::Core::Cache + + # @api private + # @return [PredicateInferrer] a new instance of PredicateInferrer + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#212 + def initialize(registry = T.unsafe(nil)); end + + # Infer predicate identifier from the provided type + # + # @api private + # @param type [Type] + # @return [Symbol] + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#222 + def [](type); end + + # @api private + # @return [Compiler] + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#209 + def compiler; end +end + +# @api public +# +# source://dry-types//lib/dry/types/predicate_inferrer.rb#31 +Dry::Types::PredicateInferrer::ARRAY = T.let(T.unsafe(nil), Array) + +# Compiler reduces type AST into a list of predicates +# +# @api private +# +# source://dry-types//lib/dry/types/predicate_inferrer.rb#38 +class Dry::Types::PredicateInferrer::Compiler + extend ::Dry::Core::Constants + extend ::Dry::Core::ClassAttributes + + # @api private + # @return [Compiler] a new instance of Compiler + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#49 + def initialize(registry); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#54 + def infer_predicate(type); end + + # @api private + # @return [PredicateRegistry] + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#46 + def registry; end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#89 + def visit(node); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#163 + def visit_and(node); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#160 + def visit_any(_); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#113 + def visit_array(_); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#148 + def visit_constrained(node); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#123 + def visit_constructor(node); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#129 + def visit_enum(node); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#107 + def visit_hash(_); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#118 + def visit_lax(node); end + + # @api private + # @raise [::NotImplementedError] + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#187 + def visit_map(_node); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#95 + def visit_nominal(node); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#169 + def visit_predicate(node); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#107 + def visit_schema(_); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#135 + def visit_sum(node); end + + private + + # @api private + # + # source://dry-types//lib/dry/types/predicate_inferrer.rb#194 + def merge_predicates(nodes); end +end + +# @api public +# +# source://dry-types//lib/dry/types/predicate_inferrer.rb#29 +Dry::Types::PredicateInferrer::HASH = T.let(T.unsafe(nil), Array) + +# @api public +# +# source://dry-types//lib/dry/types/predicate_inferrer.rb#33 +Dry::Types::PredicateInferrer::NIL = T.let(T.unsafe(nil), Array) + +# @api public +# +# source://dry-types//lib/dry/types/predicate_inferrer.rb#25 +Dry::Types::PredicateInferrer::REDUCED_TYPES = T.let(T.unsafe(nil), Hash) + +# @api public +# +# source://dry-types//lib/dry/types/predicate_inferrer.rb#11 +Dry::Types::PredicateInferrer::TYPE_TO_PREDICATE = T.let(T.unsafe(nil), Hash) + +# A registry with predicate objects from `Dry::Logic::Predicates` +# +# @api private +# +# source://dry-types//lib/dry/types/predicate_registry.rb#8 +class Dry::Types::PredicateRegistry + # @api private + # @return [PredicateRegistry] a new instance of PredicateRegistry + # + # source://dry-types//lib/dry/types/predicate_registry.rb#19 + def initialize(predicates = T.unsafe(nil)); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_registry.rb#29 + def [](name); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_registry.rb#13 + def has_predicate; end + + # @api private + # @return [Boolean] + # + # source://dry-types//lib/dry/types/predicate_registry.rb#24 + def key?(name); end + + # @api private + # + # source://dry-types//lib/dry/types/predicate_registry.rb#10 + def predicates; end +end + +# @api private +# +# source://dry-types//lib/dry/types/predicate_registry.rb#15 +Dry::Types::PredicateRegistry::KERNEL_RESPOND_TO = T.let(T.unsafe(nil), UnboundMethod) + +# PrimitiveInferrer returns the list of classes matching a type. +# +# @api public +# +# source://dry-types//lib/dry/types/primitive_inferrer.rb#8 +class Dry::Types::PrimitiveInferrer + include ::Dry::Core::Cache::Methods + extend ::Dry::Core::Cache + + # @api private + # @return [PrimitiveInferrer] a new instance of PrimitiveInferrer + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#71 + def initialize; end + + # Infer primitives from the provided type + # + # @api private + # @return [Array[Class]] + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#80 + def [](type); end + + # @api private + # @return [Compiler] + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#68 + def compiler; end +end + +# Compiler reduces type AST into a list of primitives +# +# @api private +# +# source://dry-types//lib/dry/types/primitive_inferrer.rb#14 +class Dry::Types::PrimitiveInferrer::Compiler + # @api private + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#16 + def visit(node); end + + # @api private + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#63 + def visit_any(_); end + + # @api private + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#32 + def visit_array(_); end + + # @api private + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#57 + def visit_constrained(node); end + + # @api private + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#38 + def visit_constructor(node); end + + # @api private + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#44 + def visit_enum(node); end + + # @api private + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#28 + def visit_hash(_); end + + # @api private + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#35 + def visit_lax(node); end + + # @api private + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#22 + def visit_nominal(node); end + + # @api private + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#28 + def visit_schema(_); end + + # @api private + # + # source://dry-types//lib/dry/types/primitive_inferrer.rb#50 + def visit_sum(node); end +end + +# @api private +# +# source://dry-types//lib/dry/types/printable.rb#6 +module Dry::Types::Printable + # @api private + # @return [String] + # + # source://dry-types//lib/dry/types/printable.rb#10 + def inspect; end + + # @api private + # @return [String] + # + # source://dry-types//lib/dry/types/printable.rb#10 + def to_s; end +end + +# @api private +# +# source://dry-types//lib/dry/types/printer/composition.rb#6 +class Dry::Types::Printer + # @api private + # @return [Printer] a new instance of Printer + # + # source://dry-types//lib/dry/types/printer.rb#38 + def initialize; end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#43 + def call(type); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#49 + def visit(type, &_arg1); end + + # @api private + # @yield ["Any"] + # + # source://dry-types//lib/dry/types/printer.rb#62 + def visit_any(_); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#64 + def visit_array(type); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#70 + def visit_array_member(array); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#152 + def visit_callable(callable); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#102 + def visit_composition(composition, &_arg1); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#91 + def visit_constrained(constrained); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#78 + def visit_constructor(constructor); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#126 + def visit_default(default); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#108 + def visit_enum(enum); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#250 + def visit_hash(hash); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#240 + def visit_key(key); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#146 + def visit_lax(lax); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#226 + def visit_map(map); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#140 + def visit_nominal(type); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#269 + def visit_options(options, meta = T.unsafe(nil)); end + + # @api private + # + # source://dry-types//lib/dry/types/printer.rb#187 + def visit_schema(schema); end + + # source://dry-types//lib/dry/types/printer.rb#78 + def visit_struct_constructor(constructor); end + + # source://dry-struct/1.8.0/lib/dry/struct/printer.rb#12 + def visit_struct_sum(sum); end +end + +# @api private +# +# source://dry-types//lib/dry/types/printer/composition.rb#8 +class Dry::Types::Printer::Composition + # @api private + # @return [Composition] a new instance of Composition + # + # source://dry-types//lib/dry/types/printer/composition.rb#9 + def initialize(printer, composition_class); end + + # @api private + # + # source://dry-types//lib/dry/types/printer/composition.rb#15 + def visit(composition); end + + private + + # @api private + # + # source://dry-types//lib/dry/types/printer/composition.rb#33 + def visit_constructor(type, &_arg1); end + + # @api private + # + # source://dry-types//lib/dry/types/printer/composition.rb#25 + def visit_constructors(composition); end +end + +# @api private +# +# source://dry-types//lib/dry/types/printer.rb#11 +Dry::Types::Printer::MAPPING = T.let(T.unsafe(nil), Hash) + +# Result class used by {Type#try} +# +# @api public +# +# source://dry-types//lib/dry/types/result.rb#8 +class Dry::Types::Result + include ::Dry::Core::Equalizer::Methods + + # @api private + # @param input [Object] + # @return [Result] a new instance of Result + # + # source://dry-types//lib/dry/types/result.rb#17 + def initialize(input); end + + # @api public + # @return [Object] + # + # source://dry-types//lib/dry/types/result.rb#12 + def input; end +end + +# Failure result +# +# @api public +# +# source://dry-types//lib/dry/types/result.rb#39 +class Dry::Types::Result::Failure < ::Dry::Types::Result + # @api private + # @param input [Object] + # @param error [#to_s] + # @return [Failure] a new instance of Failure + # + # source://dry-types//lib/dry/types/result.rb#50 + def initialize(input, error); end + + # @api public + # @return [#to_s] + # + # source://dry-types//lib/dry/types/result.rb#43 + def error; end + + # @api public + # @return [true] + # + # source://dry-types//lib/dry/types/result.rb#68 + def failure?; end + + # @api public + # @return [false] + # + # source://dry-types//lib/dry/types/result.rb#63 + def success?; end + + # @api private + # @return [String] + # + # source://dry-types//lib/dry/types/result.rb#58 + def to_s; end +end + +# Success result +# +# @api public +# +# source://dry-types//lib/dry/types/result.rb#24 +class Dry::Types::Result::Success < ::Dry::Types::Result + # @api public + # @return [false] + # + # source://dry-types//lib/dry/types/result.rb#33 + def failure?; end + + # @api public + # @return [true] + # + # source://dry-types//lib/dry/types/result.rb#28 + def success?; end +end + +# @api public +Dry::Types::Safe = Dry::Types::Lax + +# The built-in Hash type can be defined in terms of keys and associated types +# its values can contain. Such definitions are named {Schema}s and defined +# as lists of {Key} types. +# +# {Schema} evaluates default values for keys missing in input hash +# +# {Schema} implements Enumerable using its keys as collection. +# +# @api public +# @see Dry::Types::Schema::Key +# @see Dry::Types::Default#evaluate +# @see Dry::Types::Default::Callable#evaluate +# +# source://dry-types//lib/dry/types/schema.rb#19 +class Dry::Types::Schema < ::Dry::Types::Hash + include ::Enumerable + + # @api private + # @option options + # @option options + # @param _primitive [Class] + # @param options [Hash] + # @return [Schema] a new instance of Schema + # + # source://dry-types//lib/dry/types/schema.rb#41 + def initialize(_primitive, **options); end + + # @api public + # @option options + # @option options + # @param hash [Hash] + # @param options [Hash] a customizable set of options + # @return [Hash{Symbol => Object}] + # + # source://dry-types//lib/dry/types/schema.rb#80 + def apply(hash, options = T.unsafe(nil)); end + + # @api private + # @param hash [Hash] + # @return [Hash{Symbol => Object}] + # + # source://dry-types//lib/dry/types/schema.rb#68 + def call_safe(hash, options = T.unsafe(nil)); end + + # @api private + # @param hash [Hash] + # @return [Hash{Symbol => Object}] + # + # source://dry-types//lib/dry/types/schema.rb#59 + def call_unsafe(hash, options = T.unsafe(nil)); end + + # Empty schema with the same options + # + # @api public + # @return [Schema] + # + # source://dry-types//lib/dry/types/schema.rb#296 + def clear; end + + # @api public + # @return [Boolean] + # + # source://dry-types//lib/dry/types/schema.rb#268 + def constrained?; end + + # Iterate over each key type + # + # @api public + # @return [Array, Enumerator] + # + # source://dry-types//lib/dry/types/schema.rb#227 + def each(&_arg0); end + + # Fetch key type by a key name + # + # Behaves as ::Hash#fetch + # + # @api public + # @overload key + # @overload key + # + # source://dry-types//lib/dry/types/schema.rb#257 + def key(name, fallback = T.unsafe(nil), &_arg2); end + + # Whether the schema has the given key + # + # @api public + # @param name [Symbol] Key name + # @return [Boolean] + # + # source://dry-types//lib/dry/types/schema.rb#238 + def key?(name); end + + # @api public + # @return [Array[Dry::Types::Schema::Key]] + # + # source://dry-types//lib/dry/types/schema.rb#26 + def keys; end + + # @api public + # @return [Lax] + # + # source://dry-types//lib/dry/types/schema.rb#275 + def lax; end + + # Merge given schema keys into current schema + # + # A new instance is returned. + # + # @api public + # @param other [Schema] schema + # @return [Schema] + # + # source://dry-types//lib/dry/types/schema.rb#287 + def merge(other); end + + # @api public + # @return [Hash[Symbol, Dry::Types::Schema::Key]] + # + # source://dry-types//lib/dry/types/schema.rb#29 + def name_key_map; end + + # @api public + # @overload schema + # @overload schema + # + # source://dry-types//lib/dry/types/schema.rb#211 + def schema(keys_or_map); end + + # Make the schema intolerant to unknown keys + # + # @api public + # @return [Schema] + # + # source://dry-types//lib/dry/types/schema.rb#170 + def strict(strict = T.unsafe(nil)); end + + # Whether the schema rejects unknown keys + # + # @api public + # @return [Boolean] + # + # source://dry-types//lib/dry/types/schema.rb#161 + def strict?; end + + # @api public + # @param meta [Boolean] Whether to dump the meta to the AST + # @return [Array] An AST representation + # + # source://dry-types//lib/dry/types/schema.rb#147 + def to_ast(meta: T.unsafe(nil)); end + + # @api public + # @return [#call] + # + # source://dry-types//lib/dry/types/schema.rb#32 + def transform_key; end + + # Whether the schema transforms input keys + # + # @api public + # @return [Boolean] + # + # source://dry-types//lib/dry/types/schema.rb#196 + def transform_keys?; end + + # @api public + # @param input [Hash] hash + # @return [Logic::Result] + # @return [Object] if coercion fails and a block is given + # @yieldparam failure [Failure] + # @yieldreturn [Result] + # + # source://dry-types//lib/dry/types/schema.rb#93 + def try(input); end + + # Inject a key transformation function + # + # @api public + # @param proc [#call, nil] + # @param block [#call, nil] + # @raise [::ArgumentError] + # @return [Schema] + # + # source://dry-types//lib/dry/types/schema.rb#182 + def with_key_transform(proc = T.unsafe(nil), &block); end + + private + + # @api private + # @param keys [Array] + # @return [Dry::Types::Schema] + # + # source://dry-types//lib/dry/types/schema.rb#307 + def merge_keys(*keys); end + + # @api private + # @return [MissingKeyError] + # + # source://dry-types//lib/dry/types/schema.rb#403 + def missing_key(key); end + + # Try to add missing keys to the hash + # + # @api private + # + # source://dry-types//lib/dry/types/schema.rb#371 + def resolve_missing_keys(hash, options); end + + # Validate and coerce a hash. Call a block and halt on any error + # + # @api private + # @return [Hash] + # + # source://dry-types//lib/dry/types/schema.rb#349 + def resolve_safe(hash, options = T.unsafe(nil), &block); end + + # Validate and coerce a hash. Raise an exception on any error + # + # @api private + # @return [Hash] + # + # source://dry-types//lib/dry/types/schema.rb#319 + def resolve_unsafe(hash, options = T.unsafe(nil)); end + + # @api private + # @param hash_keys [Array] + # @return [UnknownKeysError] + # + # source://dry-types//lib/dry/types/schema.rb#395 + def unexpected_keys(hash_keys); end +end + +# Proxy type for schema keys. Contains only key name and +# whether it's required or not. All other calls deletaged +# to the wrapped type. +# +# @api public +# @see Dry::Types::Schema +# +# source://dry-types//lib/dry/types/schema/key.rb#14 +class Dry::Types::Schema::Key + include ::Dry::Types::Type + include ::Dry::Core::Equalizer::Methods + include ::Dry::Types::Options + include ::Dry::Types::Decorator + include ::Dry::Core::Constants + include ::Dry::Types::Builder + include ::Dry::Types::Printable + extend ::Dry::Core::Deprecations::Interface + + # @api private + # @return [Key] a new instance of Key + # + # source://dry-types//lib/dry/types/schema/key.rb#26 + def initialize(type, name, required: T.unsafe(nil), **options); end + + # @api private + # + # source://dry-types//lib/dry/types/schema/key.rb#41 + def call_safe(input, &_arg1); end + + # @api private + # + # source://dry-types//lib/dry/types/schema/key.rb#44 + def call_unsafe(input); end + + # Turn key into a lax type. Lax types are not strict hence such keys are not required + # + # @api public + # @return [Lax] + # + # source://dry-types//lib/dry/types/schema/key.rb#90 + def lax; end + + # @api public + # @see Dry::Types::Meta#meta + # + # source://dry-types//lib/dry/types/schema/key.rb#118 + def meta(data = T.unsafe(nil)); end + + # @api public + # @return [Symbol] + # + # source://dry-types//lib/dry/types/schema/key.rb#23 + def name; end + + # Make key not required + # + # @api public + # @return [Dry::Types::Schema::Key] + # + # source://dry-types//lib/dry/types/schema/key.rb#83 + def omittable; end + + # Make wrapped type optional + # + # @api public + # @return [Key] + # + # source://dry-types//lib/dry/types/schema/key.rb#97 + def optional; end + + # Control whether the key is required + # + # @api public + # @overload required + # @overload required + # + # source://dry-types//lib/dry/types/schema/key.rb#70 + def required(required = T.unsafe(nil)); end + + # Whether the key is required in schema input + # + # @api public + # @return [Boolean] + # + # source://dry-types//lib/dry/types/schema/key.rb#56 + def required?; end + + # Dump to internal AST representation + # + # @api public + # @return [Array] + # + # source://dry-types//lib/dry/types/schema/key.rb#104 + def to_ast(meta: T.unsafe(nil)); end + + # @api public + # @see Dry::Types::Nominal#try + # + # source://dry-types//lib/dry/types/schema/key.rb#49 + def try(input, &_arg1); end + + private + + # @api private + # @return [Boolean] + # + # source://dry-types//lib/dry/types/schema/key.rb#134 + def decorate?(response); end +end + +# @api public +# +# source://dry-types//lib/dry/types/schema.rb#20 +Dry::Types::Schema::NO_TRANSFORM = T.let(T.unsafe(nil), String) + +# @api public +# +# source://dry-types//lib/dry/types/schema.rb#21 +Dry::Types::Schema::SYMBOLIZE_KEY = T.let(T.unsafe(nil), String) + +# @api public +# +# source://dry-types//lib/dry/types/errors.rb#65 +class Dry::Types::SchemaError < ::Dry::Types::CoercionError + # @api public + # @param key [String, Symbol] + # @param value [Object] + # @param result [String, #to_s] + # @return [SchemaError] a new instance of SchemaError + # + # source://dry-types//lib/dry/types/errors.rb#75 + def initialize(key, value, result); end + + # @api public + # @return [String, Symbol] + # + # source://dry-types//lib/dry/types/errors.rb#67 + def key; end + + # @api public + # @return [Object] + # + # source://dry-types//lib/dry/types/errors.rb#70 + def value; end +end + +# @api public +# +# source://dry-types//lib/dry/types/errors.rb#87 +class Dry::Types::SchemaKeyError < ::Dry::Types::CoercionError; end + +# Sum type +# +# @api public +# +# source://dry-types//lib/dry/types/sum.rb#8 +class Dry::Types::Sum + include ::Dry::Types::Type + include ::Dry::Core::Constants + include ::Dry::Types::Builder + include ::Dry::Types::Options + include ::Dry::Types::Meta + include ::Dry::Types::Printable + include ::Dry::Core::Equalizer::Methods + include ::Dry::Types::Composition + + # @api private + # @param input [Object] + # @return [Object] + # + # source://dry-types//lib/dry/types/sum.rb#32 + def call_safe(input, &block); end + + # @api private + # @param input [Object] + # @return [Object] + # + # source://dry-types//lib/dry/types/sum.rb#23 + def call_unsafe(input); end + + # @api public + # @param options [Hash] + # @return [Constrained, Sum] + # @see Builder#constrained + # + # source://dry-types//lib/dry/types/sum.rb#83 + def constrained(*_arg0, **_arg1, &_arg2); end + + # Manage metadata to the type. If the type is an optional, #meta delegates + # to the right branch + # + # @api public + # @see [Meta#meta] + # + # source://dry-types//lib/dry/types/sum.rb#66 + def meta(data = T.unsafe(nil)); end + + # @api public + # @return [Boolean] + # + # source://dry-types//lib/dry/types/sum.rb#16 + def optional?; end + + # @api private + # @param value [Object] + # @return [Boolean] + # + # source://dry-types//lib/dry/types/sum.rb#56 + def primitive?(value); end + + # @api public + # @param input [Object] + # + # source://dry-types//lib/dry/types/sum.rb#39 + def try(input); end + + class << self + # source://dry-types//lib/dry/types/composition.rb#40 + def ast_type; end + + # source://dry-types//lib/dry/types/composition.rb#41 + def composition_name; end + + # @api public + # + # source://dry-types//lib/dry/types/sum.rb#11 + def operator; end + end +end + +# source://dry-types//lib/dry/types/sum.rb#0 +class Dry::Types::Sum::Constrained < ::Dry::Types::Sum + include ::Dry::Types::Composition::Constrained +end + +# @api public +# +# source://dry-types//lib/dry/types.rb#31 +Dry::Types::TYPE_SPEC_REGEX = T.let(T.unsafe(nil), Regexp) + +# Common Type module denoting an object is a Type +# +# @api public +# +# source://dry-types//lib/dry/types/type.rb#8 +module Dry::Types::Type + extend ::Dry::Core::Deprecations::Interface + + # Whether a value is a valid member of the type + # Anything can be coerced matches + # + # @api private + # @return [Boolean] + # + # source://dry-types//lib/dry/types/type.rb#18 + def ===(input = T.unsafe(nil)); end + + # Apply type to a value + # + # @api public + # @overload call + # @overload call + # + # source://dry-types//lib/dry/types/type.rb#43 + def [](input = T.unsafe(nil), &_arg1); end + + # Apply type to a value + # + # @api public + # @overload call + # @overload call + # + # source://dry-types//lib/dry/types/type.rb#43 + def call(input = T.unsafe(nil), &_arg1); end + + # source://dry-core/1.1.0/lib/dry/core/deprecations.rb#168 + def safe(*args, &block); end + + # Whether a value is a valid member of the type + # + # @api private + # @return [Boolean] + # + # source://dry-types//lib/dry/types/type.rb#18 + def valid?(input = T.unsafe(nil)); end +end + +# @api public +# +# source://dry-types//lib/dry/types/errors.rb#101 +class Dry::Types::UnknownKeysError < ::Dry::Types::SchemaKeyError + # @api public + # @param keys [] + # @return [UnknownKeysError] a new instance of UnknownKeysError + # + # source://dry-types//lib/dry/types/errors.rb#106 + def initialize(keys); end + + # @api public + # @return [Array] + # + # source://dry-types//lib/dry/types/errors.rb#103 + def keys; end +end + +# source://dry-types//lib/dry/types/version.rb#5 +Dry::Types::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/faraday-multipart@1.1.1.rbi b/sorbet/rbi/gems/faraday-multipart@1.1.1.rbi new file mode 100644 index 00000000..915b0780 --- /dev/null +++ b/sorbet/rbi/gems/faraday-multipart@1.1.1.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `faraday-multipart` gem. +# Please instead update this file by running `bin/tapioca gem faraday-multipart`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/faraday-net_http@3.4.1.rbi b/sorbet/rbi/gems/faraday-net_http@3.4.1.rbi new file mode 100644 index 00000000..e3b0e690 --- /dev/null +++ b/sorbet/rbi/gems/faraday-net_http@3.4.1.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `faraday-net_http` gem. +# Please instead update this file by running `bin/tapioca gem faraday-net_http`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/faraday@2.13.4.rbi b/sorbet/rbi/gems/faraday@2.13.4.rbi new file mode 100644 index 00000000..e41d6821 --- /dev/null +++ b/sorbet/rbi/gems/faraday@2.13.4.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `faraday` gem. +# Please instead update this file by running `bin/tapioca gem faraday`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/ice_nine@0.11.2.rbi b/sorbet/rbi/gems/ice_nine@0.11.2.rbi new file mode 100644 index 00000000..095e58f0 --- /dev/null +++ b/sorbet/rbi/gems/ice_nine@0.11.2.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `ice_nine` gem. +# Please instead update this file by running `bin/tapioca gem ice_nine`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/json@2.13.2.rbi b/sorbet/rbi/gems/json@2.13.2.rbi new file mode 100644 index 00000000..c4a77114 --- /dev/null +++ b/sorbet/rbi/gems/json@2.13.2.rbi @@ -0,0 +1,2032 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `json` gem. +# Please instead update this file by running `bin/tapioca gem json`. + + +# = JavaScript \Object Notation (\JSON) +# +# \JSON is a lightweight data-interchange format. +# +# A \JSON value is one of the following: +# - Double-quoted text: "foo". +# - Number: +1+, +1.0+, +2.0e2+. +# - Boolean: +true+, +false+. +# - Null: +null+. +# - \Array: an ordered list of values, enclosed by square brackets: +# ["foo", 1, 1.0, 2.0e2, true, false, null] +# +# - \Object: a collection of name/value pairs, enclosed by curly braces; +# each name is double-quoted text; +# the values may be any \JSON values: +# {"a": "foo", "b": 1, "c": 1.0, "d": 2.0e2, "e": true, "f": false, "g": null} +# +# A \JSON array or object may contain nested arrays, objects, and scalars +# to any depth: +# {"foo": {"bar": 1, "baz": 2}, "bat": [0, 1, 2]} +# [{"foo": 0, "bar": 1}, ["baz", 2]] +# +# == Using \Module \JSON +# +# To make module \JSON available in your code, begin with: +# require 'json' +# +# All examples here assume that this has been done. +# +# === Parsing \JSON +# +# You can parse a \String containing \JSON data using +# either of two methods: +# - JSON.parse(source, opts) +# - JSON.parse!(source, opts) +# +# where +# - +source+ is a Ruby object. +# - +opts+ is a \Hash object containing options +# that control both input allowed and output formatting. +# +# The difference between the two methods +# is that JSON.parse! omits some checks +# and may not be safe for some +source+ data; +# use it only for data from trusted sources. +# Use the safer method JSON.parse for less trusted sources. +# +# ==== Parsing \JSON Arrays +# +# When +source+ is a \JSON array, JSON.parse by default returns a Ruby \Array: +# json = '["foo", 1, 1.0, 2.0e2, true, false, null]' +# ruby = JSON.parse(json) +# ruby # => ["foo", 1, 1.0, 200.0, true, false, nil] +# ruby.class # => Array +# +# The \JSON array may contain nested arrays, objects, and scalars +# to any depth: +# json = '[{"foo": 0, "bar": 1}, ["baz", 2]]' +# JSON.parse(json) # => [{"foo"=>0, "bar"=>1}, ["baz", 2]] +# +# ==== Parsing \JSON \Objects +# +# When the source is a \JSON object, JSON.parse by default returns a Ruby \Hash: +# json = '{"a": "foo", "b": 1, "c": 1.0, "d": 2.0e2, "e": true, "f": false, "g": null}' +# ruby = JSON.parse(json) +# ruby # => {"a"=>"foo", "b"=>1, "c"=>1.0, "d"=>200.0, "e"=>true, "f"=>false, "g"=>nil} +# ruby.class # => Hash +# +# The \JSON object may contain nested arrays, objects, and scalars +# to any depth: +# json = '{"foo": {"bar": 1, "baz": 2}, "bat": [0, 1, 2]}' +# JSON.parse(json) # => {"foo"=>{"bar"=>1, "baz"=>2}, "bat"=>[0, 1, 2]} +# +# ==== Parsing \JSON Scalars +# +# When the source is a \JSON scalar (not an array or object), +# JSON.parse returns a Ruby scalar. +# +# \String: +# ruby = JSON.parse('"foo"') +# ruby # => 'foo' +# ruby.class # => String +# \Integer: +# ruby = JSON.parse('1') +# ruby # => 1 +# ruby.class # => Integer +# \Float: +# ruby = JSON.parse('1.0') +# ruby # => 1.0 +# ruby.class # => Float +# ruby = JSON.parse('2.0e2') +# ruby # => 200 +# ruby.class # => Float +# Boolean: +# ruby = JSON.parse('true') +# ruby # => true +# ruby.class # => TrueClass +# ruby = JSON.parse('false') +# ruby # => false +# ruby.class # => FalseClass +# Null: +# ruby = JSON.parse('null') +# ruby # => nil +# ruby.class # => NilClass +# +# ==== Parsing Options +# +# ====== Input Options +# +# Option +max_nesting+ (\Integer) specifies the maximum nesting depth allowed; +# defaults to +100+; specify +false+ to disable depth checking. +# +# With the default, +false+: +# source = '[0, [1, [2, [3]]]]' +# ruby = JSON.parse(source) +# ruby # => [0, [1, [2, [3]]]] +# Too deep: +# # Raises JSON::NestingError (nesting of 2 is too deep): +# JSON.parse(source, {max_nesting: 1}) +# Bad value: +# # Raises TypeError (wrong argument type Symbol (expected Fixnum)): +# JSON.parse(source, {max_nesting: :foo}) +# +# --- +# +# Option +allow_duplicate_key+ specifies whether duplicate keys in objects +# should be ignored or cause an error to be raised: +# +# When not specified: +# # The last value is used and a deprecation warning emitted. +# JSON.parse('{"a": 1, "a":2}') => {"a" => 2} +# # waring: detected duplicate keys in JSON object. +# # This will raise an error in json 3.0 unless enabled via `allow_duplicate_key: true` +# +# When set to `+true+` +# # The last value is used. +# JSON.parse('{"a": 1, "a":2}') => {"a" => 2} +# +# When set to `+false+`, the future default: +# JSON.parse('{"a": 1, "a":2}') => duplicate key at line 1 column 1 (JSON::ParserError) +# +# --- +# +# Option +allow_nan+ (boolean) specifies whether to allow +# NaN, Infinity, and MinusInfinity in +source+; +# defaults to +false+. +# +# With the default, +false+: +# # Raises JSON::ParserError (225: unexpected token at '[NaN]'): +# JSON.parse('[NaN]') +# # Raises JSON::ParserError (232: unexpected token at '[Infinity]'): +# JSON.parse('[Infinity]') +# # Raises JSON::ParserError (248: unexpected token at '[-Infinity]'): +# JSON.parse('[-Infinity]') +# Allow: +# source = '[NaN, Infinity, -Infinity]' +# ruby = JSON.parse(source, {allow_nan: true}) +# ruby # => [NaN, Infinity, -Infinity] +# +# --- +# +# Option +allow_trailing_comma+ (boolean) specifies whether to allow +# trailing commas in objects and arrays; +# defaults to +false+. +# +# With the default, +false+: +# JSON.parse('[1,]') # unexpected character: ']' at line 1 column 4 (JSON::ParserError) +# +# When enabled: +# JSON.parse('[1,]', allow_trailing_comma: true) # => [1] +# +# ====== Output Options +# +# Option +freeze+ (boolean) specifies whether the returned objects will be frozen; +# defaults to +false+. +# +# Option +symbolize_names+ (boolean) specifies whether returned \Hash keys +# should be Symbols; +# defaults to +false+ (use Strings). +# +# With the default, +false+: +# source = '{"a": "foo", "b": 1.0, "c": true, "d": false, "e": null}' +# ruby = JSON.parse(source) +# ruby # => {"a"=>"foo", "b"=>1.0, "c"=>true, "d"=>false, "e"=>nil} +# Use Symbols: +# ruby = JSON.parse(source, {symbolize_names: true}) +# ruby # => {:a=>"foo", :b=>1.0, :c=>true, :d=>false, :e=>nil} +# +# --- +# +# Option +object_class+ (\Class) specifies the Ruby class to be used +# for each \JSON object; +# defaults to \Hash. +# +# With the default, \Hash: +# source = '{"a": "foo", "b": 1.0, "c": true, "d": false, "e": null}' +# ruby = JSON.parse(source) +# ruby.class # => Hash +# Use class \OpenStruct: +# ruby = JSON.parse(source, {object_class: OpenStruct}) +# ruby # => # +# +# --- +# +# Option +array_class+ (\Class) specifies the Ruby class to be used +# for each \JSON array; +# defaults to \Array. +# +# With the default, \Array: +# source = '["foo", 1.0, true, false, null]' +# ruby = JSON.parse(source) +# ruby.class # => Array +# Use class \Set: +# ruby = JSON.parse(source, {array_class: Set}) +# ruby # => # +# +# --- +# +# Option +create_additions+ (boolean) specifies whether to use \JSON additions in parsing. +# See {\JSON Additions}[#module-JSON-label-JSON+Additions]. +# +# === Generating \JSON +# +# To generate a Ruby \String containing \JSON data, +# use method JSON.generate(source, opts), where +# - +source+ is a Ruby object. +# - +opts+ is a \Hash object containing options +# that control both input allowed and output formatting. +# +# ==== Generating \JSON from Arrays +# +# When the source is a Ruby \Array, JSON.generate returns +# a \String containing a \JSON array: +# ruby = [0, 's', :foo] +# json = JSON.generate(ruby) +# json # => '[0,"s","foo"]' +# +# The Ruby \Array array may contain nested arrays, hashes, and scalars +# to any depth: +# ruby = [0, [1, 2], {foo: 3, bar: 4}] +# json = JSON.generate(ruby) +# json # => '[0,[1,2],{"foo":3,"bar":4}]' +# +# ==== Generating \JSON from Hashes +# +# When the source is a Ruby \Hash, JSON.generate returns +# a \String containing a \JSON object: +# ruby = {foo: 0, bar: 's', baz: :bat} +# json = JSON.generate(ruby) +# json # => '{"foo":0,"bar":"s","baz":"bat"}' +# +# The Ruby \Hash array may contain nested arrays, hashes, and scalars +# to any depth: +# ruby = {foo: [0, 1], bar: {baz: 2, bat: 3}, bam: :bad} +# json = JSON.generate(ruby) +# json # => '{"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"}' +# +# ==== Generating \JSON from Other Objects +# +# When the source is neither an \Array nor a \Hash, +# the generated \JSON data depends on the class of the source. +# +# When the source is a Ruby \Integer or \Float, JSON.generate returns +# a \String containing a \JSON number: +# JSON.generate(42) # => '42' +# JSON.generate(0.42) # => '0.42' +# +# When the source is a Ruby \String, JSON.generate returns +# a \String containing a \JSON string (with double-quotes): +# JSON.generate('A string') # => '"A string"' +# +# When the source is +true+, +false+ or +nil+, JSON.generate returns +# a \String containing the corresponding \JSON token: +# JSON.generate(true) # => 'true' +# JSON.generate(false) # => 'false' +# JSON.generate(nil) # => 'null' +# +# When the source is none of the above, JSON.generate returns +# a \String containing a \JSON string representation of the source: +# JSON.generate(:foo) # => '"foo"' +# JSON.generate(Complex(0, 0)) # => '"0+0i"' +# JSON.generate(Dir.new('.')) # => '"#"' +# +# ==== Generating Options +# +# ====== Input Options +# +# Option +allow_nan+ (boolean) specifies whether +# +NaN+, +Infinity+, and -Infinity may be generated; +# defaults to +false+. +# +# With the default, +false+: +# # Raises JSON::GeneratorError (920: NaN not allowed in JSON): +# JSON.generate(JSON::NaN) +# # Raises JSON::GeneratorError (917: Infinity not allowed in JSON): +# JSON.generate(JSON::Infinity) +# # Raises JSON::GeneratorError (917: -Infinity not allowed in JSON): +# JSON.generate(JSON::MinusInfinity) +# +# Allow: +# ruby = [Float::NaN, Float::Infinity, Float::MinusInfinity] +# JSON.generate(ruby, allow_nan: true) # => '[NaN,Infinity,-Infinity]' +# +# --- +# +# Option +max_nesting+ (\Integer) specifies the maximum nesting depth +# in +obj+; defaults to +100+. +# +# With the default, +100+: +# obj = [[[[[[0]]]]]] +# JSON.generate(obj) # => '[[[[[[0]]]]]]' +# +# Too deep: +# # Raises JSON::NestingError (nesting of 2 is too deep): +# JSON.generate(obj, max_nesting: 2) +# +# ====== Escaping Options +# +# Options +script_safe+ (boolean) specifies wether '\u2028', '\u2029' +# and '/' should be escaped as to make the JSON object safe to interpolate in script +# tags. +# +# Options +ascii_only+ (boolean) specifies wether all characters outside the ASCII range +# should be escaped. +# +# ====== Output Options +# +# The default formatting options generate the most compact +# \JSON data, all on one line and with no whitespace. +# +# You can use these formatting options to generate +# \JSON data in a more open format, using whitespace. +# See also JSON.pretty_generate. +# +# - Option +array_nl+ (\String) specifies a string (usually a newline) +# to be inserted after each \JSON array; defaults to the empty \String, ''. +# - Option +object_nl+ (\String) specifies a string (usually a newline) +# to be inserted after each \JSON object; defaults to the empty \String, ''. +# - Option +indent+ (\String) specifies the string (usually spaces) to be +# used for indentation; defaults to the empty \String, ''; +# defaults to the empty \String, ''; +# has no effect unless options +array_nl+ or +object_nl+ specify newlines. +# - Option +space+ (\String) specifies a string (usually a space) to be +# inserted after the colon in each \JSON object's pair; +# defaults to the empty \String, ''. +# - Option +space_before+ (\String) specifies a string (usually a space) to be +# inserted before the colon in each \JSON object's pair; +# defaults to the empty \String, ''. +# +# In this example, +obj+ is used first to generate the shortest +# \JSON data (no whitespace), then again with all formatting options +# specified: +# +# obj = {foo: [:bar, :baz], bat: {bam: 0, bad: 1}} +# json = JSON.generate(obj) +# puts 'Compact:', json +# opts = { +# array_nl: "\n", +# object_nl: "\n", +# indent: ' ', +# space_before: ' ', +# space: ' ' +# } +# puts 'Open:', JSON.generate(obj, opts) +# +# Output: +# Compact: +# {"foo":["bar","baz"],"bat":{"bam":0,"bad":1}} +# Open: +# { +# "foo" : [ +# "bar", +# "baz" +# ], +# "bat" : { +# "bam" : 0, +# "bad" : 1 +# } +# } +# +# == \JSON Additions +# +# When you "round trip" a non-\String object from Ruby to \JSON and back, +# you have a new \String, instead of the object you began with: +# ruby0 = Range.new(0, 2) +# json = JSON.generate(ruby0) +# json # => '0..2"' +# ruby1 = JSON.parse(json) +# ruby1 # => '0..2' +# ruby1.class # => String +# +# You can use \JSON _additions_ to preserve the original object. +# The addition is an extension of a ruby class, so that: +# - \JSON.generate stores more information in the \JSON string. +# - \JSON.parse, called with option +create_additions+, +# uses that information to create a proper Ruby object. +# +# This example shows a \Range being generated into \JSON +# and parsed back into Ruby, both without and with +# the addition for \Range: +# ruby = Range.new(0, 2) +# # This passage does not use the addition for Range. +# json0 = JSON.generate(ruby) +# ruby0 = JSON.parse(json0) +# # This passage uses the addition for Range. +# require 'json/add/range' +# json1 = JSON.generate(ruby) +# ruby1 = JSON.parse(json1, create_additions: true) +# # Make a nice display. +# display = <<~EOT +# Generated JSON: +# Without addition: #{json0} (#{json0.class}) +# With addition: #{json1} (#{json1.class}) +# Parsed JSON: +# Without addition: #{ruby0.inspect} (#{ruby0.class}) +# With addition: #{ruby1.inspect} (#{ruby1.class}) +# EOT +# puts display +# +# This output shows the different results: +# Generated JSON: +# Without addition: "0..2" (String) +# With addition: {"json_class":"Range","a":[0,2,false]} (String) +# Parsed JSON: +# Without addition: "0..2" (String) +# With addition: 0..2 (Range) +# +# The \JSON module includes additions for certain classes. +# You can also craft custom additions. +# See {Custom \JSON Additions}[#module-JSON-label-Custom+JSON+Additions]. +# +# === Built-in Additions +# +# The \JSON module includes additions for certain classes. +# To use an addition, +require+ its source: +# - BigDecimal: require 'json/add/bigdecimal' +# - Complex: require 'json/add/complex' +# - Date: require 'json/add/date' +# - DateTime: require 'json/add/date_time' +# - Exception: require 'json/add/exception' +# - OpenStruct: require 'json/add/ostruct' +# - Range: require 'json/add/range' +# - Rational: require 'json/add/rational' +# - Regexp: require 'json/add/regexp' +# - Set: require 'json/add/set' +# - Struct: require 'json/add/struct' +# - Symbol: require 'json/add/symbol' +# - Time: require 'json/add/time' +# +# To reduce punctuation clutter, the examples below +# show the generated \JSON via +puts+, rather than the usual +inspect+, +# +# \BigDecimal: +# require 'json/add/bigdecimal' +# ruby0 = BigDecimal(0) # 0.0 +# json = JSON.generate(ruby0) # {"json_class":"BigDecimal","b":"27:0.0"} +# ruby1 = JSON.parse(json, create_additions: true) # 0.0 +# ruby1.class # => BigDecimal +# +# \Complex: +# require 'json/add/complex' +# ruby0 = Complex(1+0i) # 1+0i +# json = JSON.generate(ruby0) # {"json_class":"Complex","r":1,"i":0} +# ruby1 = JSON.parse(json, create_additions: true) # 1+0i +# ruby1.class # Complex +# +# \Date: +# require 'json/add/date' +# ruby0 = Date.today # 2020-05-02 +# json = JSON.generate(ruby0) # {"json_class":"Date","y":2020,"m":5,"d":2,"sg":2299161.0} +# ruby1 = JSON.parse(json, create_additions: true) # 2020-05-02 +# ruby1.class # Date +# +# \DateTime: +# require 'json/add/date_time' +# ruby0 = DateTime.now # 2020-05-02T10:38:13-05:00 +# json = JSON.generate(ruby0) # {"json_class":"DateTime","y":2020,"m":5,"d":2,"H":10,"M":38,"S":13,"of":"-5/24","sg":2299161.0} +# ruby1 = JSON.parse(json, create_additions: true) # 2020-05-02T10:38:13-05:00 +# ruby1.class # DateTime +# +# \Exception (and its subclasses including \RuntimeError): +# require 'json/add/exception' +# ruby0 = Exception.new('A message') # A message +# json = JSON.generate(ruby0) # {"json_class":"Exception","m":"A message","b":null} +# ruby1 = JSON.parse(json, create_additions: true) # A message +# ruby1.class # Exception +# ruby0 = RuntimeError.new('Another message') # Another message +# json = JSON.generate(ruby0) # {"json_class":"RuntimeError","m":"Another message","b":null} +# ruby1 = JSON.parse(json, create_additions: true) # Another message +# ruby1.class # RuntimeError +# +# \OpenStruct: +# require 'json/add/ostruct' +# ruby0 = OpenStruct.new(name: 'Matz', language: 'Ruby') # # +# json = JSON.generate(ruby0) # {"json_class":"OpenStruct","t":{"name":"Matz","language":"Ruby"}} +# ruby1 = JSON.parse(json, create_additions: true) # # +# ruby1.class # OpenStruct +# +# \Range: +# require 'json/add/range' +# ruby0 = Range.new(0, 2) # 0..2 +# json = JSON.generate(ruby0) # {"json_class":"Range","a":[0,2,false]} +# ruby1 = JSON.parse(json, create_additions: true) # 0..2 +# ruby1.class # Range +# +# \Rational: +# require 'json/add/rational' +# ruby0 = Rational(1, 3) # 1/3 +# json = JSON.generate(ruby0) # {"json_class":"Rational","n":1,"d":3} +# ruby1 = JSON.parse(json, create_additions: true) # 1/3 +# ruby1.class # Rational +# +# \Regexp: +# require 'json/add/regexp' +# ruby0 = Regexp.new('foo') # (?-mix:foo) +# json = JSON.generate(ruby0) # {"json_class":"Regexp","o":0,"s":"foo"} +# ruby1 = JSON.parse(json, create_additions: true) # (?-mix:foo) +# ruby1.class # Regexp +# +# \Set: +# require 'json/add/set' +# ruby0 = Set.new([0, 1, 2]) # # +# json = JSON.generate(ruby0) # {"json_class":"Set","a":[0,1,2]} +# ruby1 = JSON.parse(json, create_additions: true) # # +# ruby1.class # Set +# +# \Struct: +# require 'json/add/struct' +# Customer = Struct.new(:name, :address) # Customer +# ruby0 = Customer.new("Dave", "123 Main") # # +# json = JSON.generate(ruby0) # {"json_class":"Customer","v":["Dave","123 Main"]} +# ruby1 = JSON.parse(json, create_additions: true) # # +# ruby1.class # Customer +# +# \Symbol: +# require 'json/add/symbol' +# ruby0 = :foo # foo +# json = JSON.generate(ruby0) # {"json_class":"Symbol","s":"foo"} +# ruby1 = JSON.parse(json, create_additions: true) # foo +# ruby1.class # Symbol +# +# \Time: +# require 'json/add/time' +# ruby0 = Time.now # 2020-05-02 11:28:26 -0500 +# json = JSON.generate(ruby0) # {"json_class":"Time","s":1588436906,"n":840560000} +# ruby1 = JSON.parse(json, create_additions: true) # 2020-05-02 11:28:26 -0500 +# ruby1.class # Time +# +# +# === Custom \JSON Additions +# +# In addition to the \JSON additions provided, +# you can craft \JSON additions of your own, +# either for Ruby built-in classes or for user-defined classes. +# +# Here's a user-defined class +Foo+: +# class Foo +# attr_accessor :bar, :baz +# def initialize(bar, baz) +# self.bar = bar +# self.baz = baz +# end +# end +# +# Here's the \JSON addition for it: +# # Extend class Foo with JSON addition. +# class Foo +# # Serialize Foo object with its class name and arguments +# def to_json(*args) +# { +# JSON.create_id => self.class.name, +# 'a' => [ bar, baz ] +# }.to_json(*args) +# end +# # Deserialize JSON string by constructing new Foo object with arguments. +# def self.json_create(object) +# new(*object['a']) +# end +# end +# +# Demonstration: +# require 'json' +# # This Foo object has no custom addition. +# foo0 = Foo.new(0, 1) +# json0 = JSON.generate(foo0) +# obj0 = JSON.parse(json0) +# # Lood the custom addition. +# require_relative 'foo_addition' +# # This foo has the custom addition. +# foo1 = Foo.new(0, 1) +# json1 = JSON.generate(foo1) +# obj1 = JSON.parse(json1, create_additions: true) +# # Make a nice display. +# display = <<~EOT +# Generated JSON: +# Without custom addition: #{json0} (#{json0.class}) +# With custom addition: #{json1} (#{json1.class}) +# Parsed JSON: +# Without custom addition: #{obj0.inspect} (#{obj0.class}) +# With custom addition: #{obj1.inspect} (#{obj1.class}) +# EOT +# puts display +# +# Output: +# +# Generated JSON: +# Without custom addition: "#" (String) +# With custom addition: {"json_class":"Foo","a":[0,1]} (String) +# Parsed JSON: +# Without custom addition: "#" (String) +# With custom addition: # (Foo) +# +# source://json//lib/json/version.rb#3 +module JSON + extend ::Bootsnap::CompileCache::JSON::Patch + + private + + # :call-seq: + # JSON.dump(obj, io = nil, limit = nil) + # + # Dumps +obj+ as a \JSON string, i.e. calls generate on the object and returns the result. + # + # The default options can be changed via method JSON.dump_default_options. + # + # - Argument +io+, if given, should respond to method +write+; + # the \JSON \String is written to +io+, and +io+ is returned. + # If +io+ is not given, the \JSON \String is returned. + # - Argument +limit+, if given, is passed to JSON.generate as option +max_nesting+. + # + # --- + # + # When argument +io+ is not given, returns the \JSON \String generated from +obj+: + # obj = {foo: [0, 1], bar: {baz: 2, bat: 3}, bam: :bad} + # json = JSON.dump(obj) + # json # => "{\"foo\":[0,1],\"bar\":{\"baz\":2,\"bat\":3},\"bam\":\"bad\"}" + # + # When argument +io+ is given, writes the \JSON \String to +io+ and returns +io+: + # path = 't.json' + # File.open(path, 'w') do |file| + # JSON.dump(obj, file) + # end # => # + # puts File.read(path) + # Output: + # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"} + # + # source://json//lib/json/common.rb#893 + def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end + + # :call-seq: + # JSON.fast_generate(obj, opts) -> new_string + # + # Arguments +obj+ and +opts+ here are the same as + # arguments +obj+ and +opts+ in JSON.generate. + # + # By default, generates \JSON data without checking + # for circular references in +obj+ (option +max_nesting+ set to +false+, disabled). + # + # Raises an exception if +obj+ contains circular references: + # a = []; b = []; a.push(b); b.push(a) + # # Raises SystemStackError (stack level too deep): + # JSON.fast_generate(a) + # + # source://json//lib/json/common.rb#446 + def fast_generate(obj, opts = T.unsafe(nil)); end + + # source://json//lib/json/common.rb#938 + def fast_unparse(*_arg0, **_arg1, &_arg2); end + + # :call-seq: + # JSON.generate(obj, opts = nil) -> new_string + # + # Returns a \String containing the generated \JSON data. + # + # See also JSON.fast_generate, JSON.pretty_generate. + # + # Argument +obj+ is the Ruby object to be converted to \JSON. + # + # Argument +opts+, if given, contains a \Hash of options for the generation. + # See {Generating Options}[#module-JSON-label-Generating+Options]. + # + # --- + # + # When +obj+ is an \Array, returns a \String containing a \JSON array: + # obj = ["foo", 1.0, true, false, nil] + # json = JSON.generate(obj) + # json # => '["foo",1.0,true,false,null]' + # + # When +obj+ is a \Hash, returns a \String containing a \JSON object: + # obj = {foo: 0, bar: 's', baz: :bat} + # json = JSON.generate(obj) + # json # => '{"foo":0,"bar":"s","baz":"bat"}' + # + # For examples of generating from other Ruby objects, see + # {Generating \JSON from Other Objects}[#module-JSON-label-Generating+JSON+from+Other+Objects]. + # + # --- + # + # Raises an exception if any formatting option is not a \String. + # + # Raises an exception if +obj+ contains circular references: + # a = []; b = []; a.push(b); b.push(a) + # # Raises JSON::NestingError (nesting of 100 is too deep): + # JSON.generate(a) + # + # source://json//lib/json/common.rb#425 + def generate(obj, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.load(source, proc = nil, options = {}) -> object + # + # Returns the Ruby objects created by parsing the given +source+. + # + # BEWARE: This method is meant to serialise data from trusted user input, + # like from your own database server or clients under your control, it could + # be dangerous to allow untrusted users to pass JSON sources into it. + # If you must use it, use JSON.unsafe_load instead to make it clear. + # + # Since JSON version 2.8.0, `load` emits a deprecation warning when a + # non native type is deserialized, without `create_additions` being explicitly + # enabled, and in JSON version 3.0, `load` will have `create_additions` disabled + # by default. + # + # - Argument +source+ must be, or be convertible to, a \String: + # - If +source+ responds to instance method +to_str+, + # source.to_str becomes the source. + # - If +source+ responds to instance method +to_io+, + # source.to_io.read becomes the source. + # - If +source+ responds to instance method +read+, + # source.read becomes the source. + # - If both of the following are true, source becomes the \String 'null': + # - Option +allow_blank+ specifies a truthy value. + # - The source, as defined above, is +nil+ or the empty \String ''. + # - Otherwise, +source+ remains the source. + # - Argument +proc+, if given, must be a \Proc that accepts one argument. + # It will be called recursively with each result (depth-first order). + # See details below. + # - Argument +opts+, if given, contains a \Hash of options for the parsing. + # See {Parsing Options}[#module-JSON-label-Parsing+Options]. + # The default options can be changed via method JSON.load_default_options=. + # + # --- + # + # When no +proc+ is given, modifies +source+ as above and returns the result of + # parse(source, opts); see #parse. + # + # Source for following examples: + # source = <<~JSON + # { + # "name": "Dave", + # "age" :40, + # "hats": [ + # "Cattleman's", + # "Panama", + # "Tophat" + # ] + # } + # JSON + # + # Load a \String: + # ruby = JSON.load(source) + # ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # Load an \IO object: + # require 'stringio' + # object = JSON.load(StringIO.new(source)) + # object # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # Load a \File object: + # path = 't.json' + # File.write(path, source) + # File.open(path) do |file| + # JSON.load(file) + # end # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # --- + # + # When +proc+ is given: + # - Modifies +source+ as above. + # - Gets the +result+ from calling parse(source, opts). + # - Recursively calls proc(result). + # - Returns the final result. + # + # Example: + # require 'json' + # + # # Some classes for the example. + # class Base + # def initialize(attributes) + # @attributes = attributes + # end + # end + # class User < Base; end + # class Account < Base; end + # class Admin < Base; end + # # The JSON source. + # json = <<-EOF + # { + # "users": [ + # {"type": "User", "username": "jane", "email": "jane@example.com"}, + # {"type": "User", "username": "john", "email": "john@example.com"} + # ], + # "accounts": [ + # {"account": {"type": "Account", "paid": true, "account_id": "1234"}}, + # {"account": {"type": "Account", "paid": false, "account_id": "1235"}} + # ], + # "admins": {"type": "Admin", "password": "0wn3d"} + # } + # EOF + # # Deserializer method. + # def deserialize_obj(obj, safe_types = %w(User Account Admin)) + # type = obj.is_a?(Hash) && obj["type"] + # safe_types.include?(type) ? Object.const_get(type).new(obj) : obj + # end + # # Call to JSON.load + # ruby = JSON.load(json, proc {|obj| + # case obj + # when Hash + # obj.each {|k, v| obj[k] = deserialize_obj v } + # when Array + # obj.map! {|v| deserialize_obj v } + # end + # }) + # pp ruby + # Output: + # {"users"=> + # [#"User", "username"=>"jane", "email"=>"jane@example.com"}>, + # #"User", "username"=>"john", "email"=>"john@example.com"}>], + # "accounts"=> + # [{"account"=> + # #"Account", "paid"=>true, "account_id"=>"1234"}>}, + # {"account"=> + # #"Account", "paid"=>false, "account_id"=>"1235"}>}], + # "admins"=> + # #"Admin", "password"=>"0wn3d"}>} + # + # source://json//lib/json/common.rb#827 + def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end + + # :call-seq: + # JSON.load_file(path, opts={}) -> object + # + # Calls: + # parse(File.read(path), opts) + # + # See method #parse. + # + # source://json//lib/json/common.rb#374 + def load_file(filespec, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.load_file!(path, opts = {}) + # + # Calls: + # JSON.parse!(File.read(path, opts)) + # + # See method #parse! + # + # source://json//lib/json/common.rb#385 + def load_file!(filespec, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.parse(source, opts) -> object + # + # Returns the Ruby objects created by parsing the given +source+. + # + # Argument +source+ contains the \String to be parsed. + # + # Argument +opts+, if given, contains a \Hash of options for the parsing. + # See {Parsing Options}[#module-JSON-label-Parsing+Options]. + # + # --- + # + # When +source+ is a \JSON array, returns a Ruby \Array: + # source = '["foo", 1.0, true, false, null]' + # ruby = JSON.parse(source) + # ruby # => ["foo", 1.0, true, false, nil] + # ruby.class # => Array + # + # When +source+ is a \JSON object, returns a Ruby \Hash: + # source = '{"a": "foo", "b": 1.0, "c": true, "d": false, "e": null}' + # ruby = JSON.parse(source) + # ruby # => {"a"=>"foo", "b"=>1.0, "c"=>true, "d"=>false, "e"=>nil} + # ruby.class # => Hash + # + # For examples of parsing for all \JSON data types, see + # {Parsing \JSON}[#module-JSON-label-Parsing+JSON]. + # + # Parses nested JSON objects: + # source = <<~JSON + # { + # "name": "Dave", + # "age" :40, + # "hats": [ + # "Cattleman's", + # "Panama", + # "Tophat" + # ] + # } + # JSON + # ruby = JSON.parse(source) + # ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # --- + # + # Raises an exception if +source+ is not valid JSON: + # # Raises JSON::ParserError (783: unexpected token at ''): + # JSON.parse('') + # + # source://json//lib/json/common.rb#337 + def parse(source, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.parse!(source, opts) -> object + # + # Calls + # parse(source, opts) + # with +source+ and possibly modified +opts+. + # + # Differences from JSON.parse: + # - Option +max_nesting+, if not provided, defaults to +false+, + # which disables checking for nesting depth. + # - Option +allow_nan+, if not provided, defaults to +true+. + # + # source://json//lib/json/common.rb#359 + def parse!(source, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.pretty_generate(obj, opts = nil) -> new_string + # + # Arguments +obj+ and +opts+ here are the same as + # arguments +obj+ and +opts+ in JSON.generate. + # + # Default options are: + # { + # indent: ' ', # Two spaces + # space: ' ', # One space + # array_nl: "\n", # Newline + # object_nl: "\n" # Newline + # } + # + # Example: + # obj = {foo: [:bar, :baz], bat: {bam: 0, bad: 1}} + # json = JSON.pretty_generate(obj) + # puts json + # Output: + # { + # "foo": [ + # "bar", + # "baz" + # ], + # "bat": { + # "bam": 0, + # "bad": 1 + # } + # } + # + # source://json//lib/json/common.rb#493 + def pretty_generate(obj, opts = T.unsafe(nil)); end + + # source://json//lib/json/common.rb#948 + def pretty_unparse(*_arg0, **_arg1, &_arg2); end + + # source://json//lib/json/common.rb#958 + def restore(*_arg0, **_arg1, &_arg2); end + + # :stopdoc: + # All these were meant to be deprecated circa 2009, but were just set as undocumented + # so usage still exist in the wild. + # + # source://json//lib/json/common.rb#928 + def unparse(*_arg0, **_arg1, &_arg2); end + + # :call-seq: + # JSON.unsafe_load(source, proc = nil, options = {}) -> object + # + # Returns the Ruby objects created by parsing the given +source+. + # + # BEWARE: This method is meant to serialise data from trusted user input, + # like from your own database server or clients under your control, it could + # be dangerous to allow untrusted users to pass JSON sources into it. + # + # - Argument +source+ must be, or be convertible to, a \String: + # - If +source+ responds to instance method +to_str+, + # source.to_str becomes the source. + # - If +source+ responds to instance method +to_io+, + # source.to_io.read becomes the source. + # - If +source+ responds to instance method +read+, + # source.read becomes the source. + # - If both of the following are true, source becomes the \String 'null': + # - Option +allow_blank+ specifies a truthy value. + # - The source, as defined above, is +nil+ or the empty \String ''. + # - Otherwise, +source+ remains the source. + # - Argument +proc+, if given, must be a \Proc that accepts one argument. + # It will be called recursively with each result (depth-first order). + # See details below. + # - Argument +opts+, if given, contains a \Hash of options for the parsing. + # See {Parsing Options}[#module-JSON-label-Parsing+Options]. + # The default options can be changed via method JSON.unsafe_load_default_options=. + # + # --- + # + # When no +proc+ is given, modifies +source+ as above and returns the result of + # parse(source, opts); see #parse. + # + # Source for following examples: + # source = <<~JSON + # { + # "name": "Dave", + # "age" :40, + # "hats": [ + # "Cattleman's", + # "Panama", + # "Tophat" + # ] + # } + # JSON + # + # Load a \String: + # ruby = JSON.unsafe_load(source) + # ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # Load an \IO object: + # require 'stringio' + # object = JSON.unsafe_load(StringIO.new(source)) + # object # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # Load a \File object: + # path = 't.json' + # File.write(path, source) + # File.open(path) do |file| + # JSON.unsafe_load(file) + # end # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # --- + # + # When +proc+ is given: + # - Modifies +source+ as above. + # - Gets the +result+ from calling parse(source, opts). + # - Recursively calls proc(result). + # - Returns the final result. + # + # Example: + # require 'json' + # + # # Some classes for the example. + # class Base + # def initialize(attributes) + # @attributes = attributes + # end + # end + # class User < Base; end + # class Account < Base; end + # class Admin < Base; end + # # The JSON source. + # json = <<-EOF + # { + # "users": [ + # {"type": "User", "username": "jane", "email": "jane@example.com"}, + # {"type": "User", "username": "john", "email": "john@example.com"} + # ], + # "accounts": [ + # {"account": {"type": "Account", "paid": true, "account_id": "1234"}}, + # {"account": {"type": "Account", "paid": false, "account_id": "1235"}} + # ], + # "admins": {"type": "Admin", "password": "0wn3d"} + # } + # EOF + # # Deserializer method. + # def deserialize_obj(obj, safe_types = %w(User Account Admin)) + # type = obj.is_a?(Hash) && obj["type"] + # safe_types.include?(type) ? Object.const_get(type).new(obj) : obj + # end + # # Call to JSON.unsafe_load + # ruby = JSON.unsafe_load(json, proc {|obj| + # case obj + # when Hash + # obj.each {|k, v| obj[k] = deserialize_obj v } + # when Array + # obj.map! {|v| deserialize_obj v } + # end + # }) + # pp ruby + # Output: + # {"users"=> + # [#"User", "username"=>"jane", "email"=>"jane@example.com"}>, + # #"User", "username"=>"john", "email"=>"john@example.com"}>], + # "accounts"=> + # [{"account"=> + # #"Account", "paid"=>true, "account_id"=>"1234"}>}, + # {"account"=> + # #"Account", "paid"=>false, "account_id"=>"1235"}>}], + # "admins"=> + # #"Admin", "password"=>"0wn3d"}>} + # + # source://json//lib/json/common.rb#667 + def unsafe_load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end + + class << self + # :call-seq: + # JSON[object] -> new_array or new_string + # + # If +object+ is a \String, + # calls JSON.parse with +object+ and +opts+ (see method #parse): + # json = '[0, 1, null]' + # JSON[json]# => [0, 1, nil] + # + # Otherwise, calls JSON.generate with +object+ and +opts+ (see method #generate): + # ruby = [0, 1, nil] + # JSON[ruby] # => '[0,1,null]' + # + # source://json//lib/json/common.rb#127 + def [](object, opts = T.unsafe(nil)); end + + # Returns the current create identifier. + # See also JSON.create_id=. + # + # source://json//lib/json/common.rb#220 + def create_id; end + + # Sets create identifier, which is used to decide if the _json_create_ + # hook of a class should be called; initial value is +json_class+: + # JSON.create_id # => 'json_class' + # + # source://json//lib/json/common.rb#214 + def create_id=(new_value); end + + # Return the constant located at _path_. The format of _path_ has to be + # either ::A::B::C or A::B::C. In any case, A has to be located at the top + # level (absolute namespace path?). If there doesn't exist a constant at + # the given path, an ArgumentError is raised. + # + # source://json//lib/json/common.rb#154 + def deep_const_get(path); end + + # source://json//lib/json/common.rb#99 + def deprecation_warning(message, uplevel = T.unsafe(nil)); end + + # :call-seq: + # JSON.dump(obj, io = nil, limit = nil) + # + # Dumps +obj+ as a \JSON string, i.e. calls generate on the object and returns the result. + # + # The default options can be changed via method JSON.dump_default_options. + # + # - Argument +io+, if given, should respond to method +write+; + # the \JSON \String is written to +io+, and +io+ is returned. + # If +io+ is not given, the \JSON \String is returned. + # - Argument +limit+, if given, is passed to JSON.generate as option +max_nesting+. + # + # --- + # + # When argument +io+ is not given, returns the \JSON \String generated from +obj+: + # obj = {foo: [0, 1], bar: {baz: 2, bat: 3}, bam: :bad} + # json = JSON.dump(obj) + # json # => "{\"foo\":[0,1],\"bar\":{\"baz\":2,\"bat\":3},\"bam\":\"bad\"}" + # + # When argument +io+ is given, writes the \JSON \String to +io+ and returns +io+: + # path = 't.json' + # File.open(path, 'w') do |file| + # JSON.dump(obj, file) + # end # => # + # puts File.read(path) + # Output: + # {"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"} + # + # source://json//lib/json/common.rb#893 + def dump(obj, anIO = T.unsafe(nil), limit = T.unsafe(nil), kwargs = T.unsafe(nil)); end + + # :call-seq: + # JSON.fast_generate(obj, opts) -> new_string + # + # Arguments +obj+ and +opts+ here are the same as + # arguments +obj+ and +opts+ in JSON.generate. + # + # By default, generates \JSON data without checking + # for circular references in +obj+ (option +max_nesting+ set to +false+, disabled). + # + # Raises an exception if +obj+ contains circular references: + # a = []; b = []; a.push(b); b.push(a) + # # Raises SystemStackError (stack level too deep): + # JSON.fast_generate(a) + # + # source://json//lib/json/common.rb#446 + def fast_generate(obj, opts = T.unsafe(nil)); end + + # source://json//lib/json/common.rb#938 + def fast_unparse(*_arg0, **_arg1, &_arg2); end + + # :call-seq: + # JSON.generate(obj, opts = nil) -> new_string + # + # Returns a \String containing the generated \JSON data. + # + # See also JSON.fast_generate, JSON.pretty_generate. + # + # Argument +obj+ is the Ruby object to be converted to \JSON. + # + # Argument +opts+, if given, contains a \Hash of options for the generation. + # See {Generating Options}[#module-JSON-label-Generating+Options]. + # + # --- + # + # When +obj+ is an \Array, returns a \String containing a \JSON array: + # obj = ["foo", 1.0, true, false, nil] + # json = JSON.generate(obj) + # json # => '["foo",1.0,true,false,null]' + # + # When +obj+ is a \Hash, returns a \String containing a \JSON object: + # obj = {foo: 0, bar: 's', baz: :bat} + # json = JSON.generate(obj) + # json # => '{"foo":0,"bar":"s","baz":"bat"}' + # + # For examples of generating from other Ruby objects, see + # {Generating \JSON from Other Objects}[#module-JSON-label-Generating+JSON+from+Other+Objects]. + # + # --- + # + # Raises an exception if any formatting option is not a \String. + # + # Raises an exception if +obj+ contains circular references: + # a = []; b = []; a.push(b); b.push(a) + # # Raises JSON::NestingError (nesting of 100 is too deep): + # JSON.generate(a) + # + # source://json//lib/json/common.rb#425 + def generate(obj, opts = T.unsafe(nil)); end + + # Returns the JSON generator module that is used by JSON. + # + # source://json//lib/json/common.rb#182 + def generator; end + + # Set the module _generator_ to be used by JSON. + # + # source://json//lib/json/common.rb#161 + def generator=(generator); end + + # :call-seq: + # JSON.load(source, proc = nil, options = {}) -> object + # + # Returns the Ruby objects created by parsing the given +source+. + # + # BEWARE: This method is meant to serialise data from trusted user input, + # like from your own database server or clients under your control, it could + # be dangerous to allow untrusted users to pass JSON sources into it. + # If you must use it, use JSON.unsafe_load instead to make it clear. + # + # Since JSON version 2.8.0, `load` emits a deprecation warning when a + # non native type is deserialized, without `create_additions` being explicitly + # enabled, and in JSON version 3.0, `load` will have `create_additions` disabled + # by default. + # + # - Argument +source+ must be, or be convertible to, a \String: + # - If +source+ responds to instance method +to_str+, + # source.to_str becomes the source. + # - If +source+ responds to instance method +to_io+, + # source.to_io.read becomes the source. + # - If +source+ responds to instance method +read+, + # source.read becomes the source. + # - If both of the following are true, source becomes the \String 'null': + # - Option +allow_blank+ specifies a truthy value. + # - The source, as defined above, is +nil+ or the empty \String ''. + # - Otherwise, +source+ remains the source. + # - Argument +proc+, if given, must be a \Proc that accepts one argument. + # It will be called recursively with each result (depth-first order). + # See details below. + # - Argument +opts+, if given, contains a \Hash of options for the parsing. + # See {Parsing Options}[#module-JSON-label-Parsing+Options]. + # The default options can be changed via method JSON.load_default_options=. + # + # --- + # + # When no +proc+ is given, modifies +source+ as above and returns the result of + # parse(source, opts); see #parse. + # + # Source for following examples: + # source = <<~JSON + # { + # "name": "Dave", + # "age" :40, + # "hats": [ + # "Cattleman's", + # "Panama", + # "Tophat" + # ] + # } + # JSON + # + # Load a \String: + # ruby = JSON.load(source) + # ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # Load an \IO object: + # require 'stringio' + # object = JSON.load(StringIO.new(source)) + # object # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # Load a \File object: + # path = 't.json' + # File.write(path, source) + # File.open(path) do |file| + # JSON.load(file) + # end # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # --- + # + # When +proc+ is given: + # - Modifies +source+ as above. + # - Gets the +result+ from calling parse(source, opts). + # - Recursively calls proc(result). + # - Returns the final result. + # + # Example: + # require 'json' + # + # # Some classes for the example. + # class Base + # def initialize(attributes) + # @attributes = attributes + # end + # end + # class User < Base; end + # class Account < Base; end + # class Admin < Base; end + # # The JSON source. + # json = <<-EOF + # { + # "users": [ + # {"type": "User", "username": "jane", "email": "jane@example.com"}, + # {"type": "User", "username": "john", "email": "john@example.com"} + # ], + # "accounts": [ + # {"account": {"type": "Account", "paid": true, "account_id": "1234"}}, + # {"account": {"type": "Account", "paid": false, "account_id": "1235"}} + # ], + # "admins": {"type": "Admin", "password": "0wn3d"} + # } + # EOF + # # Deserializer method. + # def deserialize_obj(obj, safe_types = %w(User Account Admin)) + # type = obj.is_a?(Hash) && obj["type"] + # safe_types.include?(type) ? Object.const_get(type).new(obj) : obj + # end + # # Call to JSON.load + # ruby = JSON.load(json, proc {|obj| + # case obj + # when Hash + # obj.each {|k, v| obj[k] = deserialize_obj v } + # when Array + # obj.map! {|v| deserialize_obj v } + # end + # }) + # pp ruby + # Output: + # {"users"=> + # [#"User", "username"=>"jane", "email"=>"jane@example.com"}>, + # #"User", "username"=>"john", "email"=>"john@example.com"}>], + # "accounts"=> + # [{"account"=> + # #"Account", "paid"=>true, "account_id"=>"1234"}>}, + # {"account"=> + # #"Account", "paid"=>false, "account_id"=>"1235"}>}], + # "admins"=> + # #"Admin", "password"=>"0wn3d"}>} + # + # source://json//lib/json/common.rb#827 + def load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end + + # :call-seq: + # JSON.load_file!(path, opts = {}) + # + # Calls: + # JSON.parse!(File.read(path, opts)) + # + # See method #parse! + # + # source://json//lib/json/common.rb#385 + def load_file!(filespec, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.parse(source, opts) -> object + # + # Returns the Ruby objects created by parsing the given +source+. + # + # Argument +source+ contains the \String to be parsed. + # + # Argument +opts+, if given, contains a \Hash of options for the parsing. + # See {Parsing Options}[#module-JSON-label-Parsing+Options]. + # + # --- + # + # When +source+ is a \JSON array, returns a Ruby \Array: + # source = '["foo", 1.0, true, false, null]' + # ruby = JSON.parse(source) + # ruby # => ["foo", 1.0, true, false, nil] + # ruby.class # => Array + # + # When +source+ is a \JSON object, returns a Ruby \Hash: + # source = '{"a": "foo", "b": 1.0, "c": true, "d": false, "e": null}' + # ruby = JSON.parse(source) + # ruby # => {"a"=>"foo", "b"=>1.0, "c"=>true, "d"=>false, "e"=>nil} + # ruby.class # => Hash + # + # For examples of parsing for all \JSON data types, see + # {Parsing \JSON}[#module-JSON-label-Parsing+JSON]. + # + # Parses nested JSON objects: + # source = <<~JSON + # { + # "name": "Dave", + # "age" :40, + # "hats": [ + # "Cattleman's", + # "Panama", + # "Tophat" + # ] + # } + # JSON + # ruby = JSON.parse(source) + # ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # --- + # + # Raises an exception if +source+ is not valid JSON: + # # Raises JSON::ParserError (783: unexpected token at ''): + # JSON.parse('') + # + # source://json//lib/json/common.rb#337 + def parse(source, opts = T.unsafe(nil)); end + + # :call-seq: + # JSON.parse!(source, opts) -> object + # + # Calls + # parse(source, opts) + # with +source+ and possibly modified +opts+. + # + # Differences from JSON.parse: + # - Option +max_nesting+, if not provided, defaults to +false+, + # which disables checking for nesting depth. + # - Option +allow_nan+, if not provided, defaults to +true+. + # + # source://json//lib/json/common.rb#359 + def parse!(source, opts = T.unsafe(nil)); end + + # Returns the JSON parser class that is used by JSON. + # + # source://json//lib/json/common.rb#141 + def parser; end + + # Set the JSON parser class _parser_ to be used by JSON. + # + # source://json//lib/json/common.rb#144 + def parser=(parser); end + + # :call-seq: + # JSON.pretty_generate(obj, opts = nil) -> new_string + # + # Arguments +obj+ and +opts+ here are the same as + # arguments +obj+ and +opts+ in JSON.generate. + # + # Default options are: + # { + # indent: ' ', # Two spaces + # space: ' ', # One space + # array_nl: "\n", # Newline + # object_nl: "\n" # Newline + # } + # + # Example: + # obj = {foo: [:bar, :baz], bat: {bam: 0, bad: 1}} + # json = JSON.pretty_generate(obj) + # puts json + # Output: + # { + # "foo": [ + # "bar", + # "baz" + # ], + # "bat": { + # "bam": 0, + # "bad": 1 + # } + # } + # + # source://json//lib/json/common.rb#493 + def pretty_generate(obj, opts = T.unsafe(nil)); end + + # source://json//lib/json/common.rb#948 + def pretty_unparse(*_arg0, **_arg1, &_arg2); end + + # source://json//lib/json/common.rb#958 + def restore(*_arg0, **_arg1, &_arg2); end + + # Sets or Returns the JSON generator state class that is used by JSON. + # + # source://json//lib/json/common.rb#185 + def state; end + + # Sets or Returns the JSON generator state class that is used by JSON. + # + # source://json//lib/json/common.rb#185 + def state=(_arg0); end + + # :stopdoc: + # All these were meant to be deprecated circa 2009, but were just set as undocumented + # so usage still exist in the wild. + # + # source://json//lib/json/common.rb#928 + def unparse(*_arg0, **_arg1, &_arg2); end + + # :call-seq: + # JSON.unsafe_load(source, proc = nil, options = {}) -> object + # + # Returns the Ruby objects created by parsing the given +source+. + # + # BEWARE: This method is meant to serialise data from trusted user input, + # like from your own database server or clients under your control, it could + # be dangerous to allow untrusted users to pass JSON sources into it. + # + # - Argument +source+ must be, or be convertible to, a \String: + # - If +source+ responds to instance method +to_str+, + # source.to_str becomes the source. + # - If +source+ responds to instance method +to_io+, + # source.to_io.read becomes the source. + # - If +source+ responds to instance method +read+, + # source.read becomes the source. + # - If both of the following are true, source becomes the \String 'null': + # - Option +allow_blank+ specifies a truthy value. + # - The source, as defined above, is +nil+ or the empty \String ''. + # - Otherwise, +source+ remains the source. + # - Argument +proc+, if given, must be a \Proc that accepts one argument. + # It will be called recursively with each result (depth-first order). + # See details below. + # - Argument +opts+, if given, contains a \Hash of options for the parsing. + # See {Parsing Options}[#module-JSON-label-Parsing+Options]. + # The default options can be changed via method JSON.unsafe_load_default_options=. + # + # --- + # + # When no +proc+ is given, modifies +source+ as above and returns the result of + # parse(source, opts); see #parse. + # + # Source for following examples: + # source = <<~JSON + # { + # "name": "Dave", + # "age" :40, + # "hats": [ + # "Cattleman's", + # "Panama", + # "Tophat" + # ] + # } + # JSON + # + # Load a \String: + # ruby = JSON.unsafe_load(source) + # ruby # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # Load an \IO object: + # require 'stringio' + # object = JSON.unsafe_load(StringIO.new(source)) + # object # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # Load a \File object: + # path = 't.json' + # File.write(path, source) + # File.open(path) do |file| + # JSON.unsafe_load(file) + # end # => {"name"=>"Dave", "age"=>40, "hats"=>["Cattleman's", "Panama", "Tophat"]} + # + # --- + # + # When +proc+ is given: + # - Modifies +source+ as above. + # - Gets the +result+ from calling parse(source, opts). + # - Recursively calls proc(result). + # - Returns the final result. + # + # Example: + # require 'json' + # + # # Some classes for the example. + # class Base + # def initialize(attributes) + # @attributes = attributes + # end + # end + # class User < Base; end + # class Account < Base; end + # class Admin < Base; end + # # The JSON source. + # json = <<-EOF + # { + # "users": [ + # {"type": "User", "username": "jane", "email": "jane@example.com"}, + # {"type": "User", "username": "john", "email": "john@example.com"} + # ], + # "accounts": [ + # {"account": {"type": "Account", "paid": true, "account_id": "1234"}}, + # {"account": {"type": "Account", "paid": false, "account_id": "1235"}} + # ], + # "admins": {"type": "Admin", "password": "0wn3d"} + # } + # EOF + # # Deserializer method. + # def deserialize_obj(obj, safe_types = %w(User Account Admin)) + # type = obj.is_a?(Hash) && obj["type"] + # safe_types.include?(type) ? Object.const_get(type).new(obj) : obj + # end + # # Call to JSON.unsafe_load + # ruby = JSON.unsafe_load(json, proc {|obj| + # case obj + # when Hash + # obj.each {|k, v| obj[k] = deserialize_obj v } + # when Array + # obj.map! {|v| deserialize_obj v } + # end + # }) + # pp ruby + # Output: + # {"users"=> + # [#"User", "username"=>"jane", "email"=>"jane@example.com"}>, + # #"User", "username"=>"john", "email"=>"john@example.com"}>], + # "accounts"=> + # [{"account"=> + # #"Account", "paid"=>true, "account_id"=>"1234"}>}, + # {"account"=> + # #"Account", "paid"=>false, "account_id"=>"1235"}>}], + # "admins"=> + # #"Admin", "password"=>"0wn3d"}>} + # + # source://json//lib/json/common.rb#667 + def unsafe_load(source, proc = T.unsafe(nil), options = T.unsafe(nil)); end + + private + + # source://json//lib/json/common.rb#971 + def const_missing(const_name); end + + # source://json//lib/json/common.rb#189 + def deprecated_singleton_attr_accessor(*attrs); end + end +end + +# JSON::Coder holds a parser and generator configuration. +# +# module MyApp +# JSONC_CODER = JSON::Coder.new( +# allow_trailing_comma: true +# ) +# end +# +# MyApp::JSONC_CODER.load(document) +# +# source://json//lib/json/common.rb#997 +class JSON::Coder + # :call-seq: + # JSON.new(options = nil, &block) + # + # Argument +options+, if given, contains a \Hash of options for both parsing and generating. + # See {Parsing Options}[#module-JSON-label-Parsing+Options], and {Generating Options}[#module-JSON-label-Generating+Options]. + # + # For generation, the strict: true option is always set. When a Ruby object with no native \JSON counterpart is + # encoutered, the block provided to the initialize method is invoked, and must return a Ruby object that has a native + # \JSON counterpart: + # + # module MyApp + # API_JSON_CODER = JSON::Coder.new do |object| + # case object + # when Time + # object.iso8601(3) + # else + # object # Unknown type, will raise + # end + # end + # end + # + # puts MyApp::API_JSON_CODER.dump(Time.now.utc) # => "2025-01-21T08:41:44.286Z" + # + # @return [Coder] a new instance of Coder + # + # source://json//lib/json/common.rb#1021 + def initialize(options = T.unsafe(nil), &as_json); end + + # call-seq: + # dump(object) -> String + # dump(object, io) -> io + # + # Serialize the given object into a \JSON document. + # + # source://json//lib/json/common.rb#1039 + def dump(object, io = T.unsafe(nil)); end + + # call-seq: + # dump(object) -> String + # dump(object, io) -> io + # + # Serialize the given object into a \JSON document. + # + # source://json//lib/json/common.rb#1039 + def generate(object, io = T.unsafe(nil)); end + + # call-seq: + # load(string) -> Object + # + # Parse the given \JSON document and return an equivalent Ruby object. + # + # source://json//lib/json/common.rb#1048 + def load(source); end + + # call-seq: + # load(path) -> Object + # + # Parse the given \JSON document and return an equivalent Ruby object. + # + # source://json//lib/json/common.rb#1057 + def load_file(path); end + + # call-seq: + # load(string) -> Object + # + # Parse the given \JSON document and return an equivalent Ruby object. + # + # source://json//lib/json/common.rb#1048 + def parse(source); end +end + +# source://json//lib/json/ext/generator/state.rb#6 +class JSON::Ext::Generator::State + # call-seq: new(opts = {}) + # + # Instantiates a new State object, configured by _opts_. + # + # _opts_ can have the following keys: + # + # * *indent*: a string used to indent levels (default: ''), + # * *space*: a string that is put after, a : or , delimiter (default: ''), + # * *space_before*: a string that is put before a : pair delimiter (default: ''), + # * *object_nl*: a string that is put at the end of a JSON object (default: ''), + # * *array_nl*: a string that is put at the end of a JSON array (default: ''), + # * *allow_nan*: true if NaN, Infinity, and -Infinity should be + # generated, otherwise an exception is thrown, if these values are + # encountered. This options defaults to false. + # * *ascii_only*: true if only ASCII characters should be generated. This + # option defaults to false. + # * *buffer_initial_length*: sets the initial length of the generator's + # internal buffer. + # + # @return [State] a new instance of State + # + # source://json//lib/json/ext/generator/state.rb#25 + def initialize(opts = T.unsafe(nil)); end + + # call-seq: [](name) + # + # Returns the value returned by method +name+. + # + # source://json//lib/json/ext/generator/state.rb#84 + def [](name); end + + # call-seq: []=(name, value) + # + # Sets the attribute name to value. + # + # source://json//lib/json/ext/generator/state.rb#96 + def []=(name, value); end + + # call-seq: configure(opts) + # + # Configure this State instance with the Hash _opts_, and return + # itself. + # + # source://json//lib/json/ext/generator/state.rb#35 + def configure(opts); end + + # call-seq: configure(opts) + # + # Configure this State instance with the Hash _opts_, and return + # itself. + # + # source://json//lib/json/ext/generator/state.rb#35 + def merge(opts); end + + # call-seq: to_h + # + # Returns the configuration instance variables as a hash, that can be + # passed to the configure method. + # + # source://json//lib/json/ext/generator/state.rb#54 + def to_h; end + + # call-seq: to_h + # + # Returns the configuration instance variables as a hash, that can be + # passed to the configure method. + # + # source://json//lib/json/ext/generator/state.rb#54 + def to_hash; end +end + +# source://json//lib/json/ext.rb#9 +class JSON::Ext::Parser + # @return [Parser] a new instance of Parser + # + # source://json//lib/json/ext.rb#17 + def initialize(source, opts = T.unsafe(nil)); end + + # source://json//lib/json/ext.rb#26 + def parse; end + + # source://json//lib/json/ext.rb#22 + def source; end +end + +# source://json//lib/json/ext.rb#32 +JSON::Ext::Parser::Config = JSON::Ext::ParserConfig + +# Fragment of JSON document that is to be included as is: +# fragment = JSON::Fragment.new("[1, 2, 3]") +# JSON.generate({ count: 3, items: fragments }) +# +# This allows to easily assemble multiple JSON fragments that have +# been persisted somewhere without having to parse them nor resorting +# to string interpolation. +# +# Note: no validation is performed on the provided string. It is the +# responsibility of the caller to ensure the string contains valid JSON. +# +# source://json//lib/json/common.rb#273 +class JSON::Fragment < ::Struct + # @return [Fragment] a new instance of Fragment + # + # source://json//lib/json/common.rb#274 + def initialize(json); end + + # Returns the value of attribute json + # + # @return [Object] the current value of json + def json; end + + # Sets the attribute json + # + # @param value [Object] the value to set the attribute json to. + # @return [Object] the newly set value + def json=(_); end + + # source://json//lib/json/common.rb#282 + def to_json(state = T.unsafe(nil), *_arg1); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# This exception is raised if a generator or unparser error occurs. +# +# source://json//lib/json/common.rb#243 +class JSON::GeneratorError < ::JSON::JSONError + # @return [GeneratorError] a new instance of GeneratorError + # + # source://json//lib/json/common.rb#246 + def initialize(message, invalid_object = T.unsafe(nil)); end + + # source://json//lib/json/common.rb#251 + def detailed_message(*_arg0, **_arg1, &_arg2); end + + # Returns the value of attribute invalid_object. + # + # source://json//lib/json/common.rb#244 + def invalid_object; end +end + +# source://json//lib/json/generic_object.rb#9 +class JSON::GenericObject < ::OpenStruct + # source://json//lib/json/generic_object.rb#67 + def as_json(*_arg0); end + + # source://json//lib/json/generic_object.rb#51 + def to_hash; end + + # source://json//lib/json/generic_object.rb#71 + def to_json(*a); end + + # source://json//lib/json/generic_object.rb#63 + def |(other); end + + class << self + # source://json//lib/json/generic_object.rb#45 + def dump(obj, *args); end + + # source://json//lib/json/generic_object.rb#25 + def from_hash(object); end + + # Sets the attribute json_creatable + # + # @param value the value to set the attribute json_creatable to. + # + # source://json//lib/json/generic_object.rb#17 + def json_creatable=(_arg0); end + + # @return [Boolean] + # + # source://json//lib/json/generic_object.rb#13 + def json_creatable?; end + + # source://json//lib/json/generic_object.rb#19 + def json_create(data); end + + # source://json//lib/json/generic_object.rb#40 + def load(source, proc = T.unsafe(nil), opts = T.unsafe(nil)); end + end +end + +# source://json//lib/json/common.rb#342 +JSON::PARSE_L_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://json//lib/json/common.rb#455 +JSON::PRETTY_GENERATE_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://json//lib/json/common.rb#147 +JSON::Parser = JSON::Ext::Parser + +# This exception is raised if a parser error occurs. +# +# source://json//lib/json/common.rb#234 +class JSON::ParserError < ::JSON::JSONError + # Returns the value of attribute column. + # + # source://json//lib/json/common.rb#235 + def column; end + + # Returns the value of attribute line. + # + # source://json//lib/json/common.rb#235 + def line; end +end + +# source://json//lib/json/common.rb#8 +module JSON::ParserOptions + class << self + # source://json//lib/json/common.rb#10 + def prepare(opts); end + + private + + # source://json//lib/json/common.rb#40 + def array_class_proc(array_class, on_load); end + + # TODO: extract :create_additions support to another gem for version 3.0 + # + # source://json//lib/json/common.rb#52 + def create_additions_proc(opts); end + + # source://json//lib/json/common.rb#90 + def create_additions_warning; end + + # source://json//lib/json/common.rb#29 + def object_class_proc(object_class, on_load); end + end +end + +# source://json//lib/json/common.rb#176 +JSON::State = JSON::Ext::Generator::State + +# source://json//lib/json/common.rb#1063 +module Kernel + private + + # If _object_ is string-like, parse the string and return the parsed result as + # a Ruby data structure. Otherwise, generate a JSON text from the Ruby data + # structure object and return it. + # + # The _opts_ argument is passed through to generate/parse respectively. See + # generate and parse for their documentation. + # + # source://json//lib/json/common.rb#1102 + def JSON(object, opts = T.unsafe(nil)); end + + # Outputs _objs_ to STDOUT as JSON strings in the shortest form, that is in + # one line. + # + # source://json//lib/json/common.rb#1068 + def j(*objs); end + + # Outputs _objs_ to STDOUT as JSON strings in a pretty format, with + # indentation and over many lines. + # + # source://json//lib/json/common.rb#1083 + def jj(*objs); end +end diff --git a/sorbet/rbi/gems/multipart-post@2.4.1.rbi b/sorbet/rbi/gems/multipart-post@2.4.1.rbi new file mode 100644 index 00000000..23068b55 --- /dev/null +++ b/sorbet/rbi/gems/multipart-post@2.4.1.rbi @@ -0,0 +1,9 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `multipart-post` gem. +# Please instead update this file by running `bin/tapioca gem multipart-post`. + + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem diff --git a/sorbet/rbi/gems/net-http@0.6.0.rbi b/sorbet/rbi/gems/net-http@0.6.0.rbi new file mode 100644 index 00000000..36bf8191 --- /dev/null +++ b/sorbet/rbi/gems/net-http@0.6.0.rbi @@ -0,0 +1,4096 @@ +# typed: false + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `net-http` gem. +# Please instead update this file by running `bin/tapioca gem net-http`. + + +# \Class \Net::HTTP provides a rich library that implements the client +# in a client-server model that uses the \HTTP request-response protocol. +# For information about \HTTP, see: +# +# - {Hypertext Transfer Protocol}[https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol]. +# - {Technical overview}[https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Technical_overview]. +# +# == About the Examples +# +# :include: doc/net-http/examples.rdoc +# +# == Strategies +# +# - If you will make only a few GET requests, +# consider using {OpenURI}[https://docs.ruby-lang.org/en/master/OpenURI.html]. +# - If you will make only a few requests of all kinds, +# consider using the various singleton convenience methods in this class. +# Each of the following methods automatically starts and finishes +# a {session}[rdoc-ref:Net::HTTP@Sessions] that sends a single request: +# +# # Return string response body. +# Net::HTTP.get(hostname, path) +# Net::HTTP.get(uri) +# +# # Write string response body to $stdout. +# Net::HTTP.get_print(hostname, path) +# Net::HTTP.get_print(uri) +# +# # Return response as Net::HTTPResponse object. +# Net::HTTP.get_response(hostname, path) +# Net::HTTP.get_response(uri) +# data = '{"title": "foo", "body": "bar", "userId": 1}' +# Net::HTTP.post(uri, data) +# params = {title: 'foo', body: 'bar', userId: 1} +# Net::HTTP.post_form(uri, params) +# data = '{"title": "foo", "body": "bar", "userId": 1}' +# Net::HTTP.put(uri, data) +# +# - If performance is important, consider using sessions, which lower request overhead. +# This {session}[rdoc-ref:Net::HTTP@Sessions] has multiple requests for +# {HTTP methods}[https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods] +# and {WebDAV methods}[https://en.wikipedia.org/wiki/WebDAV#Implementation]: +# +# Net::HTTP.start(hostname) do |http| +# # Session started automatically before block execution. +# http.get(path) +# http.head(path) +# body = 'Some text' +# http.post(path, body) # Can also have a block. +# http.put(path, body) +# http.delete(path) +# http.options(path) +# http.trace(path) +# http.patch(path, body) # Can also have a block. +# http.copy(path) +# http.lock(path, body) +# http.mkcol(path, body) +# http.move(path) +# http.propfind(path, body) +# http.proppatch(path, body) +# http.unlock(path, body) +# # Session finished automatically at block exit. +# end +# +# The methods cited above are convenience methods that, via their few arguments, +# allow minimal control over the requests. +# For greater control, consider using {request objects}[rdoc-ref:Net::HTTPRequest]. +# +# == URIs +# +# On the internet, a URI +# ({Universal Resource Identifier}[https://en.wikipedia.org/wiki/Uniform_Resource_Identifier]) +# is a string that identifies a particular resource. +# It consists of some or all of: scheme, hostname, path, query, and fragment; +# see {URI syntax}[https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax]. +# +# A Ruby {URI::Generic}[https://docs.ruby-lang.org/en/master/URI/Generic.html] object +# represents an internet URI. +# It provides, among others, methods +# +scheme+, +hostname+, +path+, +query+, and +fragment+. +# +# === Schemes +# +# An internet \URI has +# a {scheme}[https://en.wikipedia.org/wiki/List_of_URI_schemes]. +# +# The two schemes supported in \Net::HTTP are 'https' and 'http': +# +# uri.scheme # => "https" +# URI('http://example.com').scheme # => "http" +# +# === Hostnames +# +# A hostname identifies a server (host) to which requests may be sent: +# +# hostname = uri.hostname # => "jsonplaceholder.typicode.com" +# Net::HTTP.start(hostname) do |http| +# # Some HTTP stuff. +# end +# +# === Paths +# +# A host-specific path identifies a resource on the host: +# +# _uri = uri.dup +# _uri.path = '/todos/1' +# hostname = _uri.hostname +# path = _uri.path +# Net::HTTP.get(hostname, path) +# +# === Queries +# +# A host-specific query adds name/value pairs to the URI: +# +# _uri = uri.dup +# params = {userId: 1, completed: false} +# _uri.query = URI.encode_www_form(params) +# _uri # => # +# Net::HTTP.get(_uri) +# +# === Fragments +# +# A {URI fragment}[https://en.wikipedia.org/wiki/URI_fragment] has no effect +# in \Net::HTTP; +# the same data is returned, regardless of whether a fragment is included. +# +# == Request Headers +# +# Request headers may be used to pass additional information to the host, +# similar to arguments passed in a method call; +# each header is a name/value pair. +# +# Each of the \Net::HTTP methods that sends a request to the host +# has optional argument +headers+, +# where the headers are expressed as a hash of field-name/value pairs: +# +# headers = {Accept: 'application/json', Connection: 'Keep-Alive'} +# Net::HTTP.get(uri, headers) +# +# See lists of both standard request fields and common request fields at +# {Request Fields}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields]. +# A host may also accept other custom fields. +# +# == \HTTP Sessions +# +# A _session_ is a connection between a server (host) and a client that: +# +# - Is begun by instance method Net::HTTP#start. +# - May contain any number of requests. +# - Is ended by instance method Net::HTTP#finish. +# +# See example sessions at {Strategies}[rdoc-ref:Net::HTTP@Strategies]. +# +# === Session Using \Net::HTTP.start +# +# If you have many requests to make to a single host (and port), +# consider using singleton method Net::HTTP.start with a block; +# the method handles the session automatically by: +# +# - Calling #start before block execution. +# - Executing the block. +# - Calling #finish after block execution. +# +# In the block, you can use these instance methods, +# each of which that sends a single request: +# +# - {HTTP methods}[https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods]: +# +# - #get, #request_get: GET. +# - #head, #request_head: HEAD. +# - #post, #request_post: POST. +# - #delete: DELETE. +# - #options: OPTIONS. +# - #trace: TRACE. +# - #patch: PATCH. +# +# - {WebDAV methods}[https://en.wikipedia.org/wiki/WebDAV#Implementation]: +# +# - #copy: COPY. +# - #lock: LOCK. +# - #mkcol: MKCOL. +# - #move: MOVE. +# - #propfind: PROPFIND. +# - #proppatch: PROPPATCH. +# - #unlock: UNLOCK. +# +# === Session Using \Net::HTTP.start and \Net::HTTP.finish +# +# You can manage a session manually using methods #start and #finish: +# +# http = Net::HTTP.new(hostname) +# http.start +# http.get('/todos/1') +# http.get('/todos/2') +# http.delete('/posts/1') +# http.finish # Needed to free resources. +# +# === Single-Request Session +# +# Certain convenience methods automatically handle a session by: +# +# - Creating an \HTTP object +# - Starting a session. +# - Sending a single request. +# - Finishing the session. +# - Destroying the object. +# +# Such methods that send GET requests: +# +# - ::get: Returns the string response body. +# - ::get_print: Writes the string response body to $stdout. +# - ::get_response: Returns a Net::HTTPResponse object. +# +# Such methods that send POST requests: +# +# - ::post: Posts data to the host. +# - ::post_form: Posts form data to the host. +# +# == \HTTP Requests and Responses +# +# Many of the methods above are convenience methods, +# each of which sends a request and returns a string +# without directly using \Net::HTTPRequest and \Net::HTTPResponse objects. +# +# You can, however, directly create a request object, send the request, +# and retrieve the response object; see: +# +# - Net::HTTPRequest. +# - Net::HTTPResponse. +# +# == Following Redirection +# +# Each returned response is an instance of a subclass of Net::HTTPResponse. +# See the {response class hierarchy}[rdoc-ref:Net::HTTPResponse@Response+Subclasses]. +# +# In particular, class Net::HTTPRedirection is the parent +# of all redirection classes. +# This allows you to craft a case statement to handle redirections properly: +# +# def fetch(uri, limit = 10) +# # You should choose a better exception. +# raise ArgumentError, 'Too many HTTP redirects' if limit == 0 +# +# res = Net::HTTP.get_response(URI(uri)) +# case res +# when Net::HTTPSuccess # Any success class. +# res +# when Net::HTTPRedirection # Any redirection class. +# location = res['Location'] +# warn "Redirected to #{location}" +# fetch(location, limit - 1) +# else # Any other class. +# res.value +# end +# end +# +# fetch(uri) +# +# == Basic Authentication +# +# Basic authentication is performed according to +# {RFC2617}[http://www.ietf.org/rfc/rfc2617.txt]: +# +# req = Net::HTTP::Get.new(uri) +# req.basic_auth('user', 'pass') +# res = Net::HTTP.start(hostname) do |http| +# http.request(req) +# end +# +# == Streaming Response Bodies +# +# By default \Net::HTTP reads an entire response into memory. If you are +# handling large files or wish to implement a progress bar you can instead +# stream the body directly to an IO. +# +# Net::HTTP.start(hostname) do |http| +# req = Net::HTTP::Get.new(uri) +# http.request(req) do |res| +# open('t.tmp', 'w') do |f| +# res.read_body do |chunk| +# f.write chunk +# end +# end +# end +# end +# +# == HTTPS +# +# HTTPS is enabled for an \HTTP connection by Net::HTTP#use_ssl=: +# +# Net::HTTP.start(hostname, :use_ssl => true) do |http| +# req = Net::HTTP::Get.new(uri) +# res = http.request(req) +# end +# +# Or if you simply want to make a GET request, you may pass in a URI +# object that has an \HTTPS URL. \Net::HTTP automatically turns on TLS +# verification if the URI object has a 'https' URI scheme: +# +# uri # => # +# Net::HTTP.get(uri) +# +# == Proxy Server +# +# An \HTTP object can have +# a {proxy server}[https://en.wikipedia.org/wiki/Proxy_server]. +# +# You can create an \HTTP object with a proxy server +# using method Net::HTTP.new or method Net::HTTP.start. +# +# The proxy may be defined either by argument +p_addr+ +# or by environment variable 'http_proxy'. +# +# === Proxy Using Argument +p_addr+ as a \String +# +# When argument +p_addr+ is a string hostname, +# the returned +http+ has the given host as its proxy: +# +# http = Net::HTTP.new(hostname, nil, 'proxy.example') +# http.proxy? # => true +# http.proxy_from_env? # => false +# http.proxy_address # => "proxy.example" +# # These use default values. +# http.proxy_port # => 80 +# http.proxy_user # => nil +# http.proxy_pass # => nil +# +# The port, username, and password for the proxy may also be given: +# +# http = Net::HTTP.new(hostname, nil, 'proxy.example', 8000, 'pname', 'ppass') +# # => # +# http.proxy? # => true +# http.proxy_from_env? # => false +# http.proxy_address # => "proxy.example" +# http.proxy_port # => 8000 +# http.proxy_user # => "pname" +# http.proxy_pass # => "ppass" +# +# === Proxy Using 'ENV['http_proxy']' +# +# When environment variable 'http_proxy' +# is set to a \URI string, +# the returned +http+ will have the server at that URI as its proxy; +# note that the \URI string must have a protocol +# such as 'http' or 'https': +# +# ENV['http_proxy'] = 'http://example.com' +# http = Net::HTTP.new(hostname) +# http.proxy? # => true +# http.proxy_from_env? # => true +# http.proxy_address # => "example.com" +# # These use default values. +# http.proxy_port # => 80 +# http.proxy_user # => nil +# http.proxy_pass # => nil +# +# The \URI string may include proxy username, password, and port number: +# +# ENV['http_proxy'] = 'http://pname:ppass@example.com:8000' +# http = Net::HTTP.new(hostname) +# http.proxy? # => true +# http.proxy_from_env? # => true +# http.proxy_address # => "example.com" +# http.proxy_port # => 8000 +# http.proxy_user # => "pname" +# http.proxy_pass # => "ppass" +# +# === Filtering Proxies +# +# With method Net::HTTP.new (but not Net::HTTP.start), +# you can use argument +p_no_proxy+ to filter proxies: +# +# - Reject a certain address: +# +# http = Net::HTTP.new('example.com', nil, 'proxy.example', 8000, 'pname', 'ppass', 'proxy.example') +# http.proxy_address # => nil +# +# - Reject certain domains or subdomains: +# +# http = Net::HTTP.new('example.com', nil, 'my.proxy.example', 8000, 'pname', 'ppass', 'proxy.example') +# http.proxy_address # => nil +# +# - Reject certain addresses and port combinations: +# +# http = Net::HTTP.new('example.com', nil, 'proxy.example', 8000, 'pname', 'ppass', 'proxy.example:1234') +# http.proxy_address # => "proxy.example" +# +# http = Net::HTTP.new('example.com', nil, 'proxy.example', 8000, 'pname', 'ppass', 'proxy.example:8000') +# http.proxy_address # => nil +# +# - Reject a list of the types above delimited using a comma: +# +# http = Net::HTTP.new('example.com', nil, 'proxy.example', 8000, 'pname', 'ppass', 'my.proxy,proxy.example:8000') +# http.proxy_address # => nil +# +# http = Net::HTTP.new('example.com', nil, 'my.proxy', 8000, 'pname', 'ppass', 'my.proxy,proxy.example:8000') +# http.proxy_address # => nil +# +# == Compression and Decompression +# +# \Net::HTTP does not compress the body of a request before sending. +# +# By default, \Net::HTTP adds header 'Accept-Encoding' +# to a new {request object}[rdoc-ref:Net::HTTPRequest]: +# +# Net::HTTP::Get.new(uri)['Accept-Encoding'] +# # => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" +# +# This requests the server to zip-encode the response body if there is one; +# the server is not required to do so. +# +# \Net::HTTP does not automatically decompress a response body +# if the response has header 'Content-Range'. +# +# Otherwise decompression (or not) depends on the value of header +# {Content-Encoding}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-encoding-response-header]: +# +# - 'deflate', 'gzip', or 'x-gzip': +# decompresses the body and deletes the header. +# - 'none' or 'identity': +# does not decompress the body, but deletes the header. +# - Any other value: +# leaves the body and header unchanged. +# +# == What's Here +# +# First, what's elsewhere. Class Net::HTTP: +# +# - Inherits from {class Object}[https://docs.ruby-lang.org/en/master/Object.html#class-Object-label-What-27s+Here]. +# +# This is a categorized summary of methods and attributes. +# +# === \Net::HTTP Objects +# +# - {::new}[rdoc-ref:Net::HTTP.new]: +# Creates a new instance. +# - {#inspect}[rdoc-ref:Net::HTTP#inspect]: +# Returns a string representation of +self+. +# +# === Sessions +# +# - {::start}[rdoc-ref:Net::HTTP.start]: +# Begins a new session in a new \Net::HTTP object. +# - {#started?}[rdoc-ref:Net::HTTP#started?] +# (aliased as {#active?}[rdoc-ref:Net::HTTP#active?]): +# Returns whether in a session. +# - {#finish}[rdoc-ref:Net::HTTP#finish]: +# Ends an active session. +# - {#start}[rdoc-ref:Net::HTTP#start]: +# Begins a new session in an existing \Net::HTTP object (+self+). +# +# === Connections +# +# - {:continue_timeout}[rdoc-ref:Net::HTTP#continue_timeout]: +# Returns the continue timeout. +# - {#continue_timeout=}[rdoc-ref:Net::HTTP#continue_timeout=]: +# Sets the continue timeout seconds. +# - {:keep_alive_timeout}[rdoc-ref:Net::HTTP#keep_alive_timeout]: +# Returns the keep-alive timeout. +# - {:keep_alive_timeout=}[rdoc-ref:Net::HTTP#keep_alive_timeout=]: +# Sets the keep-alive timeout. +# - {:max_retries}[rdoc-ref:Net::HTTP#max_retries]: +# Returns the maximum retries. +# - {#max_retries=}[rdoc-ref:Net::HTTP#max_retries=]: +# Sets the maximum retries. +# - {:open_timeout}[rdoc-ref:Net::HTTP#open_timeout]: +# Returns the open timeout. +# - {:open_timeout=}[rdoc-ref:Net::HTTP#open_timeout=]: +# Sets the open timeout. +# - {:read_timeout}[rdoc-ref:Net::HTTP#read_timeout]: +# Returns the open timeout. +# - {:read_timeout=}[rdoc-ref:Net::HTTP#read_timeout=]: +# Sets the read timeout. +# - {:ssl_timeout}[rdoc-ref:Net::HTTP#ssl_timeout]: +# Returns the ssl timeout. +# - {:ssl_timeout=}[rdoc-ref:Net::HTTP#ssl_timeout=]: +# Sets the ssl timeout. +# - {:write_timeout}[rdoc-ref:Net::HTTP#write_timeout]: +# Returns the write timeout. +# - {write_timeout=}[rdoc-ref:Net::HTTP#write_timeout=]: +# Sets the write timeout. +# +# === Requests +# +# - {::get}[rdoc-ref:Net::HTTP.get]: +# Sends a GET request and returns the string response body. +# - {::get_print}[rdoc-ref:Net::HTTP.get_print]: +# Sends a GET request and write the string response body to $stdout. +# - {::get_response}[rdoc-ref:Net::HTTP.get_response]: +# Sends a GET request and returns a response object. +# - {::post_form}[rdoc-ref:Net::HTTP.post_form]: +# Sends a POST request with form data and returns a response object. +# - {::post}[rdoc-ref:Net::HTTP.post]: +# Sends a POST request with data and returns a response object. +# - {::put}[rdoc-ref:Net::HTTP.put]: +# Sends a PUT request with data and returns a response object. +# - {#copy}[rdoc-ref:Net::HTTP#copy]: +# Sends a COPY request and returns a response object. +# - {#delete}[rdoc-ref:Net::HTTP#delete]: +# Sends a DELETE request and returns a response object. +# - {#get}[rdoc-ref:Net::HTTP#get]: +# Sends a GET request and returns a response object. +# - {#head}[rdoc-ref:Net::HTTP#head]: +# Sends a HEAD request and returns a response object. +# - {#lock}[rdoc-ref:Net::HTTP#lock]: +# Sends a LOCK request and returns a response object. +# - {#mkcol}[rdoc-ref:Net::HTTP#mkcol]: +# Sends a MKCOL request and returns a response object. +# - {#move}[rdoc-ref:Net::HTTP#move]: +# Sends a MOVE request and returns a response object. +# - {#options}[rdoc-ref:Net::HTTP#options]: +# Sends a OPTIONS request and returns a response object. +# - {#patch}[rdoc-ref:Net::HTTP#patch]: +# Sends a PATCH request and returns a response object. +# - {#post}[rdoc-ref:Net::HTTP#post]: +# Sends a POST request and returns a response object. +# - {#propfind}[rdoc-ref:Net::HTTP#propfind]: +# Sends a PROPFIND request and returns a response object. +# - {#proppatch}[rdoc-ref:Net::HTTP#proppatch]: +# Sends a PROPPATCH request and returns a response object. +# - {#put}[rdoc-ref:Net::HTTP#put]: +# Sends a PUT request and returns a response object. +# - {#request}[rdoc-ref:Net::HTTP#request]: +# Sends a request and returns a response object. +# - {#request_get}[rdoc-ref:Net::HTTP#request_get] +# (aliased as {#get2}[rdoc-ref:Net::HTTP#get2]): +# Sends a GET request and forms a response object; +# if a block given, calls the block with the object, +# otherwise returns the object. +# - {#request_head}[rdoc-ref:Net::HTTP#request_head] +# (aliased as {#head2}[rdoc-ref:Net::HTTP#head2]): +# Sends a HEAD request and forms a response object; +# if a block given, calls the block with the object, +# otherwise returns the object. +# - {#request_post}[rdoc-ref:Net::HTTP#request_post] +# (aliased as {#post2}[rdoc-ref:Net::HTTP#post2]): +# Sends a POST request and forms a response object; +# if a block given, calls the block with the object, +# otherwise returns the object. +# - {#send_request}[rdoc-ref:Net::HTTP#send_request]: +# Sends a request and returns a response object. +# - {#trace}[rdoc-ref:Net::HTTP#trace]: +# Sends a TRACE request and returns a response object. +# - {#unlock}[rdoc-ref:Net::HTTP#unlock]: +# Sends an UNLOCK request and returns a response object. +# +# === Responses +# +# - {:close_on_empty_response}[rdoc-ref:Net::HTTP#close_on_empty_response]: +# Returns whether to close connection on empty response. +# - {:close_on_empty_response=}[rdoc-ref:Net::HTTP#close_on_empty_response=]: +# Sets whether to close connection on empty response. +# - {:ignore_eof}[rdoc-ref:Net::HTTP#ignore_eof]: +# Returns whether to ignore end-of-file when reading a response body +# with Content-Length headers. +# - {:ignore_eof=}[rdoc-ref:Net::HTTP#ignore_eof=]: +# Sets whether to ignore end-of-file when reading a response body +# with Content-Length headers. +# - {:response_body_encoding}[rdoc-ref:Net::HTTP#response_body_encoding]: +# Returns the encoding to use for the response body. +# - {#response_body_encoding=}[rdoc-ref:Net::HTTP#response_body_encoding=]: +# Sets the response body encoding. +# +# === Proxies +# +# - {:proxy_address}[rdoc-ref:Net::HTTP#proxy_address]: +# Returns the proxy address. +# - {:proxy_address=}[rdoc-ref:Net::HTTP#proxy_address=]: +# Sets the proxy address. +# - {::proxy_class?}[rdoc-ref:Net::HTTP.proxy_class?]: +# Returns whether +self+ is a proxy class. +# - {#proxy?}[rdoc-ref:Net::HTTP#proxy?]: +# Returns whether +self+ has a proxy. +# - {#proxy_address}[rdoc-ref:Net::HTTP#proxy_address] +# (aliased as {#proxyaddr}[rdoc-ref:Net::HTTP#proxyaddr]): +# Returns the proxy address. +# - {#proxy_from_env?}[rdoc-ref:Net::HTTP#proxy_from_env?]: +# Returns whether the proxy is taken from an environment variable. +# - {:proxy_from_env=}[rdoc-ref:Net::HTTP#proxy_from_env=]: +# Sets whether the proxy is to be taken from an environment variable. +# - {:proxy_pass}[rdoc-ref:Net::HTTP#proxy_pass]: +# Returns the proxy password. +# - {:proxy_pass=}[rdoc-ref:Net::HTTP#proxy_pass=]: +# Sets the proxy password. +# - {:proxy_port}[rdoc-ref:Net::HTTP#proxy_port]: +# Returns the proxy port. +# - {:proxy_port=}[rdoc-ref:Net::HTTP#proxy_port=]: +# Sets the proxy port. +# - {#proxy_user}[rdoc-ref:Net::HTTP#proxy_user]: +# Returns the proxy user name. +# - {:proxy_user=}[rdoc-ref:Net::HTTP#proxy_user=]: +# Sets the proxy user. +# +# === Security +# +# - {:ca_file}[rdoc-ref:Net::HTTP#ca_file]: +# Returns the path to a CA certification file. +# - {:ca_file=}[rdoc-ref:Net::HTTP#ca_file=]: +# Sets the path to a CA certification file. +# - {:ca_path}[rdoc-ref:Net::HTTP#ca_path]: +# Returns the path of to CA directory containing certification files. +# - {:ca_path=}[rdoc-ref:Net::HTTP#ca_path=]: +# Sets the path of to CA directory containing certification files. +# - {:cert}[rdoc-ref:Net::HTTP#cert]: +# Returns the OpenSSL::X509::Certificate object to be used for client certification. +# - {:cert=}[rdoc-ref:Net::HTTP#cert=]: +# Sets the OpenSSL::X509::Certificate object to be used for client certification. +# - {:cert_store}[rdoc-ref:Net::HTTP#cert_store]: +# Returns the X509::Store to be used for verifying peer certificate. +# - {:cert_store=}[rdoc-ref:Net::HTTP#cert_store=]: +# Sets the X509::Store to be used for verifying peer certificate. +# - {:ciphers}[rdoc-ref:Net::HTTP#ciphers]: +# Returns the available SSL ciphers. +# - {:ciphers=}[rdoc-ref:Net::HTTP#ciphers=]: +# Sets the available SSL ciphers. +# - {:extra_chain_cert}[rdoc-ref:Net::HTTP#extra_chain_cert]: +# Returns the extra X509 certificates to be added to the certificate chain. +# - {:extra_chain_cert=}[rdoc-ref:Net::HTTP#extra_chain_cert=]: +# Sets the extra X509 certificates to be added to the certificate chain. +# - {:key}[rdoc-ref:Net::HTTP#key]: +# Returns the OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object. +# - {:key=}[rdoc-ref:Net::HTTP#key=]: +# Sets the OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object. +# - {:max_version}[rdoc-ref:Net::HTTP#max_version]: +# Returns the maximum SSL version. +# - {:max_version=}[rdoc-ref:Net::HTTP#max_version=]: +# Sets the maximum SSL version. +# - {:min_version}[rdoc-ref:Net::HTTP#min_version]: +# Returns the minimum SSL version. +# - {:min_version=}[rdoc-ref:Net::HTTP#min_version=]: +# Sets the minimum SSL version. +# - {#peer_cert}[rdoc-ref:Net::HTTP#peer_cert]: +# Returns the X509 certificate chain for the session's socket peer. +# - {:ssl_version}[rdoc-ref:Net::HTTP#ssl_version]: +# Returns the SSL version. +# - {:ssl_version=}[rdoc-ref:Net::HTTP#ssl_version=]: +# Sets the SSL version. +# - {#use_ssl=}[rdoc-ref:Net::HTTP#use_ssl=]: +# Sets whether a new session is to use Transport Layer Security. +# - {#use_ssl?}[rdoc-ref:Net::HTTP#use_ssl?]: +# Returns whether +self+ uses SSL. +# - {:verify_callback}[rdoc-ref:Net::HTTP#verify_callback]: +# Returns the callback for the server certification verification. +# - {:verify_callback=}[rdoc-ref:Net::HTTP#verify_callback=]: +# Sets the callback for the server certification verification. +# - {:verify_depth}[rdoc-ref:Net::HTTP#verify_depth]: +# Returns the maximum depth for the certificate chain verification. +# - {:verify_depth=}[rdoc-ref:Net::HTTP#verify_depth=]: +# Sets the maximum depth for the certificate chain verification. +# - {:verify_hostname}[rdoc-ref:Net::HTTP#verify_hostname]: +# Returns the flags for server the certification verification at the beginning of the SSL/TLS session. +# - {:verify_hostname=}[rdoc-ref:Net::HTTP#verify_hostname=]: +# Sets he flags for server the certification verification at the beginning of the SSL/TLS session. +# - {:verify_mode}[rdoc-ref:Net::HTTP#verify_mode]: +# Returns the flags for server the certification verification at the beginning of the SSL/TLS session. +# - {:verify_mode=}[rdoc-ref:Net::HTTP#verify_mode=]: +# Sets the flags for server the certification verification at the beginning of the SSL/TLS session. +# +# === Addresses and Ports +# +# - {:address}[rdoc-ref:Net::HTTP#address]: +# Returns the string host name or host IP. +# - {::default_port}[rdoc-ref:Net::HTTP.default_port]: +# Returns integer 80, the default port to use for HTTP requests. +# - {::http_default_port}[rdoc-ref:Net::HTTP.http_default_port]: +# Returns integer 80, the default port to use for HTTP requests. +# - {::https_default_port}[rdoc-ref:Net::HTTP.https_default_port]: +# Returns integer 443, the default port to use for HTTPS requests. +# - {#ipaddr}[rdoc-ref:Net::HTTP#ipaddr]: +# Returns the IP address for the connection. +# - {#ipaddr=}[rdoc-ref:Net::HTTP#ipaddr=]: +# Sets the IP address for the connection. +# - {:local_host}[rdoc-ref:Net::HTTP#local_host]: +# Returns the string local host used to establish the connection. +# - {:local_host=}[rdoc-ref:Net::HTTP#local_host=]: +# Sets the string local host used to establish the connection. +# - {:local_port}[rdoc-ref:Net::HTTP#local_port]: +# Returns the integer local port used to establish the connection. +# - {:local_port=}[rdoc-ref:Net::HTTP#local_port=]: +# Sets the integer local port used to establish the connection. +# - {:port}[rdoc-ref:Net::HTTP#port]: +# Returns the integer port number. +# +# === \HTTP Version +# +# - {::version_1_2?}[rdoc-ref:Net::HTTP.version_1_2?] +# (aliased as {::is_version_1_2?}[rdoc-ref:Net::HTTP.is_version_1_2?] +# and {::version_1_2}[rdoc-ref:Net::HTTP.version_1_2]): +# Returns true; retained for compatibility. +# +# === Debugging +# +# - {#set_debug_output}[rdoc-ref:Net::HTTP#set_debug_output]: +# Sets the output stream for debugging. +# +# source://net-http//lib/net/http.rb#730 +class Net::HTTP < ::Net::Protocol + # Creates a new \Net::HTTP object for the specified server address, + # without opening the TCP connection or initializing the \HTTP session. + # The +address+ should be a DNS hostname or IP address. + # + # @return [HTTP] a new instance of HTTP + # + # source://net-http//lib/net/http.rb#1154 + def initialize(address, port = T.unsafe(nil)); end + + # Returns +true+ if the \HTTP session has been started: + # + # http = Net::HTTP.new(hostname) + # http.started? # => false + # http.start + # http.started? # => true + # http.finish # => nil + # http.started? # => false + # + # Net::HTTP.start(hostname) do |http| + # http.started? + # end # => true + # http.started? # => false + # + # @return [Boolean] + # + # source://net-http//lib/net/http.rb#1490 + def active?; end + + # Returns the string host name or host IP given as argument +address+ in ::new. + # + # source://net-http//lib/net/http.rb#1270 + def address; end + + # Sets or returns the path to a CA certification file in PEM format. + # + # source://net-http//lib/net/http.rb#1541 + def ca_file; end + + # Sets or returns the path to a CA certification file in PEM format. + # + # source://net-http//lib/net/http.rb#1541 + def ca_file=(_arg0); end + + # Sets or returns the path of to CA directory + # containing certification files in PEM format. + # + # source://net-http//lib/net/http.rb#1545 + def ca_path; end + + # Sets or returns the path of to CA directory + # containing certification files in PEM format. + # + # source://net-http//lib/net/http.rb#1545 + def ca_path=(_arg0); end + + # Sets or returns the OpenSSL::X509::Certificate object + # to be used for client certification. + # + # source://net-http//lib/net/http.rb#1549 + def cert; end + + # Sets or returns the OpenSSL::X509::Certificate object + # to be used for client certification. + # + # source://net-http//lib/net/http.rb#1549 + def cert=(_arg0); end + + # Sets or returns the X509::Store to be used for verifying peer certificate. + # + # source://net-http//lib/net/http.rb#1552 + def cert_store; end + + # Sets or returns the X509::Store to be used for verifying peer certificate. + # + # source://net-http//lib/net/http.rb#1552 + def cert_store=(_arg0); end + + # Sets or returns the available SSL ciphers. + # See {OpenSSL::SSL::SSLContext#ciphers=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-ciphers-3D]. + # + # source://net-http//lib/net/http.rb#1556 + def ciphers; end + + # Sets or returns the available SSL ciphers. + # See {OpenSSL::SSL::SSLContext#ciphers=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-ciphers-3D]. + # + # source://net-http//lib/net/http.rb#1556 + def ciphers=(_arg0); end + + # Sets or returns whether to close the connection when the response is empty; + # initially +false+. + # + # source://net-http//lib/net/http.rb#1498 + def close_on_empty_response; end + + # Sets or returns whether to close the connection when the response is empty; + # initially +false+. + # + # source://net-http//lib/net/http.rb#1498 + def close_on_empty_response=(_arg0); end + + # Returns the continue timeout value; + # see continue_timeout=. + # + # source://net-http//lib/net/http.rb#1451 + def continue_timeout; end + + # Sets the continue timeout value, + # which is the number of seconds to wait for an expected 100 Continue response. + # If the \HTTP object does not receive a response in this many seconds + # it sends the request body. + # + # source://net-http//lib/net/http.rb#1457 + def continue_timeout=(sec); end + + # Sends a COPY request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Copy object + # created from string +path+ and initial headers hash +initheader+. + # + # http = Net::HTTP.new(hostname) + # http.copy('/todos/1') + # + # source://net-http//lib/net/http.rb#2201 + def copy(path, initheader = T.unsafe(nil)); end + + # Sends a DELETE request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Delete object + # created from string +path+ and initial headers hash +initheader+. + # + # http = Net::HTTP.new(hostname) + # http.delete('/todos/1') + # + # source://net-http//lib/net/http.rb#2175 + def delete(path, initheader = T.unsafe(nil)); end + + # Sets or returns the extra X509 certificates to be added to the certificate chain. + # See {OpenSSL::SSL::SSLContext#add_certificate}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-add_certificate]. + # + # source://net-http//lib/net/http.rb#1560 + def extra_chain_cert; end + + # Sets or returns the extra X509 certificates to be added to the certificate chain. + # See {OpenSSL::SSL::SSLContext#add_certificate}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-add_certificate]. + # + # source://net-http//lib/net/http.rb#1560 + def extra_chain_cert=(_arg0); end + + # Finishes the \HTTP session: + # + # http = Net::HTTP.new(hostname) + # http.start + # http.started? # => true + # http.finish # => nil + # http.started? # => false + # + # Raises IOError if not in a session. + # + # @raise [IOError] + # + # source://net-http//lib/net/http.rb#1776 + def finish; end + + # :call-seq: + # get(path, initheader = nil) {|res| ... } + # + # Sends a GET request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Get object + # created from string +path+ and initial headers hash +initheader+. + # + # With a block given, calls the block with the response body: + # + # http = Net::HTTP.new(hostname) + # http.get('/todos/1') do |res| + # p res + # end # => # + # + # Output: + # + # "{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n}" + # + # With no block given, simply returns the response object: + # + # http.get('/') # => # + # + # Related: + # + # - Net::HTTP::Get: request class for \HTTP method GET. + # - Net::HTTP.get: sends GET request, returns response body. + # + # source://net-http//lib/net/http.rb#1987 + def get(path, initheader = T.unsafe(nil), dest = T.unsafe(nil), &block); end + + # Sends a GET request to the server; + # forms the response into a Net::HTTPResponse object. + # + # The request is based on the Net::HTTP::Get object + # created from string +path+ and initial headers hash +initheader+. + # + # With no block given, returns the response object: + # + # http = Net::HTTP.new(hostname) + # http.request_get('/todos') # => # + # + # With a block given, calls the block with the response object + # and returns the response object: + # + # http.request_get('/todos') do |res| + # p res + # end # => # + # + # Output: + # + # # + # + # source://net-http//lib/net/http.rb#2254 + def get2(path, initheader = T.unsafe(nil), &block); end + + # Sends a HEAD request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Head object + # created from string +path+ and initial headers hash +initheader+: + # + # res = http.head('/todos/1') # => # + # res.body # => nil + # res.to_hash.take(3) + # # => + # [["date", ["Wed, 15 Feb 2023 15:25:42 GMT"]], + # ["content-type", ["application/json; charset=utf-8"]], + # ["connection", ["close"]]] + # + # source://net-http//lib/net/http.rb#2011 + def head(path, initheader = T.unsafe(nil)); end + + # Sends a HEAD request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Head object + # created from string +path+ and initial headers hash +initheader+. + # + # http = Net::HTTP.new(hostname) + # http.head('/todos/1') # => # + # + # source://net-http//lib/net/http.rb#2267 + def head2(path, initheader = T.unsafe(nil), &block); end + + # Sets or returns whether to ignore end-of-file when reading a response body + # with Content-Length headers; + # initially +true+. + # + # source://net-http//lib/net/http.rb#1474 + def ignore_eof; end + + # Sets or returns whether to ignore end-of-file when reading a response body + # with Content-Length headers; + # initially +true+. + # + # source://net-http//lib/net/http.rb#1474 + def ignore_eof=(_arg0); end + + # Returns a string representation of +self+: + # + # Net::HTTP.new(hostname).inspect + # # => "#" + # + # source://net-http//lib/net/http.rb#1211 + def inspect; end + + # Returns the IP address for the connection. + # + # If the session has not been started, + # returns the value set by #ipaddr=, + # or +nil+ if it has not been set: + # + # http = Net::HTTP.new(hostname) + # http.ipaddr # => nil + # http.ipaddr = '172.67.155.76' + # http.ipaddr # => "172.67.155.76" + # + # If the session has been started, + # returns the IP address from the socket: + # + # http = Net::HTTP.new(hostname) + # http.start + # http.ipaddr # => "172.67.155.76" + # http.finish + # + # source://net-http//lib/net/http.rb#1351 + def ipaddr; end + + # Sets the IP address for the connection: + # + # http = Net::HTTP.new(hostname) + # http.ipaddr # => nil + # http.ipaddr = '172.67.155.76' + # http.ipaddr # => "172.67.155.76" + # + # The IP address may not be set if the session has been started. + # + # @raise [IOError] + # + # source://net-http//lib/net/http.rb#1363 + def ipaddr=(addr); end + + # Sets or returns the numeric (\Integer or \Float) number of seconds + # to keep the connection open after a request is sent; + # initially 2. + # If a new request is made during the given interval, + # the still-open connection is used; + # otherwise the connection will have been closed + # and a new connection is opened. + # + # source://net-http//lib/net/http.rb#1469 + def keep_alive_timeout; end + + # Sets or returns the numeric (\Integer or \Float) number of seconds + # to keep the connection open after a request is sent; + # initially 2. + # If a new request is made during the given interval, + # the still-open connection is used; + # otherwise the connection will have been closed + # and a new connection is opened. + # + # source://net-http//lib/net/http.rb#1469 + def keep_alive_timeout=(_arg0); end + + # Sets or returns the OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object. + # + # source://net-http//lib/net/http.rb#1563 + def key; end + + # Sets or returns the OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object. + # + # source://net-http//lib/net/http.rb#1563 + def key=(_arg0); end + + # Sets or returns the string local host used to establish the connection; + # initially +nil+. + # + # source://net-http//lib/net/http.rb#1277 + def local_host; end + + # Sets or returns the string local host used to establish the connection; + # initially +nil+. + # + # source://net-http//lib/net/http.rb#1277 + def local_host=(_arg0); end + + # Sets or returns the integer local port used to establish the connection; + # initially +nil+. + # + # source://net-http//lib/net/http.rb#1281 + def local_port; end + + # Sets or returns the integer local port used to establish the connection; + # initially +nil+. + # + # source://net-http//lib/net/http.rb#1281 + def local_port=(_arg0); end + + # Sends a LOCK request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Lock object + # created from string +path+, string +body+, and initial headers hash +initheader+. + # + # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}' + # http = Net::HTTP.new(hostname) + # http.lock('/todos/1', data) + # + # source://net-http//lib/net/http.rb#2121 + def lock(path, body, initheader = T.unsafe(nil)); end + + # Returns the maximum number of times to retry an idempotent request; + # see #max_retries=. + # + # source://net-http//lib/net/http.rb#1407 + def max_retries; end + + # Sets the maximum number of times to retry an idempotent request in case of + # \Net::ReadTimeout, IOError, EOFError, Errno::ECONNRESET, + # Errno::ECONNABORTED, Errno::EPIPE, OpenSSL::SSL::SSLError, + # Timeout::Error. + # The initial value is 1. + # + # Argument +retries+ must be a non-negative numeric value: + # + # http = Net::HTTP.new(hostname) + # http.max_retries = 2 # => 2 + # http.max_retries # => 2 + # + # source://net-http//lib/net/http.rb#1397 + def max_retries=(retries); end + + # Sets or returns the maximum SSL version. + # See {OpenSSL::SSL::SSLContext#max_version=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-max_version-3D]. + # + # source://net-http//lib/net/http.rb#1578 + def max_version; end + + # Sets or returns the maximum SSL version. + # See {OpenSSL::SSL::SSLContext#max_version=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-max_version-3D]. + # + # source://net-http//lib/net/http.rb#1578 + def max_version=(_arg0); end + + # Sets or returns the minimum SSL version. + # See {OpenSSL::SSL::SSLContext#min_version=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-min_version-3D]. + # + # source://net-http//lib/net/http.rb#1574 + def min_version; end + + # Sets or returns the minimum SSL version. + # See {OpenSSL::SSL::SSLContext#min_version=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-min_version-3D]. + # + # source://net-http//lib/net/http.rb#1574 + def min_version=(_arg0); end + + # Sends a MKCOL request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Mkcol object + # created from string +path+, string +body+, and initial headers hash +initheader+. + # + # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}' + # http.mkcol('/todos/1', data) + # http = Net::HTTP.new(hostname) + # + # source://net-http//lib/net/http.rb#2215 + def mkcol(path, body = T.unsafe(nil), initheader = T.unsafe(nil)); end + + # Sends a MOVE request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Move object + # created from string +path+ and initial headers hash +initheader+. + # + # http = Net::HTTP.new(hostname) + # http.move('/todos/1') + # + # source://net-http//lib/net/http.rb#2188 + def move(path, initheader = T.unsafe(nil)); end + + # Sets or returns the numeric (\Integer or \Float) number of seconds + # to wait for a connection to open; + # initially 60. + # If the connection is not made in the given interval, + # an exception is raised. + # + # source://net-http//lib/net/http.rb#1373 + def open_timeout; end + + # Sets or returns the numeric (\Integer or \Float) number of seconds + # to wait for a connection to open; + # initially 60. + # If the connection is not made in the given interval, + # an exception is raised. + # + # source://net-http//lib/net/http.rb#1373 + def open_timeout=(_arg0); end + + # Sends an Options request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Options object + # created from string +path+ and initial headers hash +initheader+. + # + # http = Net::HTTP.new(hostname) + # http.options('/') + # + # source://net-http//lib/net/http.rb#2148 + def options(path, initheader = T.unsafe(nil)); end + + # :call-seq: + # patch(path, data, initheader = nil) {|res| ... } + # + # Sends a PATCH request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Patch object + # created from string +path+, string +data+, and initial headers hash +initheader+. + # + # With a block given, calls the block with the response body: + # + # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}' + # http = Net::HTTP.new(hostname) + # http.patch('/todos/1', data) do |res| + # p res + # end # => # + # + # Output: + # + # "{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false,\n \"{\\\"userId\\\": 1, \\\"id\\\": 1, \\\"title\\\": \\\"delectus aut autem\\\", \\\"completed\\\": false}\": \"\"\n}" + # + # With no block given, simply returns the response object: + # + # http.patch('/todos/1', data) # => # + # + # source://net-http//lib/net/http.rb#2074 + def patch(path, data, initheader = T.unsafe(nil), dest = T.unsafe(nil), &block); end + + # Returns the X509 certificate chain (an array of strings) + # for the session's socket peer, + # or +nil+ if none. + # + # source://net-http//lib/net/http.rb#1599 + def peer_cert; end + + # Returns the integer port number given as argument +port+ in ::new. + # + # source://net-http//lib/net/http.rb#1273 + def port; end + + # :call-seq: + # post(path, data, initheader = nil) {|res| ... } + # + # Sends a POST request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Post object + # created from string +path+, string +data+, and initial headers hash +initheader+. + # + # With a block given, calls the block with the response body: + # + # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}' + # http = Net::HTTP.new(hostname) + # http.post('/todos', data) do |res| + # p res + # end # => # + # + # Output: + # + # "{\n \"{\\\"userId\\\": 1, \\\"id\\\": 1, \\\"title\\\": \\\"delectus aut autem\\\", \\\"completed\\\": false}\": \"\",\n \"id\": 201\n}" + # + # With no block given, simply returns the response object: + # + # http.post('/todos', data) # => # + # + # Related: + # + # - Net::HTTP::Post: request class for \HTTP method POST. + # - Net::HTTP.post: sends POST request, returns response body. + # + # source://net-http//lib/net/http.rb#2045 + def post(path, data, initheader = T.unsafe(nil), dest = T.unsafe(nil), &block); end + + # Sends a POST request to the server; + # forms the response into a Net::HTTPResponse object. + # + # The request is based on the Net::HTTP::Post object + # created from string +path+, string +data+, and initial headers hash +initheader+. + # + # With no block given, returns the response object: + # + # http = Net::HTTP.new(hostname) + # http.post('/todos', 'xyzzy') + # # => # + # + # With a block given, calls the block with the response body + # and returns the response object: + # + # http.post('/todos', 'xyzzy') do |res| + # p res + # end # => # + # + # Output: + # + # "{\n \"xyzzy\": \"\",\n \"id\": 201\n}" + # + # source://net-http//lib/net/http.rb#2294 + def post2(path, data, initheader = T.unsafe(nil), &block); end + + # Sends a PROPFIND request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Propfind object + # created from string +path+, string +body+, and initial headers hash +initheader+. + # + # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}' + # http = Net::HTTP.new(hostname) + # http.propfind('/todos/1', data) + # + # source://net-http//lib/net/http.rb#2162 + def propfind(path, body = T.unsafe(nil), initheader = T.unsafe(nil)); end + + # Sends a PROPPATCH request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Proppatch object + # created from string +path+, string +body+, and initial headers hash +initheader+. + # + # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}' + # http = Net::HTTP.new(hostname) + # http.proppatch('/todos/1', data) + # + # source://net-http//lib/net/http.rb#2107 + def proppatch(path, body, initheader = T.unsafe(nil)); end + + # Returns +true+ if a proxy server is defined, +false+ otherwise; + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # + # @return [Boolean] + # + # source://net-http//lib/net/http.rb#1858 + def proxy?; end + + # Returns the address of the proxy server, if defined, +nil+ otherwise; + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # + # source://net-http//lib/net/http.rb#1880 + def proxy_address; end + + # Sets the proxy address; + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # + # source://net-http//lib/net/http.rb#1317 + def proxy_address=(_arg0); end + + # Sets whether to determine the proxy from environment variable + # 'ENV['http_proxy']'; + # see {Proxy Using ENV['http_proxy']}[rdoc-ref:Net::HTTP@Proxy+Using+-27ENV-5B-27http_proxy-27-5D-27]. + # + # source://net-http//lib/net/http.rb#1313 + def proxy_from_env=(_arg0); end + + # Returns +true+ if the proxy server is defined in the environment, + # +false+ otherwise; + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # + # @return [Boolean] + # + # source://net-http//lib/net/http.rb#1865 + def proxy_from_env?; end + + # Returns the password of the proxy server, if defined, +nil+ otherwise; + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # + # source://net-http//lib/net/http.rb#1911 + def proxy_pass; end + + # Sets the proxy password; + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # + # source://net-http//lib/net/http.rb#1329 + def proxy_pass=(_arg0); end + + # Returns the port number of the proxy server, if defined, +nil+ otherwise; + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # + # source://net-http//lib/net/http.rb#1890 + def proxy_port; end + + # Sets the proxy port; + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # + # source://net-http//lib/net/http.rb#1321 + def proxy_port=(_arg0); end + + # The proxy URI determined from the environment for this connection. + # + # source://net-http//lib/net/http.rb#1870 + def proxy_uri; end + + # Sets the attribute proxy_use_ssl + # + # @param value the value to set the attribute proxy_use_ssl to. + # + # source://net-http//lib/net/http.rb#1330 + def proxy_use_ssl=(_arg0); end + + # Returns the user name of the proxy server, if defined, +nil+ otherwise; + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # + # source://net-http//lib/net/http.rb#1900 + def proxy_user; end + + # Sets the proxy user; + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # + # source://net-http//lib/net/http.rb#1325 + def proxy_user=(_arg0); end + + # Returns the address of the proxy server, if defined, +nil+ otherwise; + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # + # source://net-http//lib/net/http.rb#1880 + def proxyaddr; end + + # Returns the port number of the proxy server, if defined, +nil+ otherwise; + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # + # source://net-http//lib/net/http.rb#1890 + def proxyport; end + + # Sends a PUT request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Put object + # created from string +path+, string +data+, and initial headers hash +initheader+. + # + # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}' + # http = Net::HTTP.new(hostname) + # http.put('/todos/1', data) # => # + # + # Related: + # + # - Net::HTTP::Put: request class for \HTTP method PUT. + # - Net::HTTP.put: sends PUT request, returns response body. + # + # source://net-http//lib/net/http.rb#2093 + def put(path, data, initheader = T.unsafe(nil)); end + + # Sends a PUT request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Put object + # created from string +path+, string +data+, and initial headers hash +initheader+. + # + # http = Net::HTTP.new(hostname) + # http.put('/todos/1', 'xyzzy') + # # => # + # + # source://net-http//lib/net/http.rb#2308 + def put2(path, data, initheader = T.unsafe(nil), &block); end + + # Returns the numeric (\Integer or \Float) number of seconds + # to wait for one block to be read (via one read(2) call); + # see #read_timeout=. + # + # source://net-http//lib/net/http.rb#1378 + def read_timeout; end + + # Sets the read timeout, in seconds, for +self+ to integer +sec+; + # the initial value is 60. + # + # Argument +sec+ must be a non-negative numeric value: + # + # http = Net::HTTP.new(hostname) + # http.read_timeout # => 60 + # http.get('/todos/1') # => # + # http.read_timeout = 0 + # http.get('/todos/1') # Raises Net::ReadTimeout. + # + # source://net-http//lib/net/http.rb#1420 + def read_timeout=(sec); end + + # Sends a GET request to the server; + # forms the response into a Net::HTTPResponse object. + # + # The request is based on the Net::HTTP::Get object + # created from string +path+ and initial headers hash +initheader+. + # + # With no block given, returns the response object: + # + # http = Net::HTTP.new(hostname) + # http.request_get('/todos') # => # + # + # With a block given, calls the block with the response object + # and returns the response object: + # + # http.request_get('/todos') do |res| + # p res + # end # => # + # + # Output: + # + # # + # + # source://net-http//lib/net/http.rb#2254 + def request_get(path, initheader = T.unsafe(nil), &block); end + + # Sends a HEAD request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Head object + # created from string +path+ and initial headers hash +initheader+. + # + # http = Net::HTTP.new(hostname) + # http.head('/todos/1') # => # + # + # source://net-http//lib/net/http.rb#2267 + def request_head(path, initheader = T.unsafe(nil), &block); end + + # Sends a POST request to the server; + # forms the response into a Net::HTTPResponse object. + # + # The request is based on the Net::HTTP::Post object + # created from string +path+, string +data+, and initial headers hash +initheader+. + # + # With no block given, returns the response object: + # + # http = Net::HTTP.new(hostname) + # http.post('/todos', 'xyzzy') + # # => # + # + # With a block given, calls the block with the response body + # and returns the response object: + # + # http.post('/todos', 'xyzzy') do |res| + # p res + # end # => # + # + # Output: + # + # "{\n \"xyzzy\": \"\",\n \"id\": 201\n}" + # + # source://net-http//lib/net/http.rb#2294 + def request_post(path, data, initheader = T.unsafe(nil), &block); end + + # Sends a PUT request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Put object + # created from string +path+, string +data+, and initial headers hash +initheader+. + # + # http = Net::HTTP.new(hostname) + # http.put('/todos/1', 'xyzzy') + # # => # + # + # source://net-http//lib/net/http.rb#2308 + def request_put(path, data, initheader = T.unsafe(nil), &block); end + + # source://net-http//lib/net/http.rb#2373 + def request_without_mini_profiler(req, body = T.unsafe(nil), &block); end + + # Returns the encoding to use for the response body; + # see #response_body_encoding=. + # + # source://net-http//lib/net/http.rb#1285 + def response_body_encoding; end + + # Sets the encoding to be used for the response body; + # returns the encoding. + # + # The given +value+ may be: + # + # - An Encoding object. + # - The name of an encoding. + # - An alias for an encoding name. + # + # See {Encoding}[https://docs.ruby-lang.org/en/master/Encoding.html]. + # + # Examples: + # + # http = Net::HTTP.new(hostname) + # http.response_body_encoding = Encoding::US_ASCII # => # + # http.response_body_encoding = 'US-ASCII' # => "US-ASCII" + # http.response_body_encoding = 'ASCII' # => "ASCII" + # + # source://net-http//lib/net/http.rb#1305 + def response_body_encoding=(value); end + + # Sends an \HTTP request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTPRequest object + # created from string +path+, string +data+, and initial headers hash +header+. + # That object is an instance of the + # {subclass of Net::HTTPRequest}[rdoc-ref:Net::HTTPRequest@Request+Subclasses], + # that corresponds to the given uppercase string +name+, + # which must be + # an {HTTP request method}[https://en.wikipedia.org/wiki/HTTP#Request_methods] + # or a {WebDAV request method}[https://en.wikipedia.org/wiki/WebDAV#Implementation]. + # + # Examples: + # + # http = Net::HTTP.new(hostname) + # http.send_request('GET', '/todos/1') + # # => # + # http.send_request('POST', '/todos', 'xyzzy') + # # => # + # + # source://net-http//lib/net/http.rb#2337 + def send_request(name, path, data = T.unsafe(nil), header = T.unsafe(nil)); end + + # *WARNING* This method opens a serious security hole. + # Never use this method in production code. + # + # Sets the output stream for debugging: + # + # http = Net::HTTP.new(hostname) + # File.open('t.tmp', 'w') do |file| + # http.set_debug_output(file) + # http.start + # http.get('/nosuch/1') + # http.finish + # end + # puts File.read('t.tmp') + # + # Output: + # + # opening connection to jsonplaceholder.typicode.com:80... + # opened + # <- "GET /nosuch/1 HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nHost: jsonplaceholder.typicode.com\r\n\r\n" + # -> "HTTP/1.1 404 Not Found\r\n" + # -> "Date: Mon, 12 Dec 2022 21:14:11 GMT\r\n" + # -> "Content-Type: application/json; charset=utf-8\r\n" + # -> "Content-Length: 2\r\n" + # -> "Connection: keep-alive\r\n" + # -> "X-Powered-By: Express\r\n" + # -> "X-Ratelimit-Limit: 1000\r\n" + # -> "X-Ratelimit-Remaining: 999\r\n" + # -> "X-Ratelimit-Reset: 1670879660\r\n" + # -> "Vary: Origin, Accept-Encoding\r\n" + # -> "Access-Control-Allow-Credentials: true\r\n" + # -> "Cache-Control: max-age=43200\r\n" + # -> "Pragma: no-cache\r\n" + # -> "Expires: -1\r\n" + # -> "X-Content-Type-Options: nosniff\r\n" + # -> "Etag: W/\"2-vyGp6PvFo4RvsFtPoIWeCReyIC8\"\r\n" + # -> "Via: 1.1 vegur\r\n" + # -> "CF-Cache-Status: MISS\r\n" + # -> "Server-Timing: cf-q-config;dur=1.3000000762986e-05\r\n" + # -> "Report-To: {\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=yOr40jo%2BwS1KHzhTlVpl54beJ5Wx2FcG4gGV0XVrh3X9OlR5q4drUn2dkt5DGO4GDcE%2BVXT7CNgJvGs%2BZleIyMu8CLieFiDIvOviOY3EhHg94m0ZNZgrEdpKD0S85S507l1vsEwEHkoTm%2Ff19SiO\"}],\"group\":\"cf-nel\",\"max_age\":604800}\r\n" + # -> "NEL: {\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}\r\n" + # -> "Server: cloudflare\r\n" + # -> "CF-RAY: 778977dc484ce591-DFW\r\n" + # -> "alt-svc: h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400\r\n" + # -> "\r\n" + # reading 2 bytes... + # -> "{}" + # read 2 bytes + # Conn keep-alive + # + # source://net-http//lib/net/http.rb#1264 + def set_debug_output(output); end + + # Sets or returns the SSL timeout seconds. + # + # source://net-http//lib/net/http.rb#1566 + def ssl_timeout; end + + # Sets or returns the SSL timeout seconds. + # + # source://net-http//lib/net/http.rb#1566 + def ssl_timeout=(_arg0); end + + # Sets or returns the SSL version. + # See {OpenSSL::SSL::SSLContext#ssl_version=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-ssl_version-3D]. + # + # source://net-http//lib/net/http.rb#1570 + def ssl_version; end + + # Sets or returns the SSL version. + # See {OpenSSL::SSL::SSLContext#ssl_version=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#method-i-ssl_version-3D]. + # + # source://net-http//lib/net/http.rb#1570 + def ssl_version=(_arg0); end + + # Starts an \HTTP session. + # + # Without a block, returns +self+: + # + # http = Net::HTTP.new(hostname) + # # => # + # http.start + # # => # + # http.started? # => true + # http.finish + # + # With a block, calls the block with +self+, + # finishes the session when the block exits, + # and returns the block's value: + # + # http.start do |http| + # http + # end + # # => # + # http.started? # => false + # + # @raise [IOError] + # + # source://net-http//lib/net/http.rb#1627 + def start; end + + # Returns +true+ if the \HTTP session has been started: + # + # http = Net::HTTP.new(hostname) + # http.started? # => false + # http.start + # http.started? # => true + # http.finish # => nil + # http.started? # => false + # + # Net::HTTP.start(hostname) do |http| + # http.started? + # end # => true + # http.started? # => false + # + # @return [Boolean] + # + # source://net-http//lib/net/http.rb#1490 + def started?; end + + # Sends a TRACE request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Trace object + # created from string +path+ and initial headers hash +initheader+. + # + # http = Net::HTTP.new(hostname) + # http.trace('/todos/1') + # + # source://net-http//lib/net/http.rb#2228 + def trace(path, initheader = T.unsafe(nil)); end + + # Sends an UNLOCK request to the server; + # returns an instance of a subclass of Net::HTTPResponse. + # + # The request is based on the Net::HTTP::Unlock object + # created from string +path+, string +body+, and initial headers hash +initheader+. + # + # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}' + # http = Net::HTTP.new(hostname) + # http.unlock('/todos/1', data) + # + # source://net-http//lib/net/http.rb#2135 + def unlock(path, body, initheader = T.unsafe(nil)); end + + # Sets whether a new session is to use + # {Transport Layer Security}[https://en.wikipedia.org/wiki/Transport_Layer_Security]: + # + # Raises IOError if attempting to change during a session. + # + # Raises OpenSSL::SSL::SSLError if the port is not an HTTPS port. + # + # source://net-http//lib/net/http.rb#1512 + def use_ssl=(flag); end + + # Returns +true+ if +self+ uses SSL, +false+ otherwise. + # See Net::HTTP#use_ssl=. + # + # @return [Boolean] + # + # source://net-http//lib/net/http.rb#1502 + def use_ssl?; end + + # Sets or returns the callback for the server certification verification. + # + # source://net-http//lib/net/http.rb#1581 + def verify_callback; end + + # Sets or returns the callback for the server certification verification. + # + # source://net-http//lib/net/http.rb#1581 + def verify_callback=(_arg0); end + + # Sets or returns the maximum depth for the certificate chain verification. + # + # source://net-http//lib/net/http.rb#1584 + def verify_depth; end + + # Sets or returns the maximum depth for the certificate chain verification. + # + # source://net-http//lib/net/http.rb#1584 + def verify_depth=(_arg0); end + + # Sets or returns whether to verify that the server certificate is valid + # for the hostname. + # See {OpenSSL::SSL::SSLContext#verify_hostname=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#attribute-i-verify_mode]. + # + # source://net-http//lib/net/http.rb#1594 + def verify_hostname; end + + # Sets or returns whether to verify that the server certificate is valid + # for the hostname. + # See {OpenSSL::SSL::SSLContext#verify_hostname=}[https://docs.ruby-lang.org/en/master/OpenSSL/SSL/SSLContext.html#attribute-i-verify_mode]. + # + # source://net-http//lib/net/http.rb#1594 + def verify_hostname=(_arg0); end + + # Sets or returns the flags for server the certification verification + # at the beginning of the SSL/TLS session. + # OpenSSL::SSL::VERIFY_NONE or OpenSSL::SSL::VERIFY_PEER are acceptable. + # + # source://net-http//lib/net/http.rb#1589 + def verify_mode; end + + # Sets or returns the flags for server the certification verification + # at the beginning of the SSL/TLS session. + # OpenSSL::SSL::VERIFY_NONE or OpenSSL::SSL::VERIFY_PEER are acceptable. + # + # source://net-http//lib/net/http.rb#1589 + def verify_mode=(_arg0); end + + # Returns the numeric (\Integer or \Float) number of seconds + # to wait for one block to be written (via one write(2) call); + # see #write_timeout=. + # + # source://net-http//lib/net/http.rb#1383 + def write_timeout; end + + # Sets the write timeout, in seconds, for +self+ to integer +sec+; + # the initial value is 60. + # + # Argument +sec+ must be a non-negative numeric value: + # + # _uri = uri.dup + # _uri.path = '/posts' + # body = 'bar' * 200000 + # data = < 60 + # http.post(_uri.path, data, headers) + # # => # + # http.write_timeout = 0 + # http.post(_uri.path, data, headers) # Raises Net::WriteTimeout. + # + # source://net-http//lib/net/http.rb#1444 + def write_timeout=(sec); end + + private + + # Adds a message to debugging output + # + # source://net-http//lib/net/http.rb#2553 + def D(msg); end + + # source://net-http//lib/net/http.rb#2545 + def addr_port; end + + # source://net-http//lib/net/http.rb#2462 + def begin_transport(req); end + + # without proxy, obsolete + # + # source://net-http//lib/net/http.rb#1932 + def conn_address; end + + # source://net-http//lib/net/http.rb#1936 + def conn_port; end + + # source://net-http//lib/net/http.rb#1647 + def connect; end + + # Adds a message to debugging output + # + # source://net-http//lib/net/http.rb#2553 + def debug(msg); end + + # source://net-http//lib/net/http.rb#1781 + def do_finish; end + + # source://net-http//lib/net/http.rb#1641 + def do_start; end + + # source://net-http//lib/net/http.rb#1940 + def edit_path(path); end + + # source://net-http//lib/net/http.rb#2485 + def end_transport(req, res); end + + # @return [Boolean] + # + # source://net-http//lib/net/http.rb#2502 + def keep_alive?(req, res); end + + # source://net-http//lib/net/http.rb#1763 + def on_connect; end + + # Executes a request which uses a representation + # and returns its body. + # + # source://net-http//lib/net/http.rb#2396 + def send_entity(path, data, initheader, dest, type, &block); end + + # source://net-http//lib/net/http.rb#2526 + def sspi_auth(req); end + + # @return [Boolean] + # + # source://net-http//lib/net/http.rb#2511 + def sspi_auth?(res); end + + # source://net-http//lib/net/http.rb#2407 + def transport_request(req); end + + # source://net-http//lib/net/http.rb#1925 + def unescape(value); end + + class << self + # Creates an \HTTP proxy class which behaves like \Net::HTTP, but + # performs all access via the specified proxy. + # + # This class is obsolete. You may pass these same parameters directly to + # \Net::HTTP.new. See Net::HTTP.new for details of the arguments. + # + # source://net-http//lib/net/http.rb#1808 + def Proxy(p_addr = T.unsafe(nil), p_port = T.unsafe(nil), p_user = T.unsafe(nil), p_pass = T.unsafe(nil), p_use_ssl = T.unsafe(nil)); end + + # Allows to set the default configuration that will be used + # when creating a new connection. + # + # Example: + # + # Net::HTTP.default_configuration = { + # read_timeout: 1, + # write_timeout: 1 + # } + # http = Net::HTTP.new(hostname) + # http.open_timeout # => 60 + # http.read_timeout # => 1 + # http.write_timeout # => 1 + # + # source://net-http//lib/net/http.rb#1148 + def default_configuration; end + + # Allows to set the default configuration that will be used + # when creating a new connection. + # + # Example: + # + # Net::HTTP.default_configuration = { + # read_timeout: 1, + # write_timeout: 1 + # } + # http = Net::HTTP.new(hostname) + # http.open_timeout # => 60 + # http.read_timeout # => 1 + # http.write_timeout # => 1 + # + # source://net-http//lib/net/http.rb#1148 + def default_configuration=(_arg0); end + + # Returns integer +80+, the default port to use for \HTTP requests: + # + # Net::HTTP.default_port # => 80 + # + # source://net-http//lib/net/http.rb#941 + def default_port; end + + # :call-seq: + # Net::HTTP.get(hostname, path, port = 80) -> body + # Net::HTTP:get(uri, headers = {}, port = uri.port) -> body + # + # Sends a GET request and returns the \HTTP response body as a string. + # + # With string arguments +hostname+ and +path+: + # + # hostname = 'jsonplaceholder.typicode.com' + # path = '/todos/1' + # puts Net::HTTP.get(hostname, path) + # + # Output: + # + # { + # "userId": 1, + # "id": 1, + # "title": "delectus aut autem", + # "completed": false + # } + # + # With URI object +uri+ and optional hash argument +headers+: + # + # uri = URI('https://jsonplaceholder.typicode.com/todos/1') + # headers = {'Content-type' => 'application/json; charset=UTF-8'} + # Net::HTTP.get(uri, headers) + # + # Related: + # + # - Net::HTTP::Get: request class for \HTTP method +GET+. + # - Net::HTTP#get: convenience method for \HTTP method +GET+. + # + # source://net-http//lib/net/http.rb#810 + def get(uri_or_host, path_or_headers = T.unsafe(nil), port = T.unsafe(nil)); end + + # :call-seq: + # Net::HTTP.get_print(hostname, path, port = 80) -> nil + # Net::HTTP:get_print(uri, headers = {}, port = uri.port) -> nil + # + # Like Net::HTTP.get, but writes the returned body to $stdout; + # returns +nil+. + # + # source://net-http//lib/net/http.rb#769 + def get_print(uri_or_host, path_or_headers = T.unsafe(nil), port = T.unsafe(nil)); end + + # :call-seq: + # Net::HTTP.get_response(hostname, path, port = 80) -> http_response + # Net::HTTP:get_response(uri, headers = {}, port = uri.port) -> http_response + # + # Like Net::HTTP.get, but returns a Net::HTTPResponse object + # instead of the body string. + # + # source://net-http//lib/net/http.rb#820 + def get_response(uri_or_host, path_or_headers = T.unsafe(nil), port = T.unsafe(nil), &block); end + + # Returns integer +80+, the default port to use for \HTTP requests: + # + # Net::HTTP.http_default_port # => 80 + # + # source://net-http//lib/net/http.rb#949 + def http_default_port; end + + # Returns integer +443+, the default port to use for HTTPS requests: + # + # Net::HTTP.https_default_port # => 443 + # + # source://net-http//lib/net/http.rb#957 + def https_default_port; end + + # Returns +false+; retained for compatibility. + # + # @return [Boolean] + # + # source://net-http//lib/net/http.rb#754 + def is_version_1_1?; end + + # Returns +true+; retained for compatibility. + # + # @return [Boolean] + # + # source://net-http//lib/net/http.rb#749 + def is_version_1_2?; end + + # Returns a new \Net::HTTP object +http+ + # (but does not open a TCP connection or \HTTP session). + # + # With only string argument +address+ given + # (and ENV['http_proxy'] undefined or +nil+), + # the returned +http+: + # + # - Has the given address. + # - Has the default port number, Net::HTTP.default_port (80). + # - Has no proxy. + # + # Example: + # + # http = Net::HTTP.new(hostname) + # # => # + # http.address # => "jsonplaceholder.typicode.com" + # http.port # => 80 + # http.proxy? # => false + # + # With integer argument +port+ also given, + # the returned +http+ has the given port: + # + # http = Net::HTTP.new(hostname, 8000) + # # => # + # http.port # => 8000 + # + # For proxy-defining arguments +p_addr+ through +p_no_proxy+, + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # + # source://net-http//lib/net/http.rb#1106 + def new(address, port = T.unsafe(nil), p_addr = T.unsafe(nil), p_port = T.unsafe(nil), p_user = T.unsafe(nil), p_pass = T.unsafe(nil), p_no_proxy = T.unsafe(nil), p_use_ssl = T.unsafe(nil)); end + + # Posts data to a host; returns a Net::HTTPResponse object. + # + # Argument +url+ must be a URL; + # argument +data+ must be a string: + # + # _uri = uri.dup + # _uri.path = '/posts' + # data = '{"title": "foo", "body": "bar", "userId": 1}' + # headers = {'content-type': 'application/json'} + # res = Net::HTTP.post(_uri, data, headers) # => # + # puts res.body + # + # Output: + # + # { + # "title": "foo", + # "body": "bar", + # "userId": 1, + # "id": 101 + # } + # + # Related: + # + # - Net::HTTP::Post: request class for \HTTP method +POST+. + # - Net::HTTP#post: convenience method for \HTTP method +POST+. + # + # source://net-http//lib/net/http.rb#863 + def post(url, data, header = T.unsafe(nil)); end + + # Posts data to a host; returns a Net::HTTPResponse object. + # + # Argument +url+ must be a URI; + # argument +data+ must be a hash: + # + # _uri = uri.dup + # _uri.path = '/posts' + # data = {title: 'foo', body: 'bar', userId: 1} + # res = Net::HTTP.post_form(_uri, data) # => # + # puts res.body + # + # Output: + # + # { + # "title": "foo", + # "body": "bar", + # "userId": "1", + # "id": 101 + # } + # + # source://net-http//lib/net/http.rb#890 + def post_form(url, params); end + + # Returns the address of the proxy host, or +nil+ if none; + # see Net::HTTP@Proxy+Server. + # + # source://net-http//lib/net/http.rb#1838 + def proxy_address; end + + # Returns true if self is a class which was created by HTTP::Proxy. + # + # @return [Boolean] + # + # source://net-http//lib/net/http.rb#1832 + def proxy_class?; end + + # Returns the password for accessing the proxy, or +nil+ if none; + # see Net::HTTP@Proxy+Server. + # + # source://net-http//lib/net/http.rb#1850 + def proxy_pass; end + + # Returns the port number of the proxy host, or +nil+ if none; + # see Net::HTTP@Proxy+Server. + # + # source://net-http//lib/net/http.rb#1842 + def proxy_port; end + + # Use SSL when talking to the proxy. If Net::HTTP does not use a proxy, nil. + # + # source://net-http//lib/net/http.rb#1853 + def proxy_use_ssl; end + + # Returns the user name for accessing the proxy, or +nil+ if none; + # see Net::HTTP@Proxy+Server. + # + # source://net-http//lib/net/http.rb#1846 + def proxy_user; end + + # Sends a PUT request to the server; returns a Net::HTTPResponse object. + # + # Argument +url+ must be a URL; + # argument +data+ must be a string: + # + # _uri = uri.dup + # _uri.path = '/posts' + # data = '{"title": "foo", "body": "bar", "userId": 1}' + # headers = {'content-type': 'application/json'} + # res = Net::HTTP.put(_uri, data, headers) # => # + # puts res.body + # + # Output: + # + # { + # "title": "foo", + # "body": "bar", + # "userId": 1, + # "id": 101 + # } + # + # Related: + # + # - Net::HTTP::Put: request class for \HTTP method +PUT+. + # - Net::HTTP#put: convenience method for \HTTP method +PUT+. + # + # source://net-http//lib/net/http.rb#926 + def put(url, data, header = T.unsafe(nil)); end + + # source://net-http//lib/net/http.rb#961 + def socket_type; end + + # :call-seq: + # HTTP.start(address, port = nil, p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil, opts) -> http + # HTTP.start(address, port = nil, p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil, opts) {|http| ... } -> object + # + # Creates a new \Net::HTTP object, +http+, via \Net::HTTP.new: + # + # - For arguments +address+ and +port+, see Net::HTTP.new. + # - For proxy-defining arguments +p_addr+ through +p_pass+, + # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server]. + # - For argument +opts+, see below. + # + # With no block given: + # + # - Calls http.start with no block (see #start), + # which opens a TCP connection and \HTTP session. + # - Returns +http+. + # - The caller should call #finish to close the session: + # + # http = Net::HTTP.start(hostname) + # http.started? # => true + # http.finish + # http.started? # => false + # + # With a block given: + # + # - Calls http.start with the block (see #start), which: + # + # - Opens a TCP connection and \HTTP session. + # - Calls the block, + # which may make any number of requests to the host. + # - Closes the \HTTP session and TCP connection on block exit. + # - Returns the block's value +object+. + # + # - Returns +object+. + # + # Example: + # + # hostname = 'jsonplaceholder.typicode.com' + # Net::HTTP.start(hostname) do |http| + # puts http.get('/todos/1').body + # puts http.get('/todos/2').body + # end + # + # Output: + # + # { + # "userId": 1, + # "id": 1, + # "title": "delectus aut autem", + # "completed": false + # } + # { + # "userId": 1, + # "id": 2, + # "title": "quis ut nam facilis et officia qui", + # "completed": false + # } + # + # If the last argument given is a hash, it is the +opts+ hash, + # where each key is a method or accessor to be called, + # and its value is the value to be set. + # + # The keys may include: + # + # - #ca_file + # - #ca_path + # - #cert + # - #cert_store + # - #ciphers + # - #close_on_empty_response + # - +ipaddr+ (calls #ipaddr=) + # - #keep_alive_timeout + # - #key + # - #open_timeout + # - #read_timeout + # - #ssl_timeout + # - #ssl_version + # - +use_ssl+ (calls #use_ssl=) + # - #verify_callback + # - #verify_depth + # - #verify_mode + # - #write_timeout + # + # Note: If +port+ is +nil+ and opts[:use_ssl] is a truthy value, + # the value passed to +new+ is Net::HTTP.https_default_port, not +port+. + # + # source://net-http//lib/net/http.rb#1051 + def start(address, *arg, &block); end + + # Returns +false+; retained for compatibility. + # + # @return [Boolean] + # + # source://net-http//lib/net/http.rb#754 + def version_1_1?; end + + # Returns +true+; retained for compatibility. + # + # source://net-http//lib/net/http.rb#744 + def version_1_2; end + + # Returns +true+; retained for compatibility. + # + # @return [Boolean] + # + # source://net-http//lib/net/http.rb#749 + def version_1_2?; end + end +end + +# source://net-http//lib/net/http/proxy_delta.rb#2 +module Net::HTTP::ProxyDelta + private + + # source://net-http//lib/net/http/proxy_delta.rb#5 + def conn_address; end + + # source://net-http//lib/net/http/proxy_delta.rb#9 + def conn_port; end + + # source://net-http//lib/net/http/proxy_delta.rb#13 + def edit_path(path); end +end + +# :stopdoc: +# +# source://net-http//lib/net/http.rb#733 +Net::HTTP::VERSION = T.let(T.unsafe(nil), String) + +# Response class for Already Reported (WebDAV) responses (status code 208). +# +# The Already Reported (WebDAV) response indicates that the server +# has received the request, +# and that the members of a DAV binding have already been enumerated +# in a preceding part of the (multi-status) response, +# and are not being included again. +# +# :include: doc/net-http/included_getters.rdoc +# +# References: +# +# - {RFC 5842}[https://www.rfc-editor.org/rfc/rfc5842.html#section-7.1]. +# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#208]. +# +# source://net-http//lib/net/http/responses.rb#306 +class Net::HTTPAlreadyReported < ::Net::HTTPSuccess; end + +# source://net-http//lib/net/http/responses.rb#307 +Net::HTTPAlreadyReported::HAS_BODY = T.let(T.unsafe(nil), TrueClass) + +# source://net-http//lib/net/http/responses.rb#67 +Net::HTTPClientError::EXCEPTION_TYPE = Net::HTTPClientException + +# Response class for Early Hints responses (status code 103). +# +# The Early Hints indicates that the server has received +# and is processing the request, and contains certain headers; +# the final response is not available yet. +# +# :include: doc/net-http/included_getters.rdoc +# +# References: +# +# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103]. +# - {RFC 8297}[https://www.rfc-editor.org/rfc/rfc8297.html#section-2]. +# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#103]. +# +# source://net-http//lib/net/http/responses.rb#147 +class Net::HTTPEarlyHints < ::Net::HTTPInformation; end + +# source://net-http//lib/net/http/responses.rb#148 +Net::HTTPEarlyHints::HAS_BODY = T.let(T.unsafe(nil), FalseClass) + +# \HTTPGenericRequest is the parent of the Net::HTTPRequest class. +# +# Do not use this directly; instead, use a subclass of Net::HTTPRequest. +# +# == About the Examples +# +# :include: doc/net-http/examples.rdoc +# +# source://net-http//lib/net/http/generic_request.rb#11 +class Net::HTTPGenericRequest + include ::Net::HTTPHeader + + # @return [HTTPGenericRequest] a new instance of HTTPGenericRequest + # + # source://net-http//lib/net/http/generic_request.rb#15 + def initialize(m, reqbody, resbody, uri_or_path, initheader = T.unsafe(nil)); end + + # Don't automatically decode response content-encoding if the user indicates + # they want to handle it. + # + # source://net-http//lib/net/http/generic_request.rb#109 + def []=(key, val); end + + # Returns the string body for the request, or +nil+ if there is none: + # + # req = Net::HTTP::Post.new(uri) + # req.body # => nil + # req.body = '{"title": "foo","body": "bar","userId": 1}' + # req.body # => "{\"title\": \"foo\",\"body\": \"bar\",\"userId\": 1}" + # + # source://net-http//lib/net/http/generic_request.rb#145 + def body; end + + # Sets the body for the request: + # + # req = Net::HTTP::Post.new(uri) + # req.body # => nil + # req.body = '{"title": "foo","body": "bar","userId": 1}' + # req.body # => "{\"title\": \"foo\",\"body\": \"bar\",\"userId\": 1}" + # + # source://net-http//lib/net/http/generic_request.rb#154 + def body=(str); end + + # @return [Boolean] + # + # source://net-http//lib/net/http/generic_request.rb#133 + def body_exist?; end + + # Returns the body stream object for the request, or +nil+ if there is none: + # + # req = Net::HTTP::Post.new(uri) # => # + # req.body_stream # => nil + # require 'stringio' + # req.body_stream = StringIO.new('xyzzy') # => # + # req.body_stream # => # + # + # source://net-http//lib/net/http/generic_request.rb#169 + def body_stream; end + + # Sets the body stream for the request: + # + # req = Net::HTTP::Post.new(uri) # => # + # req.body_stream # => nil + # require 'stringio' + # req.body_stream = StringIO.new('xyzzy') # => # + # req.body_stream # => # + # + # source://net-http//lib/net/http/generic_request.rb#179 + def body_stream=(input); end + + # Returns +false+ if the request's header 'Accept-Encoding' + # has been set manually or deleted + # (indicating that the user intends to handle encoding in the response), + # +true+ otherwise: + # + # req = Net::HTTP::Get.new(uri) # => # + # req['Accept-Encoding'] # => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" + # req.decode_content # => true + # req['Accept-Encoding'] = 'foo' + # req.decode_content # => false + # req.delete('Accept-Encoding') + # req.decode_content # => false + # + # source://net-http//lib/net/http/generic_request.rb#95 + def decode_content; end + + # write + # + # source://net-http//lib/net/http/generic_request.rb#198 + def exec(sock, ver, path); end + + # Returns a string representation of the request: + # + # Net::HTTP::Post.new(uri).inspect # => "#" + # + # source://net-http//lib/net/http/generic_request.rb#101 + def inspect; end + + # Returns the string method name for the request: + # + # Net::HTTP::Get.new(uri).method # => "GET" + # Net::HTTP::Post.new(uri).method # => "POST" + # + # source://net-http//lib/net/http/generic_request.rb#65 + def method; end + + # Returns the string path for the request: + # + # Net::HTTP::Get.new(uri).path # => "/" + # Net::HTTP::Post.new('example.com').path # => "example.com" + # + # source://net-http//lib/net/http/generic_request.rb#72 + def path; end + + # Returns whether the request may have a body: + # + # Net::HTTP::Post.new(uri).request_body_permitted? # => true + # Net::HTTP::Get.new(uri).request_body_permitted? # => false + # + # @return [Boolean] + # + # source://net-http//lib/net/http/generic_request.rb#120 + def request_body_permitted?; end + + # Returns whether the response may have a body: + # + # Net::HTTP::Post.new(uri).response_body_permitted? # => true + # Net::HTTP::Head.new(uri).response_body_permitted? # => false + # + # @return [Boolean] + # + # source://net-http//lib/net/http/generic_request.rb#129 + def response_body_permitted?; end + + # @raise [ArgumentError] + # + # source://net-http//lib/net/http/generic_request.rb#186 + def set_body_internal(str); end + + # source://net-http//lib/net/http/generic_request.rb#210 + def update_uri(addr, port, ssl); end + + # Returns the URI object for the request, or +nil+ if none: + # + # Net::HTTP::Get.new(uri).uri + # # => # + # Net::HTTP::Get.new('example.com').uri # => nil + # + # source://net-http//lib/net/http/generic_request.rb#80 + def uri; end + + private + + # source://net-http//lib/net/http/generic_request.rb#312 + def encode_multipart_form_data(out, params, opt); end + + # source://net-http//lib/net/http/generic_request.rb#368 + def flush_buffer(out, buf, chunked_p); end + + # source://net-http//lib/net/http/generic_request.rb#363 + def quote_string(str, charset); end + + # source://net-http//lib/net/http/generic_request.rb#260 + def send_request_with_body(sock, ver, path, body); end + + # source://net-http//lib/net/http/generic_request.rb#286 + def send_request_with_body_data(sock, ver, path, params); end + + # source://net-http//lib/net/http/generic_request.rb#269 + def send_request_with_body_stream(sock, ver, path, f); end + + # source://net-http//lib/net/http/generic_request.rb#376 + def supply_default_content_type; end + + # Waits up to the continue timeout for a response from the server provided + # we're speaking HTTP 1.1 and are expecting a 100-continue response. + # + # source://net-http//lib/net/http/generic_request.rb#386 + def wait_for_continue(sock, ver); end + + # source://net-http//lib/net/http/generic_request.rb#399 + def write_header(sock, ver, path); end +end + +# source://net-http//lib/net/http/generic_request.rb#242 +class Net::HTTPGenericRequest::Chunker + # @return [Chunker] a new instance of Chunker + # + # source://net-http//lib/net/http/generic_request.rb#243 + def initialize(sock); end + + # source://net-http//lib/net/http/generic_request.rb#255 + def finish; end + + # source://net-http//lib/net/http/generic_request.rb#248 + def write(buf); end +end + +# The \HTTPHeader module provides access to \HTTP headers. +# +# The module is included in: +# +# - Net::HTTPGenericRequest (and therefore Net::HTTPRequest). +# - Net::HTTPResponse. +# +# The headers are a hash-like collection of key/value pairs called _fields_. +# +# == Request and Response Fields +# +# Headers may be included in: +# +# - A Net::HTTPRequest object: +# the object's headers will be sent with the request. +# Any fields may be defined in the request; +# see {Setters}[rdoc-ref:Net::HTTPHeader@Setters]. +# - A Net::HTTPResponse object: +# the objects headers are usually those returned from the host. +# Fields may be retrieved from the object; +# see {Getters}[rdoc-ref:Net::HTTPHeader@Getters] +# and {Iterators}[rdoc-ref:Net::HTTPHeader@Iterators]. +# +# Exactly which fields should be sent or expected depends on the host; +# see: +# +# - {Request fields}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields]. +# - {Response fields}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields]. +# +# == About the Examples +# +# :include: doc/net-http/examples.rdoc +# +# == Fields +# +# A header field is a key/value pair. +# +# === Field Keys +# +# A field key may be: +# +# - A string: Key 'Accept' is treated as if it were +# 'Accept'.downcase; i.e., 'accept'. +# - A symbol: Key :Accept is treated as if it were +# :Accept.to_s.downcase; i.e., 'accept'. +# +# Examples: +# +# req = Net::HTTP::Get.new(uri) +# req[:accept] # => "*/*" +# req['Accept'] # => "*/*" +# req['ACCEPT'] # => "*/*" +# +# req['accept'] = 'text/html' +# req[:accept] = 'text/html' +# req['ACCEPT'] = 'text/html' +# +# === Field Values +# +# A field value may be returned as an array of strings or as a string: +# +# - These methods return field values as arrays: +# +# - #get_fields: Returns the array value for the given key, +# or +nil+ if it does not exist. +# - #to_hash: Returns a hash of all header fields: +# each key is a field name; its value is the array value for the field. +# +# - These methods return field values as string; +# the string value for a field is equivalent to +# self[key.downcase.to_s].join(', ')): +# +# - #[]: Returns the string value for the given key, +# or +nil+ if it does not exist. +# - #fetch: Like #[], but accepts a default value +# to be returned if the key does not exist. +# +# The field value may be set: +# +# - #[]=: Sets the value for the given key; +# the given value may be a string, a symbol, an array, or a hash. +# - #add_field: Adds a given value to a value for the given key +# (not overwriting the existing value). +# - #delete: Deletes the field for the given key. +# +# Example field values: +# +# - \String: +# +# req['Accept'] = 'text/html' # => "text/html" +# req['Accept'] # => "text/html" +# req.get_fields('Accept') # => ["text/html"] +# +# - \Symbol: +# +# req['Accept'] = :text # => :text +# req['Accept'] # => "text" +# req.get_fields('Accept') # => ["text"] +# +# - Simple array: +# +# req[:foo] = %w[bar baz bat] +# req[:foo] # => "bar, baz, bat" +# req.get_fields(:foo) # => ["bar", "baz", "bat"] +# +# - Simple hash: +# +# req[:foo] = {bar: 0, baz: 1, bat: 2} +# req[:foo] # => "bar, 0, baz, 1, bat, 2" +# req.get_fields(:foo) # => ["bar", "0", "baz", "1", "bat", "2"] +# +# - Nested: +# +# req[:foo] = [%w[bar baz], {bat: 0, bam: 1}] +# req[:foo] # => "bar, baz, bat, 0, bam, 1" +# req.get_fields(:foo) # => ["bar", "baz", "bat", "0", "bam", "1"] +# +# req[:foo] = {bar: %w[baz bat], bam: {bah: 0, bad: 1}} +# req[:foo] # => "bar, baz, bat, bam, bah, 0, bad, 1" +# req.get_fields(:foo) # => ["bar", "baz", "bat", "bam", "bah", "0", "bad", "1"] +# +# == Convenience Methods +# +# Various convenience methods retrieve values, set values, query values, +# set form values, or iterate over fields. +# +# === Setters +# +# \Method #[]= can set any field, but does little to validate the new value; +# some of the other setter methods provide some validation: +# +# - #[]=: Sets the string or array value for the given key. +# - #add_field: Creates or adds to the array value for the given key. +# - #basic_auth: Sets the string authorization header for 'Authorization'. +# - #content_length=: Sets the integer length for field 'Content-Length. +# - #content_type=: Sets the string value for field 'Content-Type'. +# - #proxy_basic_auth: Sets the string authorization header for 'Proxy-Authorization'. +# - #set_range: Sets the value for field 'Range'. +# +# === Form Setters +# +# - #set_form: Sets an HTML form data set. +# - #set_form_data: Sets header fields and a body from HTML form data. +# +# === Getters +# +# \Method #[] can retrieve the value of any field that exists, +# but always as a string; +# some of the other getter methods return something different +# from the simple string value: +# +# - #[]: Returns the string field value for the given key. +# - #content_length: Returns the integer value of field 'Content-Length'. +# - #content_range: Returns the Range value of field 'Content-Range'. +# - #content_type: Returns the string value of field 'Content-Type'. +# - #fetch: Returns the string field value for the given key. +# - #get_fields: Returns the array field value for the given +key+. +# - #main_type: Returns first part of the string value of field 'Content-Type'. +# - #sub_type: Returns second part of the string value of field 'Content-Type'. +# - #range: Returns an array of Range objects of field 'Range', or +nil+. +# - #range_length: Returns the integer length of the range given in field 'Content-Range'. +# - #type_params: Returns the string parameters for 'Content-Type'. +# +# === Queries +# +# - #chunked?: Returns whether field 'Transfer-Encoding' is set to 'chunked'. +# - #connection_close?: Returns whether field 'Connection' is set to 'close'. +# - #connection_keep_alive?: Returns whether field 'Connection' is set to 'keep-alive'. +# - #key?: Returns whether a given key exists. +# +# === Iterators +# +# - #each_capitalized: Passes each field capitalized-name/value pair to the block. +# - #each_capitalized_name: Passes each capitalized field name to the block. +# - #each_header: Passes each field name/value pair to the block. +# - #each_name: Passes each field name to the block. +# - #each_value: Passes each string field value to the block. +# +# source://net-http//lib/net/http/header.rb#181 +module Net::HTTPHeader + # Returns the string field value for the case-insensitive field +key+, + # or +nil+ if there is no such key; + # see {Fields}[rdoc-ref:Net::HTTPHeader@Fields]: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res['Connection'] # => "keep-alive" + # res['Nosuch'] # => nil + # + # Note that some field values may be retrieved via convenience methods; + # see {Getters}[rdoc-ref:Net::HTTPHeader@Getters]. + # + # source://net-http//lib/net/http/header.rb#224 + def [](key); end + + # Sets the value for the case-insensitive +key+ to +val+, + # overwriting the previous value if the field exists; + # see {Fields}[rdoc-ref:Net::HTTPHeader@Fields]: + # + # req = Net::HTTP::Get.new(uri) + # req['Accept'] # => "*/*" + # req['Accept'] = 'text/html' + # req['Accept'] # => "text/html" + # + # Note that some field values may be set via convenience methods; + # see {Setters}[rdoc-ref:Net::HTTPHeader@Setters]. + # + # source://net-http//lib/net/http/header.rb#240 + def []=(key, val); end + + # Adds value +val+ to the value array for field +key+ if the field exists; + # creates the field with the given +key+ and +val+ if it does not exist. + # see {Fields}[rdoc-ref:Net::HTTPHeader@Fields]: + # + # req = Net::HTTP::Get.new(uri) + # req.add_field('Foo', 'bar') + # req['Foo'] # => "bar" + # req.add_field('Foo', 'baz') + # req['Foo'] # => "bar, baz" + # req.add_field('Foo', %w[baz bam]) + # req['Foo'] # => "bar, baz, baz, bam" + # req.get_fields('Foo') # => ["bar", "baz", "baz", "bam"] + # + # source://net-http//lib/net/http/header.rb#261 + def add_field(key, val); end + + # Sets header 'Authorization' using the given + # +account+ and +password+ strings: + # + # req.basic_auth('my_account', 'my_password') + # req['Authorization'] + # # => "Basic bXlfYWNjb3VudDpteV9wYXNzd29yZA==" + # + # source://net-http//lib/net/http/header.rb#945 + def basic_auth(account, password); end + + # Like #each_header, but the keys are returned in capitalized form. + # + # Net::HTTPHeader#canonical_each is an alias for Net::HTTPHeader#each_capitalized. + # + # source://net-http//lib/net/http/header.rb#484 + def canonical_each; end + + # Returns +true+ if field 'Transfer-Encoding' + # exists and has value 'chunked', + # +false+ otherwise; + # see {Transfer-Encoding response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#transfer-encoding-response-header]: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res['Transfer-Encoding'] # => "chunked" + # res.chunked? # => true + # + # @return [Boolean] + # + # source://net-http//lib/net/http/header.rb#654 + def chunked?; end + + # Returns whether the HTTP session is to be closed. + # + # @return [Boolean] + # + # source://net-http//lib/net/http/header.rb#966 + def connection_close?; end + + # Returns whether the HTTP session is to be kept alive. + # + # @return [Boolean] + # + # source://net-http//lib/net/http/header.rb#974 + def connection_keep_alive?; end + + # Returns the value of field 'Content-Length' as an integer, + # or +nil+ if there is no such field; + # see {Content-Length request header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-length-request-header]: + # + # res = Net::HTTP.get_response(hostname, '/nosuch/1') + # res.content_length # => 2 + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res.content_length # => nil + # + # source://net-http//lib/net/http/header.rb#616 + def content_length; end + + # Sets the value of field 'Content-Length' to the given numeric; + # see {Content-Length response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-length-response-header]: + # + # _uri = uri.dup + # hostname = _uri.hostname # => "jsonplaceholder.typicode.com" + # _uri.path = '/posts' # => "/posts" + # req = Net::HTTP::Post.new(_uri) # => # + # req.body = '{"title": "foo","body": "bar","userId": 1}' + # req.content_length = req.body.size # => 42 + # req.content_type = 'application/json' + # res = Net::HTTP.start(hostname) do |http| + # http.request(req) + # end # => # + # + # source://net-http//lib/net/http/header.rb#637 + def content_length=(len); end + + # Returns a Range object representing the value of field + # 'Content-Range', or +nil+ if no such field exists; + # see {Content-Range response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-range-response-header]: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res['Content-Range'] # => nil + # res['Content-Range'] = 'bytes 0-499/1000' + # res['Content-Range'] # => "bytes 0-499/1000" + # res.content_range # => 0..499 + # + # source://net-http//lib/net/http/header.rb#670 + def content_range; end + + # Returns the {media type}[https://en.wikipedia.org/wiki/Media_type] + # from the value of field 'Content-Type', + # or +nil+ if no such field exists; + # see {Content-Type response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-response-header]: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res['content-type'] # => "application/json; charset=utf-8" + # res.content_type # => "application/json" + # + # source://net-http//lib/net/http/header.rb#701 + def content_type; end + + # Sets the value of field 'Content-Type'; + # returns the new value; + # see {Content-Type request header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-request-header]: + # + # req = Net::HTTP::Get.new(uri) + # req.set_content_type('application/json') # => ["application/json"] + # + # Net::HTTPHeader#content_type= is an alias for Net::HTTPHeader#set_content_type. + # + # source://net-http//lib/net/http/header.rb#772 + def content_type=(type, params = T.unsafe(nil)); end + + # Removes the header for the given case-insensitive +key+ + # (see {Fields}[rdoc-ref:Net::HTTPHeader@Fields]); + # returns the deleted value, or +nil+ if no such field exists: + # + # req = Net::HTTP::Get.new(uri) + # req.delete('Accept') # => ["*/*"] + # req.delete('Nosuch') # => nil + # + # source://net-http//lib/net/http/header.rb#453 + def delete(key); end + + # Calls the block with each key/value pair: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res.each_header do |key, value| + # p [key, value] if key.start_with?('c') + # end + # + # Output: + # + # ["content-type", "application/json; charset=utf-8"] + # ["connection", "keep-alive"] + # ["cache-control", "max-age=43200"] + # ["cf-cache-status", "HIT"] + # ["cf-ray", "771d17e9bc542cf5-ORD"] + # + # Returns an enumerator if no block is given. + # + # Net::HTTPHeader#each is an alias for Net::HTTPHeader#each_header. + # + # source://net-http//lib/net/http/header.rb#364 + def each; end + + # Like #each_header, but the keys are returned in capitalized form. + # + # Net::HTTPHeader#canonical_each is an alias for Net::HTTPHeader#each_capitalized. + # + # source://net-http//lib/net/http/header.rb#484 + def each_capitalized; end + + # Calls the block with each capitalized field name: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res.each_capitalized_name do |key| + # p key if key.start_with?('C') + # end + # + # Output: + # + # "Content-Type" + # "Connection" + # "Cache-Control" + # "Cf-Cache-Status" + # "Cf-Ray" + # + # The capitalization is system-dependent; + # see {Case Mapping}[https://docs.ruby-lang.org/en/master/case_mapping_rdoc.html]. + # + # Returns an enumerator if no block is given. + # + # source://net-http//lib/net/http/header.rb#417 + def each_capitalized_name; end + + # Calls the block with each key/value pair: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res.each_header do |key, value| + # p [key, value] if key.start_with?('c') + # end + # + # Output: + # + # ["content-type", "application/json; charset=utf-8"] + # ["connection", "keep-alive"] + # ["cache-control", "max-age=43200"] + # ["cf-cache-status", "HIT"] + # ["cf-ray", "771d17e9bc542cf5-ORD"] + # + # Returns an enumerator if no block is given. + # + # Net::HTTPHeader#each is an alias for Net::HTTPHeader#each_header. + # + # source://net-http//lib/net/http/header.rb#364 + def each_header; end + + # Calls the block with each field key: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res.each_key do |key| + # p key if key.start_with?('c') + # end + # + # Output: + # + # "content-type" + # "connection" + # "cache-control" + # "cf-cache-status" + # "cf-ray" + # + # Returns an enumerator if no block is given. + # + # Net::HTTPHeader#each_name is an alias for Net::HTTPHeader#each_key. + # + # source://net-http//lib/net/http/header.rb#391 + def each_key(&block); end + + # Calls the block with each field key: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res.each_key do |key| + # p key if key.start_with?('c') + # end + # + # Output: + # + # "content-type" + # "connection" + # "cache-control" + # "cf-cache-status" + # "cf-ray" + # + # Returns an enumerator if no block is given. + # + # Net::HTTPHeader#each_name is an alias for Net::HTTPHeader#each_key. + # + # source://net-http//lib/net/http/header.rb#391 + def each_name(&block); end + + # Calls the block with each string field value: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res.each_value do |value| + # p value if value.start_with?('c') + # end + # + # Output: + # + # "chunked" + # "cf-q-config;dur=6.0000002122251e-06" + # "cloudflare" + # + # Returns an enumerator if no block is given. + # + # source://net-http//lib/net/http/header.rb#438 + def each_value; end + + # call-seq: + # fetch(key, default_val = nil) {|key| ... } -> object + # fetch(key, default_val = nil) -> value or default_val + # + # With a block, returns the string value for +key+ if it exists; + # otherwise returns the value of the block; + # ignores the +default_val+; + # see {Fields}[rdoc-ref:Net::HTTPHeader@Fields]: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # + # # Field exists; block not called. + # res.fetch('Connection') do |value| + # fail 'Cannot happen' + # end # => "keep-alive" + # + # # Field does not exist; block called. + # res.fetch('Nosuch') do |value| + # value.downcase + # end # => "nosuch" + # + # With no block, returns the string value for +key+ if it exists; + # otherwise, returns +default_val+ if it was given; + # otherwise raises an exception: + # + # res.fetch('Connection', 'Foo') # => "keep-alive" + # res.fetch('Nosuch', 'Foo') # => "Foo" + # res.fetch('Nosuch') # Raises KeyError. + # + # source://net-http//lib/net/http/header.rb#341 + def fetch(key, *args, &block); end + + # Sets the request body to a URL-encoded string derived from argument +params+, + # and sets request header field 'Content-Type' + # to 'application/x-www-form-urlencoded'. + # + # The resulting request is suitable for HTTP request +POST+ or +PUT+. + # + # Argument +params+ must be suitable for use as argument +enum+ to + # {URI.encode_www_form}[https://docs.ruby-lang.org/en/master/URI.html#method-c-encode_www_form]. + # + # With only argument +params+ given, + # sets the body to a URL-encoded string with the default separator '&': + # + # req = Net::HTTP::Post.new('example.com') + # + # req.set_form_data(q: 'ruby', lang: 'en') + # req.body # => "q=ruby&lang=en" + # req['Content-Type'] # => "application/x-www-form-urlencoded" + # + # req.set_form_data([['q', 'ruby'], ['lang', 'en']]) + # req.body # => "q=ruby&lang=en" + # + # req.set_form_data(q: ['ruby', 'perl'], lang: 'en') + # req.body # => "q=ruby&q=perl&lang=en" + # + # req.set_form_data([['q', 'ruby'], ['q', 'perl'], ['lang', 'en']]) + # req.body # => "q=ruby&q=perl&lang=en" + # + # With string argument +sep+ also given, + # uses that string as the separator: + # + # req.set_form_data({q: 'ruby', lang: 'en'}, '|') + # req.body # => "q=ruby|lang=en" + # + # Net::HTTPHeader#form_data= is an alias for Net::HTTPHeader#set_form_data. + # + # source://net-http//lib/net/http/header.rb#812 + def form_data=(params, sep = T.unsafe(nil)); end + + # Returns the array field value for the given +key+, + # or +nil+ if there is no such field; + # see {Fields}[rdoc-ref:Net::HTTPHeader@Fields]: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res.get_fields('Connection') # => ["keep-alive"] + # res.get_fields('Nosuch') # => nil + # + # source://net-http//lib/net/http/header.rb#306 + def get_fields(key); end + + # source://net-http//lib/net/http/header.rb#185 + def initialize_http_header(initheader); end + + # Returns +true+ if the field for the case-insensitive +key+ exists, +false+ otherwise: + # + # req = Net::HTTP::Get.new(uri) + # req.key?('Accept') # => true + # req.key?('Nosuch') # => false + # + # @return [Boolean] + # + # source://net-http//lib/net/http/header.rb#463 + def key?(key); end + + # source://net-http//lib/net/http/header.rb#208 + def length; end + + # Returns the leading ('type') part of the + # {media type}[https://en.wikipedia.org/wiki/Media_type] + # from the value of field 'Content-Type', + # or +nil+ if no such field exists; + # see {Content-Type response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-response-header]: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res['content-type'] # => "application/json; charset=utf-8" + # res.main_type # => "application" + # + # source://net-http//lib/net/http/header.rb#723 + def main_type; end + + # Sets header 'Proxy-Authorization' using the given + # +account+ and +password+ strings: + # + # req.proxy_basic_auth('my_account', 'my_password') + # req['Proxy-Authorization'] + # # => "Basic bXlfYWNjb3VudDpteV9wYXNzd29yZA==" + # + # source://net-http//lib/net/http/header.rb#956 + def proxy_basic_auth(account, password); end + + # Returns an array of Range objects that represent + # the value of field 'Range', + # or +nil+ if there is no such field; + # see {Range request header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#range-request-header]: + # + # req = Net::HTTP::Get.new(uri) + # req['Range'] = 'bytes=0-99,200-299,400-499' + # req.range # => [0..99, 200..299, 400..499] + # req.delete('Range') + # req.range # # => nil + # + # source://net-http//lib/net/http/header.rb#509 + def range; end + + # call-seq: + # set_range(length) -> length + # set_range(offset, length) -> range + # set_range(begin..length) -> range + # + # Sets the value for field 'Range'; + # see {Range request header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#range-request-header]: + # + # With argument +length+: + # + # req = Net::HTTP::Get.new(uri) + # req.set_range(100) # => 100 + # req['Range'] # => "bytes=0-99" + # + # With arguments +offset+ and +length+: + # + # req.set_range(100, 100) # => 100...200 + # req['Range'] # => "bytes=100-199" + # + # With argument +range+: + # + # req.set_range(100..199) # => 100..199 + # req['Range'] # => "bytes=100-199" + # + # Net::HTTPHeader#range= is an alias for Net::HTTPHeader#set_range. + # + # source://net-http//lib/net/http/header.rb#576 + def range=(r, e = T.unsafe(nil)); end + + # Returns the integer representing length of the value of field + # 'Content-Range', or +nil+ if no such field exists; + # see {Content-Range response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-range-response-header]: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res['Content-Range'] # => nil + # res['Content-Range'] = 'bytes 0-499/1000' + # res.range_length # => 500 + # + # source://net-http//lib/net/http/header.rb#687 + def range_length; end + + # Sets the value of field 'Content-Type'; + # returns the new value; + # see {Content-Type request header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-request-header]: + # + # req = Net::HTTP::Get.new(uri) + # req.set_content_type('application/json') # => ["application/json"] + # + # Net::HTTPHeader#content_type= is an alias for Net::HTTPHeader#set_content_type. + # + # source://net-http//lib/net/http/header.rb#772 + def set_content_type(type, params = T.unsafe(nil)); end + + # Stores form data to be used in a +POST+ or +PUT+ request. + # + # The form data given in +params+ consists of zero or more fields; + # each field is: + # + # - A scalar value. + # - A name/value pair. + # - An IO stream opened for reading. + # + # Argument +params+ should be an + # {Enumerable}[https://docs.ruby-lang.org/en/master/Enumerable.html#module-Enumerable-label-Enumerable+in+Ruby+Classes] + # (method params.map will be called), + # and is often an array or hash. + # + # First, we set up a request: + # + # _uri = uri.dup + # _uri.path ='/posts' + # req = Net::HTTP::Post.new(_uri) + # + # Argument +params+ As an Array + # + # When +params+ is an array, + # each of its elements is a subarray that defines a field; + # the subarray may contain: + # + # - One string: + # + # req.set_form([['foo'], ['bar'], ['baz']]) + # + # - Two strings: + # + # req.set_form([%w[foo 0], %w[bar 1], %w[baz 2]]) + # + # - When argument +enctype+ (see below) is given as + # 'multipart/form-data': + # + # - A string name and an IO stream opened for reading: + # + # require 'stringio' + # req.set_form([['file', StringIO.new('Ruby is cool.')]]) + # + # - A string name, an IO stream opened for reading, + # and an options hash, which may contain these entries: + # + # - +:filename+: The name of the file to use. + # - +:content_type+: The content type of the uploaded file. + # + # Example: + # + # req.set_form([['file', file, {filename: "other-filename.foo"}]] + # + # The various forms may be mixed: + # + # req.set_form(['foo', %w[bar 1], ['file', file]]) + # + # Argument +params+ As a Hash + # + # When +params+ is a hash, + # each of its entries is a name/value pair that defines a field: + # + # - The name is a string. + # - The value may be: + # + # - +nil+. + # - Another string. + # - An IO stream opened for reading + # (only when argument +enctype+ -- see below -- is given as + # 'multipart/form-data'). + # + # Examples: + # + # # Nil-valued fields. + # req.set_form({'foo' => nil, 'bar' => nil, 'baz' => nil}) + # + # # String-valued fields. + # req.set_form({'foo' => 0, 'bar' => 1, 'baz' => 2}) + # + # # IO-valued field. + # require 'stringio' + # req.set_form({'file' => StringIO.new('Ruby is cool.')}) + # + # # Mixture of fields. + # req.set_form({'foo' => nil, 'bar' => 1, 'file' => file}) + # + # Optional argument +enctype+ specifies the value to be given + # to field 'Content-Type', and must be one of: + # + # - 'application/x-www-form-urlencoded' (the default). + # - 'multipart/form-data'; + # see {RFC 7578}[https://www.rfc-editor.org/rfc/rfc7578]. + # + # Optional argument +formopt+ is a hash of options + # (applicable only when argument +enctype+ + # is 'multipart/form-data') + # that may include the following entries: + # + # - +:boundary+: The value is the boundary string for the multipart message. + # If not given, the boundary is a random string. + # See {Boundary}[https://www.rfc-editor.org/rfc/rfc7578#section-4.1]. + # - +:charset+: Value is the character set for the form submission. + # Field names and values of non-file fields should be encoded with this charset. + # + # source://net-http//lib/net/http/header.rb#924 + def set_form(params, enctype = T.unsafe(nil), formopt = T.unsafe(nil)); end + + # Sets the request body to a URL-encoded string derived from argument +params+, + # and sets request header field 'Content-Type' + # to 'application/x-www-form-urlencoded'. + # + # The resulting request is suitable for HTTP request +POST+ or +PUT+. + # + # Argument +params+ must be suitable for use as argument +enum+ to + # {URI.encode_www_form}[https://docs.ruby-lang.org/en/master/URI.html#method-c-encode_www_form]. + # + # With only argument +params+ given, + # sets the body to a URL-encoded string with the default separator '&': + # + # req = Net::HTTP::Post.new('example.com') + # + # req.set_form_data(q: 'ruby', lang: 'en') + # req.body # => "q=ruby&lang=en" + # req['Content-Type'] # => "application/x-www-form-urlencoded" + # + # req.set_form_data([['q', 'ruby'], ['lang', 'en']]) + # req.body # => "q=ruby&lang=en" + # + # req.set_form_data(q: ['ruby', 'perl'], lang: 'en') + # req.body # => "q=ruby&q=perl&lang=en" + # + # req.set_form_data([['q', 'ruby'], ['q', 'perl'], ['lang', 'en']]) + # req.body # => "q=ruby&q=perl&lang=en" + # + # With string argument +sep+ also given, + # uses that string as the separator: + # + # req.set_form_data({q: 'ruby', lang: 'en'}, '|') + # req.body # => "q=ruby|lang=en" + # + # Net::HTTPHeader#form_data= is an alias for Net::HTTPHeader#set_form_data. + # + # source://net-http//lib/net/http/header.rb#812 + def set_form_data(params, sep = T.unsafe(nil)); end + + # call-seq: + # set_range(length) -> length + # set_range(offset, length) -> range + # set_range(begin..length) -> range + # + # Sets the value for field 'Range'; + # see {Range request header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#range-request-header]: + # + # With argument +length+: + # + # req = Net::HTTP::Get.new(uri) + # req.set_range(100) # => 100 + # req['Range'] # => "bytes=0-99" + # + # With arguments +offset+ and +length+: + # + # req.set_range(100, 100) # => 100...200 + # req['Range'] # => "bytes=100-199" + # + # With argument +range+: + # + # req.set_range(100..199) # => 100..199 + # req['Range'] # => "bytes=100-199" + # + # Net::HTTPHeader#range= is an alias for Net::HTTPHeader#set_range. + # + # source://net-http//lib/net/http/header.rb#576 + def set_range(r, e = T.unsafe(nil)); end + + # source://net-http//lib/net/http/header.rb#208 + def size; end + + # Returns the trailing ('subtype') part of the + # {media type}[https://en.wikipedia.org/wiki/Media_type] + # from the value of field 'Content-Type', + # or +nil+ if no such field exists; + # see {Content-Type response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-response-header]: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res['content-type'] # => "application/json; charset=utf-8" + # res.sub_type # => "json" + # + # source://net-http//lib/net/http/header.rb#738 + def sub_type; end + + # Returns a hash of the key/value pairs: + # + # req = Net::HTTP::Get.new(uri) + # req.to_hash + # # => + # {"accept-encoding"=>["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"], + # "accept"=>["*/*"], + # "user-agent"=>["Ruby"], + # "host"=>["jsonplaceholder.typicode.com"]} + # + # source://net-http//lib/net/http/header.rb#477 + def to_hash; end + + # Returns the trailing ('parameters') part of the value of field 'Content-Type', + # or +nil+ if no such field exists; + # see {Content-Type response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-response-header]: + # + # res = Net::HTTP.get_response(hostname, '/todos/1') + # res['content-type'] # => "application/json; charset=utf-8" + # res.type_params # => {"charset"=>"utf-8"} + # + # source://net-http//lib/net/http/header.rb#753 + def type_params; end + + private + + # source://net-http//lib/net/http/header.rb#285 + def append_field_value(ary, val); end + + # source://net-http//lib/net/http/header.rb#960 + def basic_encode(account, password); end + + # source://net-http//lib/net/http/header.rb#493 + def capitalize(name); end + + # source://net-http//lib/net/http/header.rb#270 + def set_field(key, val); end +end + +# source://net-http//lib/net/http/header.rb#183 +Net::HTTPHeader::MAX_FIELD_LENGTH = T.let(T.unsafe(nil), Integer) + +# source://net-http//lib/net/http/header.rb#182 +Net::HTTPHeader::MAX_KEY_LENGTH = T.let(T.unsafe(nil), Integer) + +# source://net-http//lib/net/http/responses.rb#23 +Net::HTTPInformation::EXCEPTION_TYPE = Net::HTTPError + +# Response class for Loop Detected (WebDAV) responses (status code 508). +# +# The server detected an infinite loop while processing the request. +# +# :include: doc/net-http/included_getters.rdoc +# +# References: +# +# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/508]. +# - {RFC 5942}[https://www.rfc-editor.org/rfc/rfc5842.html#section-7.2]. +# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#508]. +# +# source://net-http//lib/net/http/responses.rb#1061 +class Net::HTTPLoopDetected < ::Net::HTTPServerError; end + +# source://net-http//lib/net/http/responses.rb#1062 +Net::HTTPLoopDetected::HAS_BODY = T.let(T.unsafe(nil), TrueClass) + +# Response class for Misdirected Request responses (status code 421). +# +# The request was directed at a server that is not able to produce a response. +# +# :include: doc/net-http/included_getters.rdoc +# +# References: +# +# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-421-misdirected-request]. +# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#421]. +# +# source://net-http//lib/net/http/responses.rb#776 +class Net::HTTPMisdirectedRequest < ::Net::HTTPClientError; end + +# source://net-http//lib/net/http/responses.rb#777 +Net::HTTPMisdirectedRequest::HAS_BODY = T.let(T.unsafe(nil), TrueClass) + +# source://net-http//lib/net/http/responses.rb#378 +Net::HTTPMovedTemporarily = Net::HTTPFound + +# source://net-http//lib/net/http/responses.rb#343 +Net::HTTPMultipleChoice = Net::HTTPMultipleChoices + +# Response class for Not Extended responses (status code 510). +# +# Further extensions to the request are required for the server to fulfill it. +# +# :include: doc/net-http/included_getters.rdoc +# +# References: +# +# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/510]. +# - {RFC 2774}[https://www.rfc-editor.org/rfc/rfc2774.html#section-7]. +# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#510]. +# +# source://net-http//lib/net/http/responses.rb#1078 +class Net::HTTPNotExtended < ::Net::HTTPServerError; end + +# source://net-http//lib/net/http/responses.rb#1079 +Net::HTTPNotExtended::HAS_BODY = T.let(T.unsafe(nil), TrueClass) + +# Response class for Payload Too Large responses (status code 413). +# +# The request is larger than the server is willing or able to process. +# +# :include: doc/net-http/included_getters.rdoc +# +# References: +# +# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413]. +# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-413-content-too-large]. +# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#413]. +# +# source://net-http//lib/net/http/responses.rb#688 +class Net::HTTPPayloadTooLarge < ::Net::HTTPClientError; end + +# source://net-http//lib/net/http/responses.rb#689 +Net::HTTPPayloadTooLarge::HAS_BODY = T.let(T.unsafe(nil), TrueClass) + +# Response class for +Processing+ responses (status code 102). +# +# The +Processing+ response indicates that the server has received +# and is processing the request, but no response is available yet. +# +# :include: doc/net-http/included_getters.rdoc +# +# References: +# +# - {RFC 2518}[https://www.rfc-editor.org/rfc/rfc2518#section-10.1]. +# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#102]. +# +# source://net-http//lib/net/http/responses.rb#129 +class Net::HTTPProcessing < ::Net::HTTPInformation; end + +# source://net-http//lib/net/http/responses.rb#130 +Net::HTTPProcessing::HAS_BODY = T.let(T.unsafe(nil), FalseClass) + +# Response class for Range Not Satisfiable responses (status code 416). +# +# The request entity has a media type which the server or resource does not support. +# +# :include: doc/net-http/included_getters.rdoc +# +# References: +# +# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/416]. +# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-416-range-not-satisfiable]. +# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#416]. +# +# source://net-http//lib/net/http/responses.rb#739 +class Net::HTTPRangeNotSatisfiable < ::Net::HTTPClientError; end + +# source://net-http//lib/net/http/responses.rb#740 +Net::HTTPRangeNotSatisfiable::HAS_BODY = T.let(T.unsafe(nil), TrueClass) + +# source://net-http//lib/net/http/responses.rb#53 +Net::HTTPRedirection::EXCEPTION_TYPE = Net::HTTPRetriableError + +# source://net-http//lib/net/http/responses.rb#709 +Net::HTTPRequestURITooLarge = Net::HTTPURITooLong + +# This class is the base class for \Net::HTTP response classes. +# +# == About the Examples +# +# :include: doc/net-http/examples.rdoc +# +# == Returned Responses +# +# \Method Net::HTTP.get_response returns +# an instance of one of the subclasses of \Net::HTTPResponse: +# +# Net::HTTP.get_response(uri) +# # => # +# Net::HTTP.get_response(hostname, '/nosuch') +# # => # +# +# As does method Net::HTTP#request: +# +# req = Net::HTTP::Get.new(uri) +# Net::HTTP.start(hostname) do |http| +# http.request(req) +# end # => # +# +# \Class \Net::HTTPResponse includes module Net::HTTPHeader, +# which provides access to response header values via (among others): +# +# - \Hash-like method []. +# - Specific reader methods, such as +content_type+. +# +# Examples: +# +# res = Net::HTTP.get_response(uri) # => # +# res['Content-Type'] # => "text/html; charset=UTF-8" +# res.content_type # => "text/html" +# +# == Response Subclasses +# +# \Class \Net::HTTPResponse has a subclass for each +# {HTTP status code}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes]. +# You can look up the response class for a given code: +# +# Net::HTTPResponse::CODE_TO_OBJ['200'] # => Net::HTTPOK +# Net::HTTPResponse::CODE_TO_OBJ['400'] # => Net::HTTPBadRequest +# Net::HTTPResponse::CODE_TO_OBJ['404'] # => Net::HTTPNotFound +# +# And you can retrieve the status code for a response object: +# +# Net::HTTP.get_response(uri).code # => "200" +# Net::HTTP.get_response(hostname, '/nosuch').code # => "404" +# +# The response subclasses (indentation shows class hierarchy): +# +# - Net::HTTPUnknownResponse (for unhandled \HTTP extensions). +# +# - Net::HTTPInformation: +# +# - Net::HTTPContinue (100) +# - Net::HTTPSwitchProtocol (101) +# - Net::HTTPProcessing (102) +# - Net::HTTPEarlyHints (103) +# +# - Net::HTTPSuccess: +# +# - Net::HTTPOK (200) +# - Net::HTTPCreated (201) +# - Net::HTTPAccepted (202) +# - Net::HTTPNonAuthoritativeInformation (203) +# - Net::HTTPNoContent (204) +# - Net::HTTPResetContent (205) +# - Net::HTTPPartialContent (206) +# - Net::HTTPMultiStatus (207) +# - Net::HTTPAlreadyReported (208) +# - Net::HTTPIMUsed (226) +# +# - Net::HTTPRedirection: +# +# - Net::HTTPMultipleChoices (300) +# - Net::HTTPMovedPermanently (301) +# - Net::HTTPFound (302) +# - Net::HTTPSeeOther (303) +# - Net::HTTPNotModified (304) +# - Net::HTTPUseProxy (305) +# - Net::HTTPTemporaryRedirect (307) +# - Net::HTTPPermanentRedirect (308) +# +# - Net::HTTPClientError: +# +# - Net::HTTPBadRequest (400) +# - Net::HTTPUnauthorized (401) +# - Net::HTTPPaymentRequired (402) +# - Net::HTTPForbidden (403) +# - Net::HTTPNotFound (404) +# - Net::HTTPMethodNotAllowed (405) +# - Net::HTTPNotAcceptable (406) +# - Net::HTTPProxyAuthenticationRequired (407) +# - Net::HTTPRequestTimeOut (408) +# - Net::HTTPConflict (409) +# - Net::HTTPGone (410) +# - Net::HTTPLengthRequired (411) +# - Net::HTTPPreconditionFailed (412) +# - Net::HTTPRequestEntityTooLarge (413) +# - Net::HTTPRequestURITooLong (414) +# - Net::HTTPUnsupportedMediaType (415) +# - Net::HTTPRequestedRangeNotSatisfiable (416) +# - Net::HTTPExpectationFailed (417) +# - Net::HTTPMisdirectedRequest (421) +# - Net::HTTPUnprocessableEntity (422) +# - Net::HTTPLocked (423) +# - Net::HTTPFailedDependency (424) +# - Net::HTTPUpgradeRequired (426) +# - Net::HTTPPreconditionRequired (428) +# - Net::HTTPTooManyRequests (429) +# - Net::HTTPRequestHeaderFieldsTooLarge (431) +# - Net::HTTPUnavailableForLegalReasons (451) +# +# - Net::HTTPServerError: +# +# - Net::HTTPInternalServerError (500) +# - Net::HTTPNotImplemented (501) +# - Net::HTTPBadGateway (502) +# - Net::HTTPServiceUnavailable (503) +# - Net::HTTPGatewayTimeOut (504) +# - Net::HTTPVersionNotSupported (505) +# - Net::HTTPVariantAlsoNegotiates (506) +# - Net::HTTPInsufficientStorage (507) +# - Net::HTTPLoopDetected (508) +# - Net::HTTPNotExtended (510) +# - Net::HTTPNetworkAuthenticationRequired (511) +# +# There is also the Net::HTTPBadResponse exception which is raised when +# there is a protocol error. +# +# source://net-http//lib/net/http/response.rb#135 +class Net::HTTPResponse + include ::Net::HTTPHeader + + # @return [HTTPResponse] a new instance of HTTPResponse + # + # source://net-http//lib/net/http/response.rb#194 + def initialize(httpv, code, msg); end + + # Returns the string response body; + # note that repeated calls for the unmodified body return a cached string: + # + # path = '/todos/1' + # Net::HTTP.start(hostname) do |http| + # res = http.get(path) + # p res.body + # p http.head(path).body # No body. + # end + # + # Output: + # + # "{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n}" + # nil + # + # source://net-http//lib/net/http/response.rb#400 + def body; end + + # Sets the body of the response to the given value. + # + # source://net-http//lib/net/http/response.rb#405 + def body=(value); end + + # Returns the value set by body_encoding=, or +false+ if none; + # see #body_encoding=. + # + # source://net-http//lib/net/http/response.rb#229 + def body_encoding; end + + # Sets the encoding that should be used when reading the body: + # + # - If the given value is an Encoding object, that encoding will be used. + # - Otherwise if the value is a string, the value of + # {Encoding#find(value)}[https://docs.ruby-lang.org/en/master/Encoding.html#method-c-find] + # will be used. + # - Otherwise an encoding will be deduced from the body itself. + # + # Examples: + # + # http = Net::HTTP.new(hostname) + # req = Net::HTTP::Get.new('/') + # + # http.request(req) do |res| + # p res.body.encoding # => # + # end + # + # http.request(req) do |res| + # res.body_encoding = "UTF-8" + # p res.body.encoding # => # + # end + # + # source://net-http//lib/net/http/response.rb#253 + def body_encoding=(value); end + + # The HTTP result code string. For example, '302'. You can also + # determine the response type by examining which response subclass + # the response object is an instance of. + # + # source://net-http//lib/net/http/response.rb#213 + def code; end + + # response <-> exception relationship + # + # source://net-http//lib/net/http/response.rb#270 + def code_type; end + + # Set to true automatically when the request did not contain an + # Accept-Encoding header from the user. + # + # source://net-http//lib/net/http/response.rb#225 + def decode_content; end + + # Set to true automatically when the request did not contain an + # Accept-Encoding header from the user. + # + # source://net-http//lib/net/http/response.rb#225 + def decode_content=(_arg0); end + + # Returns the string response body; + # note that repeated calls for the unmodified body return a cached string: + # + # path = '/todos/1' + # Net::HTTP.start(hostname) do |http| + # res = http.get(path) + # p res.body + # p http.head(path).body # No body. + # end + # + # Output: + # + # "{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n}" + # nil + # + # source://net-http//lib/net/http/response.rb#400 + def entity; end + + # @raise [error_type()] + # + # source://net-http//lib/net/http/response.rb#274 + def error!; end + + # source://net-http//lib/net/http/response.rb#280 + def error_type; end + + # source://net-http//lib/net/http/response.rb#302 + def header; end + + # The HTTP version supported by the server. + # + # source://net-http//lib/net/http/response.rb#208 + def http_version; end + + # Whether to ignore EOF when reading bodies with a specified Content-Length + # header. + # + # source://net-http//lib/net/http/response.rb#260 + def ignore_eof; end + + # Whether to ignore EOF when reading bodies with a specified Content-Length + # header. + # + # source://net-http//lib/net/http/response.rb#260 + def ignore_eof=(_arg0); end + + # source://net-http//lib/net/http/response.rb#262 + def inspect; end + + # The HTTP result message sent by the server. For example, 'Not Found'. + # + # source://net-http//lib/net/http/response.rb#216 + def message; end + + # The HTTP result message sent by the server. For example, 'Not Found'. + # + # source://net-http//lib/net/http/response.rb#216 + def msg; end + + # Gets the entity body returned by the remote HTTP server. + # + # If a block is given, the body is passed to the block, and + # the body is provided in fragments, as it is read in from the socket. + # + # If +dest+ argument is given, response is read into that variable, + # with dest#<< method (it could be String or IO, or any + # other object responding to <<). + # + # Calling this method a second or subsequent time for the same + # HTTPResponse object will return the value already read. + # + # http.request_get('/index.html') {|res| + # puts res.read_body + # } + # + # http.request_get('/index.html') {|res| + # p res.read_body.object_id # 538149362 + # p res.read_body.object_id # 538149362 + # } + # + # # using iterator + # http.request_get('/index.html') {|res| + # res.read_body do |segment| + # print segment + # end + # } + # + # source://net-http//lib/net/http/response.rb#355 + def read_body(dest = T.unsafe(nil), &block); end + + # source://net-http//lib/net/http/response.rb#307 + def read_header; end + + # body + # + # source://net-http//lib/net/http/response.rb#316 + def reading_body(sock, reqmethodallowbody); end + + # header (for backward compatibility only; DO NOT USE) + # + # source://net-http//lib/net/http/response.rb#297 + def response; end + + # The URI used to fetch this response. The response URI is only available + # if a URI was used to create the request. + # + # source://net-http//lib/net/http/response.rb#221 + def uri; end + + # source://net-http//lib/net/http/response.rb#289 + def uri=(uri); end + + # Raises an HTTP error if the response is not 2xx (success). + # + # source://net-http//lib/net/http/response.rb#285 + def value; end + + private + + # source://net-http//lib/net/http/response.rb#450 + def check_bom(str); end + + # source://net-http//lib/net/http/response.rb#414 + def detect_encoding(str, encoding = T.unsafe(nil)); end + + # source://net-http//lib/net/http/response.rb#540 + def extracting_encodings_from_meta_elements(value); end + + # source://net-http//lib/net/http/response.rb#505 + def get_attribute(ss); end + + # Checks for a supported Content-Encoding header and yields an Inflate + # wrapper for this response's socket when zlib is present. If the + # Content-Encoding is not supported or zlib is missing, the plain socket is + # yielded. + # + # If a Content-Range header is present, a plain socket is yielded as the + # bytes in the range may not be a complete deflate block. + # + # source://net-http//lib/net/http/response.rb#557 + def inflater; end + + # @raise [ArgumentError] + # + # source://net-http//lib/net/http/response.rb#646 + def procdest(dest, block); end + + # source://net-http//lib/net/http/response.rb#592 + def read_body_0(dest); end + + # read_chunked reads from +@socket+ for chunk-size, chunk-extension, CRLF, + # etc. and +chunk_data_io+ for chunk-data which may be deflate or gzip + # encoded. + # + # See RFC 2616 section 3.6.1 for definitions + # + # source://net-http//lib/net/http/response.rb#622 + def read_chunked(dest, chunk_data_io); end + + # source://net-http//lib/net/http/response.rb#464 + def scanning_meta(str); end + + # source://net-http//lib/net/http/response.rb#434 + def sniff_encoding(str, encoding = T.unsafe(nil)); end + + # @raise [IOError] + # + # source://net-http//lib/net/http/response.rb#642 + def stream_check; end + + class << self + # true if the response has a body. + # + # @return [Boolean] + # + # source://net-http//lib/net/http/response.rb#138 + def body_permitted?; end + + # source://net-http//lib/net/http/response.rb#142 + def exception_type; end + + # source://net-http//lib/net/http/response.rb#146 + def read_new(sock); end + + private + + # @yield [key, value] + # + # source://net-http//lib/net/http/response.rb#170 + def each_response_header(sock); end + + # source://net-http//lib/net/http/response.rb#157 + def read_status_line(sock); end + + # source://net-http//lib/net/http/response.rb#164 + def response_class(code); end + end +end + +# Inflater is a wrapper around Net::BufferedIO that transparently inflates +# zlib and gzip streams. +# +# source://net-http//lib/net/http/response.rb#660 +class Net::HTTPResponse::Inflater + # Creates a new Inflater wrapping +socket+ + # + # @return [Inflater] a new instance of Inflater + # + # source://net-http//lib/net/http/response.rb#665 + def initialize(socket); end + + # The number of bytes inflated, used to update the Content-Length of + # the response. + # + # source://net-http//lib/net/http/response.rb#683 + def bytes_inflated; end + + # Finishes the inflate stream. + # + # source://net-http//lib/net/http/response.rb#674 + def finish; end + + # Returns a Net::ReadAdapter that inflates each read chunk into +dest+. + # + # This allows a large response body to be inflated without storing the + # entire body in memory. + # + # source://net-http//lib/net/http/response.rb#693 + def inflate_adapter(dest); end + + # Reads +clen+ bytes from the socket, inflates them, then writes them to + # +dest+. +ignore_eof+ is passed down to Net::BufferedIO#read + # + # Unlike Net::BufferedIO#read, this method returns more than +clen+ bytes. + # At this time there is no way for a user of Net::HTTPResponse to read a + # specific number of bytes from the HTTP response body, so this internal + # API does not return the same number of bytes as were requested. + # + # See https://bugs.ruby-lang.org/issues/6492 for further discussion. + # + # source://net-http//lib/net/http/response.rb#720 + def read(clen, dest, ignore_eof = T.unsafe(nil)); end + + # Reads the rest of the socket, inflates it, then writes it to +dest+. + # + # source://net-http//lib/net/http/response.rb#729 + def read_all(dest); end +end + +# source://net-http//lib/net/http/responses.rb#81 +Net::HTTPServerError::EXCEPTION_TYPE = Net::HTTPFatalError + +# for backward compatibility until Ruby 3.5 +# https://bugs.ruby-lang.org/issues/20900 +# https://github.com/bblimke/webmock/pull/1081 +# +# source://net-http//lib/net/http.rb#2565 +Net::HTTPSession = Net::HTTP + +# source://net-http//lib/net/http/responses.rb#38 +Net::HTTPSuccess::EXCEPTION_TYPE = Net::HTTPError + +# Response class for URI Too Long responses (status code 414). +# +# The URI provided was too long for the server to process. +# +# :include: doc/net-http/included_getters.rdoc +# +# References: +# +# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/414]. +# - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-414-uri-too-long]. +# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#414]. +# +# source://net-http//lib/net/http/responses.rb#705 +class Net::HTTPURITooLong < ::Net::HTTPClientError; end + +# source://net-http//lib/net/http/responses.rb#706 +Net::HTTPURITooLong::HAS_BODY = T.let(T.unsafe(nil), TrueClass) + +# source://net-http//lib/net/http/responses.rb#9 +Net::HTTPUnknownResponse::EXCEPTION_TYPE = Net::HTTPError + +# Response class for Variant Also Negotiates responses (status code 506). +# +# Transparent content negotiation for the request results in a circular reference. +# +# :include: doc/net-http/included_getters.rdoc +# +# References: +# +# - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/506]. +# - {RFC 2295}[https://www.rfc-editor.org/rfc/rfc2295#section-8.1]. +# - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#506]. +# +# source://net-http//lib/net/http/responses.rb#1029 +class Net::HTTPVariantAlsoNegotiates < ::Net::HTTPServerError; end + +# source://net-http//lib/net/http/responses.rb#1030 +Net::HTTPVariantAlsoNegotiates::HAS_BODY = T.let(T.unsafe(nil), TrueClass) diff --git a/sorbet/rbi/gems/telegram-bot-ruby@2.4.0.rbi b/sorbet/rbi/gems/telegram-bot-ruby@2.4.0.rbi new file mode 100644 index 00000000..8a504948 --- /dev/null +++ b/sorbet/rbi/gems/telegram-bot-ruby@2.4.0.rbi @@ -0,0 +1,4716 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `telegram-bot-ruby` gem. +# Please instead update this file by running `bin/tapioca gem telegram-bot-ruby`. + + +# source://telegram-bot-ruby//lib/telegram/bot.rb#10 +module Telegram; end + +# source://telegram-bot-ruby//lib/telegram/bot.rb#11 +module Telegram::Bot + class << self + # source://telegram-bot-ruby//lib/telegram/bot.rb#16 + def configuration; end + + # Sets the attribute configuration + # + # @param value the value to set the attribute configuration to. + # + # source://telegram-bot-ruby//lib/telegram/bot.rb#13 + def configuration=(_arg0); end + + # @yield [configuration] + # + # source://telegram-bot-ruby//lib/telegram/bot.rb#20 + def configure; end + end +end + +# source://telegram-bot-ruby//lib/telegram/bot/api.rb#5 +class Telegram::Bot::Api + # @return [Api] a new instance of Api + # + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#8 + def initialize(token, url: T.unsafe(nil), environment: T.unsafe(nil)); end + + # @raise [Exceptions::ResponseError] + # + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#44 + def call(endpoint, raw_params = T.unsafe(nil)); end + + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#14 + def connection; end + + # Returns the value of attribute environment. + # + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#6 + def environment; end + + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#24 + def method_missing(method_name, *args, &block); end + + # Returns the value of attribute token. + # + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#6 + def token; end + + # Returns the value of attribute url. + # + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#6 + def url; end + + private + + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#55 + def build_params(params); end + + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#61 + def build_path(endpoint); end + + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#79 + def camelize(method_name); end + + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#71 + def jsonify_value(value); end + + # @return [Boolean] + # + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#75 + def jsonify_value?(value); end + + # @return [Boolean] + # + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#37 + def respond_to_missing?(*args); end + + # source://telegram-bot-ruby//lib/telegram/bot/api.rb#67 + def sanitize_value(value); end +end + +# source://telegram-bot-ruby//lib/telegram/bot/api/endpoints.rb#6 +Telegram::Bot::Api::ENDPOINTS = T.let(T.unsafe(nil), Hash) + +# source://telegram-bot-ruby//lib/telegram/bot/client.rb#5 +class Telegram::Bot::Client + # @return [Client] a new instance of Client + # + # source://telegram-bot-ruby//lib/telegram/bot/client.rb#13 + def initialize(token, hash = T.unsafe(nil)); end + + # Returns the value of attribute api. + # + # source://telegram-bot-ruby//lib/telegram/bot/client.rb#6 + def api; end + + # source://telegram-bot-ruby//lib/telegram/bot/client.rb#33 + def fetch_updates; end + + # source://telegram-bot-ruby//lib/telegram/bot/client.rb#41 + def handle_update(update); end + + # source://telegram-bot-ruby//lib/telegram/bot/client.rb#23 + def listen(&block); end + + # Returns the value of attribute logger. + # + # source://telegram-bot-ruby//lib/telegram/bot/client.rb#7 + def logger; end + + # Sets the attribute logger + # + # @param value the value to set the attribute logger to. + # + # source://telegram-bot-ruby//lib/telegram/bot/client.rb#7 + def logger=(_arg0); end + + # Returns the value of attribute options. + # + # source://telegram-bot-ruby//lib/telegram/bot/client.rb#6 + def options; end + + # @yield [_self] + # @yieldparam _self [Telegram::Bot::Client] the object that the method was called on + # + # source://telegram-bot-ruby//lib/telegram/bot/client.rb#19 + def run; end + + # source://telegram-bot-ruby//lib/telegram/bot/client.rb#29 + def stop; end + + private + + # source://telegram-bot-ruby//lib/telegram/bot/client.rb#51 + def default_options; end + + # source://telegram-bot-ruby//lib/telegram/bot/client.rb#61 + def log_incoming_message(message); end + + class << self + # source://telegram-bot-ruby//lib/telegram/bot/client.rb#9 + def run(*args, &block); end + end +end + +# source://telegram-bot-ruby//lib/telegram/bot/configuration.rb#5 +class Telegram::Bot::Configuration + # @return [Configuration] a new instance of Configuration + # + # source://telegram-bot-ruby//lib/telegram/bot/configuration.rb#8 + def initialize; end + + # Returns the value of attribute adapter. + # + # source://telegram-bot-ruby//lib/telegram/bot/configuration.rb#6 + def adapter; end + + # Sets the attribute adapter + # + # @param value the value to set the attribute adapter to. + # + # source://telegram-bot-ruby//lib/telegram/bot/configuration.rb#6 + def adapter=(_arg0); end + + # Returns the value of attribute connection_open_timeout. + # + # source://telegram-bot-ruby//lib/telegram/bot/configuration.rb#6 + def connection_open_timeout; end + + # Sets the attribute connection_open_timeout + # + # @param value the value to set the attribute connection_open_timeout to. + # + # source://telegram-bot-ruby//lib/telegram/bot/configuration.rb#6 + def connection_open_timeout=(_arg0); end + + # Returns the value of attribute connection_timeout. + # + # source://telegram-bot-ruby//lib/telegram/bot/configuration.rb#6 + def connection_timeout; end + + # Sets the attribute connection_timeout + # + # @param value the value to set the attribute connection_timeout to. + # + # source://telegram-bot-ruby//lib/telegram/bot/configuration.rb#6 + def connection_timeout=(_arg0); end +end + +# source://telegram-bot-ruby//lib/telegram/bot/exceptions/base.rb#5 +module Telegram::Bot::Exceptions; end + +# source://telegram-bot-ruby//lib/telegram/bot/exceptions/base.rb#6 +class Telegram::Bot::Exceptions::Base < ::StandardError; end + +# source://telegram-bot-ruby//lib/telegram/bot/exceptions/response_error.rb#6 +class Telegram::Bot::Exceptions::ResponseError < ::Telegram::Bot::Exceptions::Base + # @return [ResponseError] a new instance of ResponseError + # + # source://telegram-bot-ruby//lib/telegram/bot/exceptions/response_error.rb#9 + def initialize(response:); end + + # source://telegram-bot-ruby//lib/telegram/bot/exceptions/response_error.rb#19 + def data; end + + # source://telegram-bot-ruby//lib/telegram/bot/exceptions/response_error.rb#15 + def error_code; end + + # Returns the value of attribute response. + # + # source://telegram-bot-ruby//lib/telegram/bot/exceptions/response_error.rb#7 + def response; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/null_logger.rb#5 +class Telegram::Bot::NullLogger < ::Logger + # @return [NullLogger] a new instance of NullLogger + # + # source://telegram-bot-ruby//lib/telegram/bot/null_logger.rb#6 + def initialize(*_arg0); end + + # source://telegram-bot-ruby//lib/telegram/bot/null_logger.rb#8 + def add(*_arg0); end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types.rb#5 +module Telegram::Bot::Types + extend ::Dry::Types::BuilderMethods + extend ::Dry::Core::Deprecations::Interface + + mixes_in_class_methods ::Dry::Types::BuilderMethods +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/affiliate_info.rb#6 +class Telegram::Bot::Types::AffiliateInfo < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def affiliate_chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def affiliate_user; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def amount; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def commission_per_mille; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def nanostar_amount; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/animation.rb#6 +class Telegram::Bot::Types::Animation < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_size; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_unique_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mime_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def width; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/audio.rb#6 +class Telegram::Bot::Types::Audio < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_size; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_unique_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mime_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def performer; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/background_fill.rb#8 +Telegram::Bot::Types::BackgroundFill = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/background_fill_freeform_gradient.rb#6 +class Telegram::Bot::Types::BackgroundFillFreeformGradient < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def colors; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/background_fill_gradient.rb#6 +class Telegram::Bot::Types::BackgroundFillGradient < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def bottom_color; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def rotation_angle; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def top_color; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/background_fill_solid.rb#6 +class Telegram::Bot::Types::BackgroundFillSolid < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def color; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/background_type.rb#8 +Telegram::Bot::Types::BackgroundType = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/background_type_chat_theme.rb#6 +class Telegram::Bot::Types::BackgroundTypeChatTheme < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def theme_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/background_type_fill.rb#6 +class Telegram::Bot::Types::BackgroundTypeFill < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def dark_theme_dimming; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def fill; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/background_type_pattern.rb#6 +class Telegram::Bot::Types::BackgroundTypePattern < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def document; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def fill; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def intensity; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_inverted; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_moving; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/background_type_wallpaper.rb#6 +class Telegram::Bot::Types::BackgroundTypeWallpaper < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def dark_theme_dimming; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def document; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_blurred; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_moving; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/base.rb#6 +class Telegram::Bot::Types::Base < ::Dry::Struct + include ::Telegram::Bot::Types::Compactable + include ::Telegram::Bot::Types::PatternMatching +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/birthdate.rb#6 +class Telegram::Bot::Types::Birthdate < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def day; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def month; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def year; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/bot_command.rb#6 +class Telegram::Bot::Types::BotCommand < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def command; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/bot_command_scope.rb#8 +Telegram::Bot::Types::BotCommandScope = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/bot_command_scope_all_chat_administrators.rb#6 +class Telegram::Bot::Types::BotCommandScopeAllChatAdministrators < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/bot_command_scope_all_group_chats.rb#6 +class Telegram::Bot::Types::BotCommandScopeAllGroupChats < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/bot_command_scope_all_private_chats.rb#6 +class Telegram::Bot::Types::BotCommandScopeAllPrivateChats < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/bot_command_scope_chat.rb#6 +class Telegram::Bot::Types::BotCommandScopeChat < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/bot_command_scope_chat_administrators.rb#6 +class Telegram::Bot::Types::BotCommandScopeChatAdministrators < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/bot_command_scope_chat_member.rb#6 +class Telegram::Bot::Types::BotCommandScopeChatMember < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user_id; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/bot_command_scope_default.rb#6 +class Telegram::Bot::Types::BotCommandScopeDefault < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/bot_description.rb#6 +class Telegram::Bot::Types::BotDescription < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/bot_name.rb#6 +class Telegram::Bot::Types::BotName < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def name; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/bot_short_description.rb#6 +class Telegram::Bot::Types::BotShortDescription < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def short_description; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/business_connection.rb#6 +class Telegram::Bot::Types::BusinessConnection < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_reply; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_enabled; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user_chat_id; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/business_intro.rb#6 +class Telegram::Bot::Types::BusinessIntro < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sticker; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/business_location.rb#6 +class Telegram::Bot::Types::BusinessLocation < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def address; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def location; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/business_messages_deleted.rb#6 +class Telegram::Bot::Types::BusinessMessagesDeleted < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def business_connection_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_ids; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/business_opening_hours.rb#6 +class Telegram::Bot::Types::BusinessOpeningHours < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def opening_hours; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def time_zone_name; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/business_opening_hours_interval.rb#6 +class Telegram::Bot::Types::BusinessOpeningHoursInterval < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def closing_minute; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def opening_minute; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/callback_game.rb#6 +class Telegram::Bot::Types::CallbackGame < ::Telegram::Bot::Types::Base; end + +# source://telegram-bot-ruby//lib/telegram/bot/types/callback_query.rb#6 +class Telegram::Bot::Types::CallbackQuery < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_instance; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def data; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def from; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def game_short_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def inline_message_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat.rb#6 +class Telegram::Bot::Types::Chat < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def first_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_forum; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def last_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def username; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_administrator_rights.rb#6 +class Telegram::Bot::Types::ChatAdministratorRights < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_change_info; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_delete_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_delete_stories; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_edit_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_edit_stories; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_invite_users; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_manage_chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_manage_topics; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_manage_video_chats; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_pin_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_post_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_post_stories; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_promote_members; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_restrict_members; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_anonymous; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_background.rb#6 +class Telegram::Bot::Types::ChatBackground < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_boost.rb#6 +class Telegram::Bot::Types::ChatBoost < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def add_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def boost_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def expiration_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_boost_added.rb#6 +class Telegram::Bot::Types::ChatBoostAdded < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def boost_count; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_boost_removed.rb#6 +class Telegram::Bot::Types::ChatBoostRemoved < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def boost_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def remove_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_boost_source.rb#8 +Telegram::Bot::Types::ChatBoostSource = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_boost_source_gift_code.rb#6 +class Telegram::Bot::Types::ChatBoostSourceGiftCode < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_boost_source_giveaway.rb#6 +class Telegram::Bot::Types::ChatBoostSourceGiveaway < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def giveaway_message_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_unclaimed; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def prize_star_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_boost_source_premium.rb#6 +class Telegram::Bot::Types::ChatBoostSourcePremium < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_boost_updated.rb#6 +class Telegram::Bot::Types::ChatBoostUpdated < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def boost; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_full_info.rb#6 +class Telegram::Bot::Types::ChatFullInfo < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def accent_color_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def active_usernames; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def available_reactions; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def background_custom_emoji_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def bio; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def birthdate; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def business_intro; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def business_location; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def business_opening_hours; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_gift; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_paid_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_set_sticker_set; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def custom_emoji_sticker_set_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def emoji_status_custom_emoji_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def emoji_status_expiration_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def first_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_aggressive_anti_spam_enabled; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_hidden_members; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_private_forwards; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_protected_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_restricted_voice_and_video_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_visible_history; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def invite_link; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_forum; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def join_by_request; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def join_to_send_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def last_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def linked_chat_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def location; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def max_reaction_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_auto_delete_time; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def permissions; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def personal_chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def pinned_message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def profile_accent_color_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def profile_background_custom_emoji_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def slow_mode_delay; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sticker_set_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def unrestrict_boost_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def username; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_invite_link.rb#6 +class Telegram::Bot::Types::ChatInviteLink < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def creates_join_request; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def creator; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def expire_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def invite_link; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_primary; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_revoked; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def member_limit; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def pending_join_request_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def subscription_period; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def subscription_price; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_join_request.rb#6 +class Telegram::Bot::Types::ChatJoinRequest < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def bio; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def from; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def invite_link; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user_chat_id; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_location.rb#6 +class Telegram::Bot::Types::ChatLocation < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def address; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def location; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_member.rb#8 +Telegram::Bot::Types::ChatMember = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_member_administrator.rb#6 +class Telegram::Bot::Types::ChatMemberAdministrator < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_be_edited; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_change_info; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_delete_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_delete_stories; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_edit_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_edit_stories; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_invite_users; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_manage_chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_manage_topics; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_manage_video_chats; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_pin_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_post_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_post_stories; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_promote_members; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_restrict_members; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def custom_title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_anonymous; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def status; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_member_banned.rb#6 +class Telegram::Bot::Types::ChatMemberBanned < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def status; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def until_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_member_left.rb#6 +class Telegram::Bot::Types::ChatMemberLeft < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def status; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_member_member.rb#6 +class Telegram::Bot::Types::ChatMemberMember < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def status; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def until_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_member_owner.rb#6 +class Telegram::Bot::Types::ChatMemberOwner < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def custom_title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_anonymous; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def status; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_member_restricted.rb#6 +class Telegram::Bot::Types::ChatMemberRestricted < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_add_web_page_previews; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_change_info; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_invite_users; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_manage_topics; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_pin_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_audios; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_documents; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_other_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_photos; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_polls; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_video_notes; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_videos; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_voice_notes; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_member; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def status; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def until_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_member_updated.rb#6 +class Telegram::Bot::Types::ChatMemberUpdated < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def from; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def invite_link; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def new_chat_member; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def old_chat_member; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def via_chat_folder_invite_link; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def via_join_request; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_permissions.rb#6 +class Telegram::Bot::Types::ChatPermissions < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_add_web_page_previews; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_change_info; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_invite_users; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_manage_topics; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_pin_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_audios; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_documents; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_other_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_photos; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_polls; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_video_notes; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_videos; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_send_voice_notes; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_photo.rb#6 +class Telegram::Bot::Types::ChatPhoto < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def big_file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def big_file_unique_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def small_file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def small_file_unique_id; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chat_shared.rb#6 +class Telegram::Bot::Types::ChatShared < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def username; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/chosen_inline_result.rb#6 +class Telegram::Bot::Types::ChosenInlineResult < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def from; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def inline_message_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def location; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def query; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def result_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def to_s; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/compactable.rb#6 +module Telegram::Bot::Types::Compactable + # source://telegram-bot-ruby//lib/telegram/bot/types/compactable.rb#7 + def to_compact_hash; end + + # source://telegram-bot-ruby//lib/telegram/bot/types/compactable.rb#15 + def to_json(*args); end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/contact.rb#6 +class Telegram::Bot::Types::Contact < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def first_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def last_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def phone_number; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def vcard; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/copy_text_button.rb#6 +class Telegram::Bot::Types::CopyTextButton < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/dice.rb#6 +class Telegram::Bot::Types::Dice < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def emoji; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def value; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/document.rb#6 +class Telegram::Bot::Types::Document < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_size; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_unique_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mime_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/encrypted_credentials.rb#6 +class Telegram::Bot::Types::EncryptedCredentials < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def data; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def secret; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/encrypted_passport_element.rb#6 +class Telegram::Bot::Types::EncryptedPassportElement < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def data; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def email; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def files; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def front_side; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def phone_number; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reverse_side; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def selfie; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def translation; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/error.rb#6 +class Telegram::Bot::Types::Error < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def error_code; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def ok; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parameters; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/external_reply_info.rb#6 +class Telegram::Bot::Types::ExternalReplyInfo < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def animation; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def audio; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def contact; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def dice; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def document; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def game; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def giveaway; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def giveaway_winners; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_media_spoiler; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def invoice; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def link_preview_options; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def location; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def origin; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def paid_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def poll; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sticker; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def story; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def venue; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video_note; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def voice; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/file.rb#6 +class Telegram::Bot::Types::File < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_path; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_size; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_unique_id; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/force_reply.rb#6 +class Telegram::Bot::Types::ForceReply < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def force_reply; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_field_placeholder; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def selective; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/forum_topic.rb#6 +class Telegram::Bot::Types::ForumTopic < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def icon_color; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def icon_custom_emoji_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_thread_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def name; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/forum_topic_closed.rb#6 +class Telegram::Bot::Types::ForumTopicClosed < ::Telegram::Bot::Types::Base; end + +# source://telegram-bot-ruby//lib/telegram/bot/types/forum_topic_created.rb#6 +class Telegram::Bot::Types::ForumTopicCreated < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def icon_color; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def icon_custom_emoji_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def name; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/forum_topic_edited.rb#6 +class Telegram::Bot::Types::ForumTopicEdited < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def icon_custom_emoji_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def name; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/forum_topic_reopened.rb#6 +class Telegram::Bot::Types::ForumTopicReopened < ::Telegram::Bot::Types::Base; end + +# source://telegram-bot-ruby//lib/telegram/bot/types/game.rb#6 +class Telegram::Bot::Types::Game < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def animation; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/game_high_score.rb#6 +class Telegram::Bot::Types::GameHighScore < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def position; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def score; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/general_forum_topic_hidden.rb#6 +class Telegram::Bot::Types::GeneralForumTopicHidden < ::Telegram::Bot::Types::Base; end + +# source://telegram-bot-ruby//lib/telegram/bot/types/general_forum_topic_unhidden.rb#6 +class Telegram::Bot::Types::GeneralForumTopicUnhidden < ::Telegram::Bot::Types::Base; end + +# source://telegram-bot-ruby//lib/telegram/bot/types/gift.rb#6 +class Telegram::Bot::Types::Gift < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def remaining_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def star_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sticker; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def total_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def upgrade_star_count; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/gifts.rb#6 +class Telegram::Bot::Types::Gifts < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def gifts; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/giveaway.rb#6 +class Telegram::Bot::Types::Giveaway < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chats; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def country_codes; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_public_winners; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def only_new_members; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def premium_subscription_month_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def prize_description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def prize_star_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def winner_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def winners_selection_date; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/giveaway_completed.rb#6 +class Telegram::Bot::Types::GiveawayCompleted < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def giveaway_message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_star_giveaway; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def unclaimed_prize_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def winner_count; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/giveaway_created.rb#6 +class Telegram::Bot::Types::GiveawayCreated < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def prize_star_count; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/giveaway_winners.rb#6 +class Telegram::Bot::Types::GiveawayWinners < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def additional_chat_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def giveaway_message_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def only_new_members; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def premium_subscription_month_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def prize_description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def prize_star_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def unclaimed_prize_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def was_refunded; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def winner_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def winners; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def winners_selection_date; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inaccessible_message.rb#6 +class Telegram::Bot::Types::InaccessibleMessage < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_id; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_keyboard_button.rb#6 +class Telegram::Bot::Types::InlineKeyboardButton < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def callback_data; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def callback_game; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def copy_text; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def login_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def pay; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def switch_inline_query; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def switch_inline_query_chosen_chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def switch_inline_query_current_chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def web_app; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_keyboard_markup.rb#6 +class Telegram::Bot::Types::InlineKeyboardMarkup < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def inline_keyboard; end + + # source://telegram-bot-ruby//lib/telegram/bot/types/inline_keyboard_markup.rb#9 + def to_compact_hash; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query.rb#6 +class Telegram::Bot::Types::InlineQuery < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def from; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def location; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def offset; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def query; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def to_s; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result.rb#8 +Telegram::Bot::Types::InlineQueryResult = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_article.rb#6 +class Telegram::Bot::Types::InlineQueryResultArticle < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_width; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def url; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_audio.rb#6 +class Telegram::Bot::Types::InlineQueryResultAudio < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def audio_duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def audio_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def performer; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_cached_audio.rb#6 +class Telegram::Bot::Types::InlineQueryResultCachedAudio < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def audio_file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_cached_document.rb#6 +class Telegram::Bot::Types::InlineQueryResultCachedDocument < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def document_file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_cached_gif.rb#6 +class Telegram::Bot::Types::InlineQueryResultCachedGif < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def gif_file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def show_caption_above_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_cached_mpeg4_gif.rb#6 +class Telegram::Bot::Types::InlineQueryResultCachedMpeg4Gif < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mpeg4_file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def show_caption_above_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_cached_photo.rb#6 +class Telegram::Bot::Types::InlineQueryResultCachedPhoto < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo_file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def show_caption_above_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_cached_sticker.rb#6 +class Telegram::Bot::Types::InlineQueryResultCachedSticker < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sticker_file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_cached_video.rb#6 +class Telegram::Bot::Types::InlineQueryResultCachedVideo < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def show_caption_above_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video_file_id; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_cached_voice.rb#6 +class Telegram::Bot::Types::InlineQueryResultCachedVoice < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def voice_file_id; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_contact.rb#6 +class Telegram::Bot::Types::InlineQueryResultContact < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def first_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def last_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def phone_number; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_width; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def vcard; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_document.rb#6 +class Telegram::Bot::Types::InlineQueryResultDocument < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def document_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mime_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_width; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_game.rb#6 +class Telegram::Bot::Types::InlineQueryResultGame < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def game_short_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_gif.rb#6 +class Telegram::Bot::Types::InlineQueryResultGif < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def gif_duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def gif_height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def gif_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def gif_width; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def show_caption_above_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_mime_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_location.rb#6 +class Telegram::Bot::Types::InlineQueryResultLocation < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def heading; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def horizontal_accuracy; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def latitude; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def live_period; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def longitude; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def proximity_alert_radius; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_width; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb#6 +class Telegram::Bot::Types::InlineQueryResultMpeg4Gif < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mpeg4_duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mpeg4_height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mpeg4_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mpeg4_width; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def show_caption_above_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_mime_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_photo.rb#6 +class Telegram::Bot::Types::InlineQueryResultPhoto < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo_height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo_width; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def show_caption_above_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_venue.rb#6 +class Telegram::Bot::Types::InlineQueryResultVenue < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def address; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def foursquare_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def foursquare_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def google_place_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def google_place_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def latitude; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def longitude; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_width; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_video.rb#6 +class Telegram::Bot::Types::InlineQueryResultVideo < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mime_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def show_caption_above_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video_duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video_height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video_width; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_result_voice.rb#6 +class Telegram::Bot::Types::InlineQueryResultVoice < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_message_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def voice_duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def voice_url; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/inline_query_results_button.rb#6 +class Telegram::Bot::Types::InlineQueryResultsButton < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def start_parameter; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def web_app; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_contact_message_content.rb#6 +class Telegram::Bot::Types::InputContactMessageContent < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def first_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def last_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def phone_number; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def vcard; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_invoice_message_content.rb#6 +class Telegram::Bot::Types::InputInvoiceMessageContent < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def currency; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_flexible; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def max_tip_amount; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def need_email; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def need_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def need_phone_number; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def need_shipping_address; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def payload; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo_height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo_size; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo_url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo_width; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def prices; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def provider_data; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def provider_token; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def send_email_to_provider; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def send_phone_number_to_provider; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def suggested_tip_amounts; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_location_message_content.rb#6 +class Telegram::Bot::Types::InputLocationMessageContent < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def heading; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def horizontal_accuracy; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def latitude; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def live_period; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def longitude; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def proximity_alert_radius; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/input_media.rb#8 +Telegram::Bot::Types::InputMedia = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_media_animation.rb#6 +class Telegram::Bot::Types::InputMediaAnimation < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_spoiler; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def show_caption_above_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def width; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_media_audio.rb#6 +class Telegram::Bot::Types::InputMediaAudio < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def performer; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_media_document.rb#6 +class Telegram::Bot::Types::InputMediaDocument < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def disable_content_type_detection; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_media_photo.rb#6 +class Telegram::Bot::Types::InputMediaPhoto < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_spoiler; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def show_caption_above_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_media_video.rb#6 +class Telegram::Bot::Types::InputMediaVideo < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def cover; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_spoiler; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def show_caption_above_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def start_timestamp; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def supports_streaming; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def width; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/input_message_content.rb#8 +Telegram::Bot::Types::InputMessageContent = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/input_paid_media.rb#8 +Telegram::Bot::Types::InputPaidMedia = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_paid_media_photo.rb#6 +class Telegram::Bot::Types::InputPaidMediaPhoto < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_paid_media_video.rb#6 +class Telegram::Bot::Types::InputPaidMediaVideo < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def cover; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def start_timestamp; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def supports_streaming; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def width; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_poll_option.rb#6 +class Telegram::Bot::Types::InputPollOption < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text_parse_mode; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_sticker.rb#6 +class Telegram::Bot::Types::InputSticker < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def emoji_list; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def format; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def keywords; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mask_position; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sticker; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_text_message_content.rb#6 +class Telegram::Bot::Types::InputTextMessageContent < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def link_preview_options; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_text; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def parse_mode; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/input_venue_message_content.rb#6 +class Telegram::Bot::Types::InputVenueMessageContent < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def address; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def foursquare_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def foursquare_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def google_place_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def google_place_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def latitude; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def longitude; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/invoice.rb#6 +class Telegram::Bot::Types::Invoice < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def currency; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def description; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def start_parameter; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def total_amount; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/keyboard_button.rb#6 +class Telegram::Bot::Types::KeyboardButton < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_contact; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_location; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_poll; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_users; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def web_app; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/keyboard_button_poll_type.rb#6 +class Telegram::Bot::Types::KeyboardButtonPollType < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/keyboard_button_request_chat.rb#6 +class Telegram::Bot::Types::KeyboardButtonRequestChat < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def bot_administrator_rights; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def bot_is_member; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_has_username; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_is_channel; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_is_created; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_is_forum; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_photo; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_username; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user_administrator_rights; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/keyboard_button_request_users.rb#6 +class Telegram::Bot::Types::KeyboardButtonRequestUsers < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def max_quantity; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_photo; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_username; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user_is_bot; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user_is_premium; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/labeled_price.rb#6 +class Telegram::Bot::Types::LabeledPrice < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def amount; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def label; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/link_preview_options.rb#6 +class Telegram::Bot::Types::LinkPreviewOptions < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_disabled; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def prefer_large_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def prefer_small_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def show_above_text; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def url; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/location.rb#6 +class Telegram::Bot::Types::Location < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def heading; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def horizontal_accuracy; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def latitude; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def live_period; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def longitude; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def proximity_alert_radius; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/login_url.rb#6 +class Telegram::Bot::Types::LoginUrl < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def bot_username; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def forward_text; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_write_access; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def url; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/mask_position.rb#6 +class Telegram::Bot::Types::MaskPosition < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def point; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def scale; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def x_shift; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def y_shift; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/maybe_inaccessible_message.rb#8 +Telegram::Bot::Types::MaybeInaccessibleMessage = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/menu_button.rb#8 +Telegram::Bot::Types::MenuButton = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/menu_button_commands.rb#6 +class Telegram::Bot::Types::MenuButtonCommands < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/menu_button_default.rb#6 +class Telegram::Bot::Types::MenuButtonDefault < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/menu_button_web_app.rb#6 +class Telegram::Bot::Types::MenuButtonWebApp < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def web_app; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/message.rb#6 +class Telegram::Bot::Types::Message < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def animation; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def audio; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def author_signature; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def boost_added; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def business_connection_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def caption_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def channel_chat_created; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_background_set; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_shared; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def connected_website; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def contact; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def delete_chat_photo; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def dice; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def document; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def edit_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def effect_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def external_reply; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def forum_topic_closed; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def forum_topic_created; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def forum_topic_edited; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def forum_topic_reopened; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def forward_origin; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def from; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def game; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def general_forum_topic_hidden; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def general_forum_topic_unhidden; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def giveaway; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def giveaway_completed; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def giveaway_created; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def giveaway_winners; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def group_chat_created; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_media_spoiler; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_protected_content; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def invoice; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_automatic_forward; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_from_offline; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_topic_message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def left_chat_member; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def link_preview_options; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def location; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def media_group_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_auto_delete_timer_changed; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_thread_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def migrate_from_chat_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def migrate_to_chat_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def new_chat_members; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def new_chat_photo; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def new_chat_title; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def paid_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def passport_data; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def pinned_message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def poll; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def proximity_alert_triggered; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def quote; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def refunded_payment; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_markup; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_to_message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reply_to_story; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sender_boost_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sender_business_bot; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sender_chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def show_caption_above_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sticker; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def story; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def successful_payment; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def supergroup_chat_created; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def to_s; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def users_shared; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def venue; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def via_bot; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video_chat_ended; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video_chat_participants_invited; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video_chat_scheduled; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video_chat_started; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video_note; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def voice; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def web_app_data; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def write_access_allowed; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/message_auto_delete_timer_changed.rb#6 +class Telegram::Bot::Types::MessageAutoDeleteTimerChanged < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_auto_delete_time; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/message_entity.rb#6 +class Telegram::Bot::Types::MessageEntity < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def custom_emoji_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def language; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def length; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def offset; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def url; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/message_id.rb#6 +class Telegram::Bot::Types::MessageId < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_id; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/message_origin.rb#8 +Telegram::Bot::Types::MessageOrigin = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/message_origin_channel.rb#6 +class Telegram::Bot::Types::MessageOriginChannel < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def author_signature; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/message_origin_chat.rb#6 +class Telegram::Bot::Types::MessageOriginChat < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def author_signature; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sender_chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/message_origin_hidden_user.rb#6 +class Telegram::Bot::Types::MessageOriginHiddenUser < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sender_user_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/message_origin_user.rb#6 +class Telegram::Bot::Types::MessageOriginUser < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sender_user; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/message_reaction_count_updated.rb#6 +class Telegram::Bot::Types::MessageReactionCountUpdated < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def reactions; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/message_reaction_updated.rb#6 +class Telegram::Bot::Types::MessageReactionUpdated < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def actor_chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def new_reaction; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def old_reaction; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/order_info.rb#6 +class Telegram::Bot::Types::OrderInfo < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def email; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def phone_number; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def shipping_address; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/paid_media.rb#8 +Telegram::Bot::Types::PaidMedia = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/paid_media_info.rb#6 +class Telegram::Bot::Types::PaidMediaInfo < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def paid_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def star_count; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/paid_media_photo.rb#6 +class Telegram::Bot::Types::PaidMediaPhoto < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/paid_media_preview.rb#6 +class Telegram::Bot::Types::PaidMediaPreview < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def width; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/paid_media_purchased.rb#6 +class Telegram::Bot::Types::PaidMediaPurchased < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def from; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def paid_media_payload; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/paid_media_video.rb#6 +class Telegram::Bot::Types::PaidMediaVideo < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def video; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/passport_data.rb#6 +class Telegram::Bot::Types::PassportData < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def credentials; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def data; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/passport_element_error.rb#8 +Telegram::Bot::Types::PassportElementError = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/passport_element_error_data_field.rb#6 +class Telegram::Bot::Types::PassportElementErrorDataField < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def data_hash; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def field_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/passport_element_error_file.rb#6 +class Telegram::Bot::Types::PassportElementErrorFile < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_hash; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/passport_element_error_files.rb#6 +class Telegram::Bot::Types::PassportElementErrorFiles < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_hashes; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/passport_element_error_front_side.rb#6 +class Telegram::Bot::Types::PassportElementErrorFrontSide < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_hash; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/passport_element_error_reverse_side.rb#6 +class Telegram::Bot::Types::PassportElementErrorReverseSide < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_hash; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/passport_element_error_selfie.rb#6 +class Telegram::Bot::Types::PassportElementErrorSelfie < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_hash; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/passport_element_error_translation_file.rb#6 +class Telegram::Bot::Types::PassportElementErrorTranslationFile < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_hash; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/passport_element_error_translation_files.rb#6 +class Telegram::Bot::Types::PassportElementErrorTranslationFiles < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_hashes; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/passport_element_error_unspecified.rb#6 +class Telegram::Bot::Types::PassportElementErrorUnspecified < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def element_hash; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/passport_file.rb#6 +class Telegram::Bot::Types::PassportFile < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_size; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_unique_id; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/pattern_matching.rb#6 +module Telegram::Bot::Types::PatternMatching + # source://telegram-bot-ruby//lib/telegram/bot/types/pattern_matching.rb#7 + def deconstruct_keys(_keys); end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/photo_size.rb#6 +class Telegram::Bot::Types::PhotoSize < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_size; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_unique_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def width; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/poll.rb#6 +class Telegram::Bot::Types::Poll < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def allows_multiple_answers; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def close_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def correct_option_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def explanation; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def explanation_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_anonymous; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_closed; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def open_period; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def options; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def question; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def question_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def total_voter_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/poll_answer.rb#6 +class Telegram::Bot::Types::PollAnswer < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def option_ids; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def poll_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def voter_chat; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/poll_option.rb#6 +class Telegram::Bot::Types::PollOption < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def voter_count; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/pre_checkout_query.rb#6 +class Telegram::Bot::Types::PreCheckoutQuery < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def currency; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def from; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def invoice_payload; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def order_info; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def shipping_option_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def total_amount; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/prepared_inline_message.rb#6 +class Telegram::Bot::Types::PreparedInlineMessage < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def expiration_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/proximity_alert_triggered.rb#6 +class Telegram::Bot::Types::ProximityAlertTriggered < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def distance; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def traveler; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def watcher; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/reaction_count.rb#6 +class Telegram::Bot::Types::ReactionCount < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def total_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/reaction_type.rb#8 +Telegram::Bot::Types::ReactionType = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/reaction_type_custom_emoji.rb#6 +class Telegram::Bot::Types::ReactionTypeCustomEmoji < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def custom_emoji_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/reaction_type_emoji.rb#6 +class Telegram::Bot::Types::ReactionTypeEmoji < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def emoji; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/reaction_type_paid.rb#6 +class Telegram::Bot::Types::ReactionTypePaid < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/refunded_payment.rb#6 +class Telegram::Bot::Types::RefundedPayment < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def currency; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def invoice_payload; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def provider_payment_charge_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def telegram_payment_charge_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def total_amount; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/reply_keyboard_markup.rb#6 +class Telegram::Bot::Types::ReplyKeyboardMarkup < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def input_field_placeholder; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_persistent; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def keyboard; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def one_time_keyboard; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def resize_keyboard; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def selective; end + + # source://telegram-bot-ruby//lib/telegram/bot/types/reply_keyboard_markup.rb#14 + def to_compact_hash; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/reply_keyboard_remove.rb#6 +class Telegram::Bot::Types::ReplyKeyboardRemove < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def remove_keyboard; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def selective; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/reply_parameters.rb#6 +class Telegram::Bot::Types::ReplyParameters < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def allow_sending_without_reply; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def quote; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def quote_entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def quote_parse_mode; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def quote_position; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/response_parameters.rb#6 +class Telegram::Bot::Types::ResponseParameters < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def migrate_to_chat_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def retry_after; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/revenue_withdrawal_state.rb#8 +Telegram::Bot::Types::RevenueWithdrawalState = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/revenue_withdrawal_state_failed.rb#6 +class Telegram::Bot::Types::RevenueWithdrawalStateFailed < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/revenue_withdrawal_state_pending.rb#6 +class Telegram::Bot::Types::RevenueWithdrawalStatePending < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/revenue_withdrawal_state_succeeded.rb#6 +class Telegram::Bot::Types::RevenueWithdrawalStateSucceeded < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def url; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/sent_web_app_message.rb#6 +class Telegram::Bot::Types::SentWebAppMessage < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def inline_message_id; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/shared_user.rb#6 +class Telegram::Bot::Types::SharedUser < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def first_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def last_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photo; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def username; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/shipping_address.rb#6 +class Telegram::Bot::Types::ShippingAddress < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def city; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def country_code; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def post_code; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def state; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def street_line1; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def street_line2; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/shipping_option.rb#6 +class Telegram::Bot::Types::ShippingOption < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def prices; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/shipping_query.rb#6 +class Telegram::Bot::Types::ShippingQuery < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def from; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def invoice_payload; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def shipping_address; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/star_transaction.rb#6 +class Telegram::Bot::Types::StarTransaction < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def amount; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def nanostar_amount; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def receiver; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def source; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/star_transactions.rb#6 +class Telegram::Bot::Types::StarTransactions < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def transactions; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/sticker.rb#6 +class Telegram::Bot::Types::Sticker < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def custom_emoji_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def emoji; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_size; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_unique_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_animated; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_video; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mask_position; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def needs_repainting; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def premium_animation; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def set_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def width; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/sticker_set.rb#6 +class Telegram::Bot::Types::StickerSet < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sticker_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def stickers; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/story.rb#6 +class Telegram::Bot::Types::Story < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/successful_payment.rb#6 +class Telegram::Bot::Types::SuccessfulPayment < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def currency; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def invoice_payload; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_first_recurring; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_recurring; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def order_info; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def provider_payment_charge_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def shipping_option_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def subscription_expiration_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def telegram_payment_charge_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def total_amount; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/switch_inline_query_chosen_chat.rb#6 +class Telegram::Bot::Types::SwitchInlineQueryChosenChat < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def allow_bot_chats; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def allow_channel_chats; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def allow_group_chats; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def allow_user_chats; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def query; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/text_quote.rb#6 +class Telegram::Bot::Types::TextQuote < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def entities; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_manual; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def position; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def text; end +end + +# Just for classes consistency +# +# source://telegram-bot-ruby//lib/telegram/bot/types/transaction_partner.rb#8 +Telegram::Bot::Types::TransactionPartner = T.let(T.unsafe(nil), Dry::Struct::Sum) + +# source://telegram-bot-ruby//lib/telegram/bot/types/transaction_partner_affiliate_program.rb#6 +class Telegram::Bot::Types::TransactionPartnerAffiliateProgram < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def commission_per_mille; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def sponsor_user; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/transaction_partner_chat.rb#6 +class Telegram::Bot::Types::TransactionPartnerChat < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def gift; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/transaction_partner_fragment.rb#6 +class Telegram::Bot::Types::TransactionPartnerFragment < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def withdrawal_state; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/transaction_partner_other.rb#6 +class Telegram::Bot::Types::TransactionPartnerOther < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/transaction_partner_telegram_ads.rb#6 +class Telegram::Bot::Types::TransactionPartnerTelegramAds < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/transaction_partner_telegram_api.rb#6 +class Telegram::Bot::Types::TransactionPartnerTelegramApi < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/transaction_partner_user.rb#6 +class Telegram::Bot::Types::TransactionPartnerUser < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def affiliate; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def gift; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def invoice_payload; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def paid_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def paid_media_payload; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def subscription_period; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def user; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/update.rb#6 +class Telegram::Bot::Types::Update < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def business_connection; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def business_message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def callback_query; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def channel_post; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_boost; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_join_request; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chat_member; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def chosen_inline_result; end + + # source://telegram-bot-ruby//lib/telegram/bot/types/update.rb#32 + def current_message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def deleted_business_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def edited_business_message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def edited_channel_post; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def edited_message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def inline_query; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_reaction; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def message_reaction_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def my_chat_member; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def poll; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def poll_answer; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def pre_checkout_query; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def purchased_paid_media; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def removed_chat_boost; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def shipping_query; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def update_id; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/user.rb#6 +class Telegram::Bot::Types::User < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def added_to_attachment_menu; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_connect_to_business; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_join_groups; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def can_read_all_group_messages; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def first_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_main_web_app; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_bot; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def is_premium; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def language_code; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def last_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def supports_inline_queries; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def username; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/user_chat_boosts.rb#6 +class Telegram::Bot::Types::UserChatBoosts < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def boosts; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/user_profile_photos.rb#6 +class Telegram::Bot::Types::UserProfilePhotos < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def photos; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def total_count; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/users_shared.rb#6 +class Telegram::Bot::Types::UsersShared < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def request_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def users; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/venue.rb#6 +class Telegram::Bot::Types::Venue < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def address; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def foursquare_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def foursquare_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def google_place_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def google_place_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def location; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def title; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/video.rb#6 +class Telegram::Bot::Types::Video < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def cover; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_name; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_size; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_unique_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def height; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mime_type; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def start_timestamp; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def width; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/video_chat_ended.rb#6 +class Telegram::Bot::Types::VideoChatEnded < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def duration; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/video_chat_participants_invited.rb#6 +class Telegram::Bot::Types::VideoChatParticipantsInvited < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def users; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/video_chat_scheduled.rb#6 +class Telegram::Bot::Types::VideoChatScheduled < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def start_date; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/video_chat_started.rb#6 +class Telegram::Bot::Types::VideoChatStarted < ::Telegram::Bot::Types::Base; end + +# source://telegram-bot-ruby//lib/telegram/bot/types/video_note.rb#6 +class Telegram::Bot::Types::VideoNote < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_size; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_unique_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def length; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def thumbnail; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/voice.rb#6 +class Telegram::Bot::Types::Voice < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def duration; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_size; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def file_unique_id; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def mime_type; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/web_app_data.rb#6 +class Telegram::Bot::Types::WebAppData < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def button_text; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def data; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/web_app_info.rb#6 +class Telegram::Bot::Types::WebAppInfo < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def url; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/webhook_info.rb#6 +class Telegram::Bot::Types::WebhookInfo < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def allowed_updates; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def has_custom_certificate; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def ip_address; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def last_error_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def last_error_message; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def last_synchronization_error_date; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def max_connections; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def pending_update_count; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def url; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/types/write_access_allowed.rb#6 +class Telegram::Bot::Types::WriteAccessAllowed < ::Telegram::Bot::Types::Base + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def from_attachment_menu; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def from_request; end + + # source://dry-struct/1.8.0/lib/dry/struct/class_interface.rb#456 + def web_app_name; end +end + +# source://telegram-bot-ruby//lib/telegram/bot/version.rb#5 +Telegram::Bot::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/uri@1.0.3.rbi b/sorbet/rbi/gems/uri@1.0.3.rbi new file mode 100644 index 00000000..8a1d3a7e --- /dev/null +++ b/sorbet/rbi/gems/uri@1.0.3.rbi @@ -0,0 +1,2426 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `uri` gem. +# Please instead update this file by running `bin/tapioca gem uri`. + + +# module URI +# +# source://uri//lib/uri/common.rb#856 +module Kernel + private + + # Returns a \URI object derived from the given +uri+, + # which may be a \URI string or an existing \URI object: + # + # # Returns a new URI. + # uri = URI('http://github.com/ruby/ruby') + # # => # + # # Returns the given URI. + # URI(uri) + # # => # + # + # source://uri//lib/uri/common.rb#869 + def URI(uri); end + + class << self + # Returns a \URI object derived from the given +uri+, + # which may be a \URI string or an existing \URI object: + # + # # Returns a new URI. + # uri = URI('http://github.com/ruby/ruby') + # # => # + # # Returns the given URI. + # URI(uri) + # # => # + # + # source://uri//lib/uri/common.rb#869 + def URI(uri); end + end +end + +# source://uri//lib/uri.rb#90 +module URI + class << self + # source://uri//lib/uri/common.rb#47 + def const_missing(const); end + + # Like URI.decode_www_form_component, except that '+' is preserved. + # + # source://uri//lib/uri/common.rb#406 + def decode_uri_component(str, enc = T.unsafe(nil)); end + + # Returns name/value pairs derived from the given string +str+, + # which must be an ASCII string. + # + # The method may be used to decode the body of Net::HTTPResponse object +res+ + # for which res['Content-Type'] is 'application/x-www-form-urlencoded'. + # + # The returned data is an array of 2-element subarrays; + # each subarray is a name/value pair (both are strings). + # Each returned string has encoding +enc+, + # and has had invalid characters removed via + # {String#scrub}[https://docs.ruby-lang.org/en/master/String.html#method-i-scrub]. + # + # A simple example: + # + # URI.decode_www_form('foo=0&bar=1&baz') + # # => [["foo", "0"], ["bar", "1"], ["baz", ""]] + # + # The returned strings have certain conversions, + # similar to those performed in URI.decode_www_form_component: + # + # URI.decode_www_form('f%23o=%2F&b-r=%24&b+z=%40') + # # => [["f#o", "/"], ["b-r", "$"], ["b z", "@"]] + # + # The given string may contain consecutive separators: + # + # URI.decode_www_form('foo=0&&bar=1&&baz=2') + # # => [["foo", "0"], ["", ""], ["bar", "1"], ["", ""], ["baz", "2"]] + # + # A different separator may be specified: + # + # URI.decode_www_form('foo=0--bar=1--baz', separator: '--') + # # => [["foo", "0"], ["bar", "1"], ["baz", ""]] + # + # @raise [ArgumentError] + # + # source://uri//lib/uri/common.rb#581 + def decode_www_form(str, enc = T.unsafe(nil), separator: T.unsafe(nil), use__charset_: T.unsafe(nil), isindex: T.unsafe(nil)); end + + # Returns a string decoded from the given \URL-encoded string +str+. + # + # The given string is first encoded as Encoding::ASCII-8BIT (using String#b), + # then decoded (as below), and finally force-encoded to the given encoding +enc+. + # + # The returned string: + # + # - Preserves: + # + # - Characters '*', '.', '-', and '_'. + # - Character in ranges 'a'..'z', 'A'..'Z', + # and '0'..'9'. + # + # Example: + # + # URI.decode_www_form_component('*.-_azAZ09') + # # => "*.-_azAZ09" + # + # - Converts: + # + # - Character '+' to character ' '. + # - Each "percent notation" to an ASCII character. + # + # Example: + # + # URI.decode_www_form_component('Here+are+some+punctuation+characters%3A+%2C%3B%3F%3A') + # # => "Here are some punctuation characters: ,;?:" + # + # Related: URI.decode_uri_component (preserves '+'). + # + # source://uri//lib/uri/common.rb#395 + def decode_www_form_component(str, enc = T.unsafe(nil)); end + + # Like URI.encode_www_form_component, except that ' ' (space) + # is encoded as '%20' (instead of '+'). + # + # source://uri//lib/uri/common.rb#401 + def encode_uri_component(str, enc = T.unsafe(nil)); end + + # Returns a URL-encoded string derived from the given + # {Enumerable}[https://docs.ruby-lang.org/en/master/Enumerable.html#module-Enumerable-label-Enumerable+in+Ruby+Classes] + # +enum+. + # + # The result is suitable for use as form data + # for an \HTTP request whose Content-Type is + # 'application/x-www-form-urlencoded'. + # + # The returned string consists of the elements of +enum+, + # each converted to one or more URL-encoded strings, + # and all joined with character '&'. + # + # Simple examples: + # + # URI.encode_www_form([['foo', 0], ['bar', 1], ['baz', 2]]) + # # => "foo=0&bar=1&baz=2" + # URI.encode_www_form({foo: 0, bar: 1, baz: 2}) + # # => "foo=0&bar=1&baz=2" + # + # The returned string is formed using method URI.encode_www_form_component, + # which converts certain characters: + # + # URI.encode_www_form('f#o': '/', 'b-r': '$', 'b z': '@') + # # => "f%23o=%2F&b-r=%24&b+z=%40" + # + # When +enum+ is Array-like, each element +ele+ is converted to a field: + # + # - If +ele+ is an array of two or more elements, + # the field is formed from its first two elements + # (and any additional elements are ignored): + # + # name = URI.encode_www_form_component(ele[0], enc) + # value = URI.encode_www_form_component(ele[1], enc) + # "#{name}=#{value}" + # + # Examples: + # + # URI.encode_www_form([%w[foo bar], %w[baz bat bah]]) + # # => "foo=bar&baz=bat" + # URI.encode_www_form([['foo', 0], ['bar', :baz, 'bat']]) + # # => "foo=0&bar=baz" + # + # - If +ele+ is an array of one element, + # the field is formed from ele[0]: + # + # URI.encode_www_form_component(ele[0]) + # + # Example: + # + # URI.encode_www_form([['foo'], [:bar], [0]]) + # # => "foo&bar&0" + # + # - Otherwise the field is formed from +ele+: + # + # URI.encode_www_form_component(ele) + # + # Example: + # + # URI.encode_www_form(['foo', :bar, 0]) + # # => "foo&bar&0" + # + # The elements of an Array-like +enum+ may be mixture: + # + # URI.encode_www_form([['foo', 0], ['bar', 1, 2], ['baz'], :bat]) + # # => "foo=0&bar=1&baz&bat" + # + # When +enum+ is Hash-like, + # each +key+/+value+ pair is converted to one or more fields: + # + # - If +value+ is + # {Array-convertible}[https://docs.ruby-lang.org/en/master/implicit_conversion_rdoc.html#label-Array-Convertible+Objects], + # each element +ele+ in +value+ is paired with +key+ to form a field: + # + # name = URI.encode_www_form_component(key, enc) + # value = URI.encode_www_form_component(ele, enc) + # "#{name}=#{value}" + # + # Example: + # + # URI.encode_www_form({foo: [:bar, 1], baz: [:bat, :bam, 2]}) + # # => "foo=bar&foo=1&baz=bat&baz=bam&baz=2" + # + # - Otherwise, +key+ and +value+ are paired to form a field: + # + # name = URI.encode_www_form_component(key, enc) + # value = URI.encode_www_form_component(value, enc) + # "#{name}=#{value}" + # + # Example: + # + # URI.encode_www_form({foo: 0, bar: 1, baz: 2}) + # # => "foo=0&bar=1&baz=2" + # + # The elements of a Hash-like +enum+ may be mixture: + # + # URI.encode_www_form({foo: [0, 1], bar: 2}) + # # => "foo=0&foo=1&bar=2" + # + # source://uri//lib/uri/common.rb#528 + def encode_www_form(enum, enc = T.unsafe(nil)); end + + # Returns a URL-encoded string derived from the given string +str+. + # + # The returned string: + # + # - Preserves: + # + # - Characters '*', '.', '-', and '_'. + # - Character in ranges 'a'..'z', 'A'..'Z', + # and '0'..'9'. + # + # Example: + # + # URI.encode_www_form_component('*.-_azAZ09') + # # => "*.-_azAZ09" + # + # - Converts: + # + # - Character ' ' to character '+'. + # - Any other character to "percent notation"; + # the percent notation for character c is '%%%X' % c.ord. + # + # Example: + # + # URI.encode_www_form_component('Here are some punctuation characters: ,;?:') + # # => "Here+are+some+punctuation+characters%3A+%2C%3B%3F%3A" + # + # Encoding: + # + # - If +str+ has encoding Encoding::ASCII_8BIT, argument +enc+ is ignored. + # - Otherwise +str+ is converted first to Encoding::UTF_8 + # (with suitable character replacements), + # and then to encoding +enc+. + # + # In either case, the returned string has forced encoding Encoding::US_ASCII. + # + # Related: URI.encode_uri_component (encodes ' ' as '%20'). + # + # source://uri//lib/uri/common.rb#362 + def encode_www_form_component(str, enc = T.unsafe(nil)); end + + # == Synopsis + # + # URI::extract(str[, schemes][,&blk]) + # + # == Args + # + # +str+:: + # String to extract URIs from. + # +schemes+:: + # Limit URI matching to specific schemes. + # + # == Description + # + # Extracts URIs from a string. If block given, iterates through all matched URIs. + # Returns nil if block given or array with matches. + # + # == Usage + # + # require "uri" + # + # URI.extract("text here http://foo.example.org/bla and here mailto:test@example.com and here also.") + # # => ["http://foo.example.com/bla", "mailto:test@example.com"] + # + # source://uri//lib/uri/common.rb#266 + def extract(str, schemes = T.unsafe(nil), &block); end + + # Returns a new object constructed from the given +scheme+, +arguments+, + # and +default+: + # + # - The new object is an instance of URI.scheme_list[scheme.upcase]. + # - The object is initialized by calling the class initializer + # using +scheme+ and +arguments+. + # See URI::Generic.new. + # + # Examples: + # + # values = ['john.doe', 'www.example.com', '123', nil, '/forum/questions/', nil, 'tag=networking&order=newest', 'top'] + # URI.for('https', *values) + # # => # + # URI.for('foo', *values, default: URI::HTTP) + # # => # + # + # source://uri//lib/uri/common.rb#150 + def for(scheme, *arguments, default: T.unsafe(nil)); end + + # return encoding or nil + # http://encoding.spec.whatwg.org/#concept-encoding-get + # + # source://uri//lib/uri/common.rb#851 + def get_encoding(label); end + + # Merges the given URI strings +str+ + # per {RFC 2396}[https://www.rfc-editor.org/rfc/rfc2396.html]. + # + # Each string in +str+ is converted to an + # {RFC3986 URI}[https://www.rfc-editor.org/rfc/rfc3986.html] before being merged. + # + # Examples: + # + # URI.join("http://example.com/","main.rbx") + # # => # + # + # URI.join('http://example.com', 'foo') + # # => # + # + # URI.join('http://example.com', '/foo', '/bar') + # # => # + # + # URI.join('http://example.com', '/foo', 'bar') + # # => # + # + # URI.join('http://example.com', '/foo/', 'bar') + # # => # + # + # source://uri//lib/uri/common.rb#238 + def join(*str); end + + # Returns a new \URI object constructed from the given string +uri+: + # + # URI.parse('https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top') + # # => # + # URI.parse('http://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top') + # # => # + # + # It's recommended to first ::escape string +uri+ + # if it may contain invalid URI characters. + # + # source://uri//lib/uri/common.rb#211 + def parse(uri); end + + # Set the default parser instance. + # + # source://uri//lib/uri/common.rb#29 + def parser=(parser = T.unsafe(nil)); end + + # == Synopsis + # + # URI::regexp([match_schemes]) + # + # == Args + # + # +match_schemes+:: + # Array of schemes. If given, resulting regexp matches to URIs + # whose scheme is one of the match_schemes. + # + # == Description + # + # Returns a Regexp object which matches to URI-like strings. + # The Regexp object returned by this method includes arbitrary + # number of capture group (parentheses). Never rely on its number. + # + # == Usage + # + # require 'uri' + # + # # extract first URI from html_string + # html_string.slice(URI.regexp) + # + # # remove ftp URIs + # html_string.sub(URI.regexp(['ftp']), '') + # + # # You should not rely on the number of parentheses + # html_string.scan(URI.regexp) do |*matches| + # p $& + # end + # + # source://uri//lib/uri/common.rb#303 + def regexp(schemes = T.unsafe(nil)); end + + # Registers the given +klass+ as the class to be instantiated + # when parsing a \URI with the given +scheme+: + # + # URI.register_scheme('MS_SEARCH', URI::Generic) # => URI::Generic + # URI.scheme_list['MS_SEARCH'] # => URI::Generic + # + # Note that after calling String#upcase on +scheme+, it must be a valid + # constant name. + # + # source://uri//lib/uri/common.rb#106 + def register_scheme(scheme, klass); end + + # Returns a hash of the defined schemes: + # + # URI.scheme_list + # # => + # {"MAILTO"=>URI::MailTo, + # "LDAPS"=>URI::LDAPS, + # "WS"=>URI::WS, + # "HTTP"=>URI::HTTP, + # "HTTPS"=>URI::HTTPS, + # "LDAP"=>URI::LDAP, + # "FILE"=>URI::File, + # "FTP"=>URI::FTP} + # + # Related: URI.register_scheme. + # + # source://uri//lib/uri/common.rb#124 + def scheme_list; end + + # Returns a 9-element array representing the parts of the \URI + # formed from the string +uri+; + # each array element is a string or +nil+: + # + # names = %w[scheme userinfo host port registry path opaque query fragment] + # values = URI.split('https://john.doe@www.example.com:123/forum/questions/?tag=networking&order=newest#top') + # names.zip(values) + # # => + # [["scheme", "https"], + # ["userinfo", "john.doe"], + # ["host", "www.example.com"], + # ["port", "123"], + # ["registry", nil], + # ["path", "/forum/questions/"], + # ["opaque", nil], + # ["query", "tag=networking&order=newest"], + # ["fragment", "top"]] + # + # source://uri//lib/uri/common.rb#197 + def split(uri); end + + private + + # @raise [ArgumentError] + # + # source://uri//lib/uri/common.rb#424 + def _decode_uri_component(regexp, str, enc); end + + # source://uri//lib/uri/common.rb#410 + def _encode_uri_component(regexp, table, str, enc); end + end +end + +# FTP URI syntax is defined by RFC1738 section 3.2. +# +# This class will be redesigned because of difference of implementations; +# the structure of its path. draft-hoffman-ftp-uri-04 is a draft but it +# is a good summary about the de facto spec. +# https://datatracker.ietf.org/doc/html/draft-hoffman-ftp-uri-04 +# +# source://uri//lib/uri/ftp.rb#22 +class URI::FTP < ::URI::Generic + # == Description + # + # Creates a new URI::FTP object from generic URL components with no + # syntax checking. + # + # Unlike build(), this method does not escape the path component as + # required by RFC1738; instead it is treated as per RFC2396. + # + # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+, + # +opaque+, +query+, and +fragment+, in that order. + # + # @raise [InvalidURIError] + # @return [FTP] a new instance of FTP + # + # source://uri//lib/uri/ftp.rb#133 + def initialize(scheme, userinfo, host, port, registry, path, opaque, query, fragment, parser = T.unsafe(nil), arg_check = T.unsafe(nil)); end + + # source://uri//lib/uri/ftp.rb#214 + def merge(oth); end + + # Returns the path from an FTP URI. + # + # RFC 1738 specifically states that the path for an FTP URI does not + # include the / which separates the URI path from the URI host. Example: + # + # ftp://ftp.example.com/pub/ruby + # + # The above URI indicates that the client should connect to + # ftp.example.com then cd to pub/ruby from the initial login directory. + # + # If you want to cd to an absolute directory, you must include an + # escaped / (%2F) in the path. Example: + # + # ftp://ftp.example.com/%2Fpub/ruby + # + # This method will then return "/pub/ruby". + # + # source://uri//lib/uri/ftp.rb#240 + def path; end + + # Returns a String representation of the URI::FTP. + # + # source://uri//lib/uri/ftp.rb#251 + def to_s; end + + # typecode accessor. + # + # See URI::FTP::COMPONENT. + # + # source://uri//lib/uri/ftp.rb#161 + def typecode; end + + # == Args + # + # +v+:: + # String + # + # == Description + # + # Public setter for the typecode +v+ + # (with validation). + # + # See also URI::FTP.check_typecode. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("ftp://john@ftp.example.com/my_file.img") + # #=> # + # uri.typecode = "i" + # uri + # #=> # + # + # source://uri//lib/uri/ftp.rb#208 + def typecode=(typecode); end + + protected + + # Private setter for the path of the URI::FTP. + # + # source://uri//lib/uri/ftp.rb#245 + def set_path(v); end + + # Private setter for the typecode +v+. + # + # See also URI::FTP.typecode=. + # + # source://uri//lib/uri/ftp.rb#180 + def set_typecode(v); end + + private + + # Validates typecode +v+, + # returns +true+ or +false+. + # + # source://uri//lib/uri/ftp.rb#166 + def check_typecode(v); end + + class << self + # == Description + # + # Creates a new URI::FTP object from components, with syntax checking. + # + # The components accepted are +userinfo+, +host+, +port+, +path+, and + # +typecode+. + # + # The components should be provided either as an Array, or as a Hash + # with keys formed by preceding the component names with a colon. + # + # If an Array is used, the components must be passed in the + # order [userinfo, host, port, path, typecode]. + # + # If the path supplied is absolute, it will be escaped in order to + # make it absolute in the URI. + # + # Examples: + # + # require 'uri' + # + # uri1 = URI::FTP.build(['user:password', 'ftp.example.com', nil, + # '/path/file.zip', 'i']) + # uri1.to_s # => "ftp://user:password@ftp.example.com/%2Fpath/file.zip;type=i" + # + # uri2 = URI::FTP.build({:host => 'ftp.example.com', + # :path => 'ruby/src'}) + # uri2.to_s # => "ftp://ftp.example.com/ruby/src" + # + # source://uri//lib/uri/ftp.rb#96 + def build(args); end + + # source://uri//lib/uri/ftp.rb#47 + def new2(user, password, host, port, path, typecode = T.unsafe(nil), arg_check = T.unsafe(nil)); end + end +end + +# The "file" URI is defined by RFC8089. +# +# source://uri//lib/uri/file.rb#10 +class URI::File < ::URI::Generic + # raise InvalidURIError + # + # @raise [URI::InvalidURIError] + # + # source://uri//lib/uri/file.rb#82 + def check_password(user); end + + # raise InvalidURIError + # + # @raise [URI::InvalidURIError] + # + # source://uri//lib/uri/file.rb#77 + def check_user(user); end + + # raise InvalidURIError + # + # @raise [URI::InvalidURIError] + # + # source://uri//lib/uri/file.rb#72 + def check_userinfo(user); end + + # Protected setter for the host component +v+. + # + # See also URI::Generic.host=. + # + # source://uri//lib/uri/file.rb#62 + def set_host(v); end + + # do nothing + # + # source://uri//lib/uri/file.rb#95 + def set_password(v); end + + # do nothing + # + # source://uri//lib/uri/file.rb#68 + def set_port(v); end + + # do nothing + # + # source://uri//lib/uri/file.rb#91 + def set_user(v); end + + # do nothing + # + # source://uri//lib/uri/file.rb#87 + def set_userinfo(v); end + + class << self + # == Description + # + # Creates a new URI::File object from components, with syntax checking. + # + # The components accepted are +host+ and +path+. + # + # The components should be provided either as an Array, or as a Hash + # with keys formed by preceding the component names with a colon. + # + # If an Array is used, the components must be passed in the + # order [host, path]. + # + # A path from e.g. the File class should be escaped before + # being passed. + # + # Examples: + # + # require 'uri' + # + # uri1 = URI::File.build(['host.example.com', '/path/file.zip']) + # uri1.to_s # => "file://host.example.com/path/file.zip" + # + # uri2 = URI::File.build({:host => 'host.example.com', + # :path => '/ruby/src'}) + # uri2.to_s # => "file://host.example.com/ruby/src" + # + # uri3 = URI::File.build({:path => URI::escape('/path/my file.txt')}) + # uri3.to_s # => "file:///path/my%20file.txt" + # + # source://uri//lib/uri/file.rb#53 + def build(args); end + end +end + +# An Array of the available components for URI::File. +# +# source://uri//lib/uri/file.rb#17 +URI::File::COMPONENT = T.let(T.unsafe(nil), Array) + +# A Default port of nil for URI::File. +# +# source://uri//lib/uri/file.rb#12 +URI::File::DEFAULT_PORT = T.let(T.unsafe(nil), T.untyped) + +class URI::GID < ::URI::Generic + # source://uri//lib/uri/generic.rb#243 + def app; end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#107 + def deconstruct_keys(_keys); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#29 + def model_id; end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#29 + def model_name; end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#29 + def params; end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#102 + def to_s; end + + protected + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#118 + def query=(query); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#129 + def set_params(params); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#112 + def set_path(path); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#124 + def set_query(query); end + + private + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#136 + def check_host(host); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#141 + def check_path(path); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#146 + def check_scheme(scheme); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#195 + def parse_query_params(query); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#154 + def set_model_components(path, validate = T.unsafe(nil)); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#174 + def validate_component(component); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#188 + def validate_model_id(model_id_part); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#181 + def validate_model_id_section(model_id, model_name); end + + class << self + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#88 + def build(args); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#72 + def create(app, model, params = T.unsafe(nil)); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#64 + def parse(uri); end + + # source://globalid/1.2.1/lib/global_id/uri/gid.rb#48 + def validate_app(app); end + end +end + +# Base class for all URI classes. +# Implements generic URI syntax as per RFC 2396. +# +# source://uri//lib/uri/generic.rb#21 +class URI::Generic + include ::URI + + # == Args + # + # +scheme+:: + # Protocol scheme, i.e. 'http','ftp','mailto' and so on. + # +userinfo+:: + # User name and password, i.e. 'sdmitry:bla'. + # +host+:: + # Server host name. + # +port+:: + # Server port. + # +registry+:: + # Registry of naming authorities. + # +path+:: + # Path on server. + # +opaque+:: + # Opaque part. + # +query+:: + # Query data. + # +fragment+:: + # Part of the URI after '#' character. + # +parser+:: + # Parser for internal use [URI::DEFAULT_PARSER by default]. + # +arg_check+:: + # Check arguments [false by default]. + # + # == Description + # + # Creates a new URI::Generic instance from ``generic'' components without check. + # + # @return [Generic] a new instance of Generic + # + # source://uri//lib/uri/generic.rb#169 + def initialize(scheme, userinfo, host, port, registry, path, opaque, query, fragment, parser = T.unsafe(nil), arg_check = T.unsafe(nil)); end + + # == Args + # + # +oth+:: + # URI or String + # + # == Description + # + # Merges two URIs. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("http://my.example.com") + # uri.merge("/main.rbx?page=1") + # # => "http://my.example.com/main.rbx?page=1" + # merge + # + # source://uri//lib/uri/generic.rb#1109 + def +(oth); end + + # == Args + # + # +oth+:: + # URI or String + # + # == Description + # + # Calculates relative path from oth to self. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse('http://my.example.com/main.rbx?page=1') + # uri.route_from('http://my.example.com') + # #=> # + # + # source://uri//lib/uri/generic.rb#1261 + def -(oth); end + + # Compares two URIs. + # + # source://uri//lib/uri/generic.rb#1386 + def ==(oth); end + + # Returns true if URI has a scheme (e.g. http:// or https://) specified. + # + # @return [Boolean] + # + # source://uri//lib/uri/generic.rb#972 + def absolute; end + + # Returns true if URI has a scheme (e.g. http:// or https://) specified. + # + # @return [Boolean] + # + # source://uri//lib/uri/generic.rb#972 + def absolute?; end + + # == Args + # + # +v+:: + # URI or String + # + # == Description + # + # Attempts to parse other URI +oth+, + # returns [parsed_oth, self]. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("http://my.example.com") + # uri.coerce("http://foo.com") + # #=> [#, #] + # + # source://uri//lib/uri/generic.rb#1465 + def coerce(oth); end + + # Components of the URI in the order. + # + # source://uri//lib/uri/generic.rb#313 + def component; end + + # Returns the password component after URI decoding. + # + # source://uri//lib/uri/generic.rb#583 + def decoded_password; end + + # Returns the user component after URI decoding. + # + # source://uri//lib/uri/generic.rb#578 + def decoded_user; end + + # Returns default port. + # + # source://uri//lib/uri/generic.rb#39 + def default_port; end + + # Compares with _oth_ for Hash. + # + # @return [Boolean] + # + # source://uri//lib/uri/generic.rb#1400 + def eql?(oth); end + + # Returns a proxy URI. + # The proxy URI is obtained from environment variables such as http_proxy, + # ftp_proxy, no_proxy, etc. + # If there is no proper proxy, nil is returned. + # + # If the optional parameter +env+ is specified, it is used instead of ENV. + # + # Note that capitalized variables (HTTP_PROXY, FTP_PROXY, NO_PROXY, etc.) + # are examined, too. + # + # But http_proxy and HTTP_PROXY is treated specially under CGI environment. + # It's because HTTP_PROXY may be set by Proxy: header. + # So HTTP_PROXY is not used. + # http_proxy is not used too if the variable is case insensitive. + # CGI_HTTP_PROXY can be used instead. + # + # @raise [BadURIError] + # + # source://uri//lib/uri/generic.rb#1491 + def find_proxy(env = T.unsafe(nil)); end + + # Returns the fragment component of the URI. + # + # URI("http://foo/bar/baz?search=FooBar#ponies").fragment #=> "ponies" + # + # source://uri//lib/uri/generic.rb#283 + def fragment; end + + # Checks the fragment +v+ component against the URI::Parser Regexp for :FRAGMENT. + # + # + # == Args + # + # +v+:: + # String + # + # == Description + # + # Public setter for the fragment component +v+ + # (with validation). + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("http://my.example.com/?id=25#time=1305212049") + # uri.fragment = "time=1305212086" + # uri.to_s #=> "http://my.example.com/?id=25#time=1305212086" + # + # source://uri//lib/uri/generic.rb#929 + def fragment=(v); end + + # Returns the hash value. + # + # source://uri//lib/uri/generic.rb#1395 + def hash; end + + # Returns true if URI is hierarchical. + # + # == Description + # + # URI has components listed in order of decreasing significance from left to right, + # see RFC3986 https://www.rfc-editor.org/rfc/rfc3986 1.2.3. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("http://my.example.com/") + # uri.hierarchical? + # #=> true + # uri = URI.parse("mailto:joe@example.com") + # uri.hierarchical? + # #=> false + # + # @return [Boolean] + # + # source://uri//lib/uri/generic.rb#961 + def hierarchical?; end + + # Returns the host component of the URI. + # + # URI("http://foo/bar/baz").host #=> "foo" + # + # It returns nil if no host component exists. + # + # URI("mailto:foo@example.org").host #=> nil + # + # The component does not contain the port number. + # + # URI("http://foo:8080/bar/baz").host #=> "foo" + # + # Since IPv6 addresses are wrapped with brackets in URIs, + # this method returns IPv6 addresses wrapped with brackets. + # This form is not appropriate to pass to socket methods such as TCPSocket.open. + # If unwrapped host names are required, use the #hostname method. + # + # URI("http://[::1]/bar/baz").host #=> "[::1]" + # URI("http://[::1]/bar/baz").hostname #=> "::1" + # + # source://uri//lib/uri/generic.rb#243 + def host; end + + # == Args + # + # +v+:: + # String + # + # == Description + # + # Public setter for the host component +v+ + # (with validation). + # + # See also URI::Generic.check_host. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("http://my.example.com") + # uri.host = "foo.com" + # uri.to_s #=> "http://foo.com" + # + # source://uri//lib/uri/generic.rb#639 + def host=(v); end + + # Extract the host part of the URI and unwrap brackets for IPv6 addresses. + # + # This method is the same as URI::Generic#host except + # brackets for IPv6 (and future IP) addresses are removed. + # + # uri = URI("http://[::1]/bar") + # uri.hostname #=> "::1" + # uri.host #=> "[::1]" + # + # source://uri//lib/uri/generic.rb#654 + def hostname; end + + # Sets the host part of the URI as the argument with brackets for IPv6 addresses. + # + # This method is the same as URI::Generic#host= except + # the argument can be a bare IPv6 address. + # + # uri = URI("http://foo/bar") + # uri.hostname = "::1" + # uri.to_s #=> "http://[::1]/bar" + # + # If the argument seems to be an IPv6 address, + # it is wrapped with brackets. + # + # source://uri//lib/uri/generic.rb#671 + def hostname=(v); end + + # source://uri//lib/uri/generic.rb#1442 + def inspect; end + + # == Args + # + # +oth+:: + # URI or String + # + # == Description + # + # Merges two URIs. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("http://my.example.com") + # uri.merge("/main.rbx?page=1") + # # => "http://my.example.com/main.rbx?page=1" + # + # source://uri//lib/uri/generic.rb#1109 + def merge(oth); end + + # == Args + # + # +oth+:: + # URI or String + # + # == Description + # + # Destructive form of #merge. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("http://my.example.com") + # uri.merge!("/main.rbx?page=1") + # uri.to_s # => "http://my.example.com/main.rbx?page=1" + # + # source://uri//lib/uri/generic.rb#1081 + def merge!(oth); end + + # Returns normalized URI. + # + # require 'uri' + # + # URI("HTTP://my.EXAMPLE.com").normalize + # #=> # + # + # Normalization here means: + # + # * scheme and host are converted to lowercase, + # * an empty path component is set to "/". + # + # source://uri//lib/uri/generic.rb#1318 + def normalize; end + + # Destructive version of #normalize. + # + # source://uri//lib/uri/generic.rb#1327 + def normalize!; end + + # Returns the opaque part of the URI. + # + # URI("mailto:foo@example.org").opaque #=> "foo@example.org" + # URI("http://foo/bar/baz").opaque #=> nil + # + # The portion of the path that does not make use of the slash '/'. + # The path typically refers to an absolute path or an opaque part. + # (See RFC2396 Section 3 and 5.2.) + # + # source://uri//lib/uri/generic.rb#277 + def opaque; end + + # == Args + # + # +v+:: + # String + # + # == Description + # + # Public setter for the opaque component +v+ + # (with validation). + # + # See also URI::Generic.check_opaque. + # + # source://uri//lib/uri/generic.rb#901 + def opaque=(v); end + + # Returns the parser to be used. + # + # Unless a URI::Parser is defined, DEFAULT_PARSER is used. + # + # source://uri//lib/uri/generic.rb#289 + def parser; end + + # Returns the password component (without URI decoding). + # + # source://uri//lib/uri/generic.rb#573 + def password; end + + # == Args + # + # +v+:: + # String + # + # == Description + # + # Public setter for the +password+ component + # (with validation). + # + # See also URI::Generic.check_password. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("http://john:S3nsit1ve@my.example.com") + # uri.password = "V3ry_S3nsit1ve" + # uri.to_s #=> "http://john:V3ry_S3nsit1ve@my.example.com" + # + # source://uri//lib/uri/generic.rb#498 + def password=(password); end + + # Returns the path component of the URI. + # + # URI("http://foo/bar/baz").path #=> "/bar/baz" + # + # source://uri//lib/uri/generic.rb#260 + def path; end + + # == Args + # + # +v+:: + # String + # + # == Description + # + # Public setter for the path component +v+ + # (with validation). + # + # See also URI::Generic.check_path. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("http://my.example.com/pub/files") + # uri.path = "/faq/" + # uri.to_s #=> "http://my.example.com/faq/" + # + # source://uri//lib/uri/generic.rb#815 + def path=(v); end + + # Returns the port component of the URI. + # + # URI("http://foo/bar/baz").port #=> 80 + # URI("http://foo:8080/bar/baz").port #=> 8080 + # + # source://uri//lib/uri/generic.rb#250 + def port; end + + # == Args + # + # +v+:: + # String + # + # == Description + # + # Public setter for the port component +v+ + # (with validation). + # + # See also URI::Generic.check_port. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("http://my.example.com") + # uri.port = 8080 + # uri.to_s #=> "http://my.example.com:8080" + # + # source://uri//lib/uri/generic.rb#729 + def port=(v); end + + # Returns the query component of the URI. + # + # URI("http://foo/bar/baz?search=FooBar").query #=> "search=FooBar" + # + # source://uri//lib/uri/generic.rb#266 + def query; end + + # == Args + # + # +v+:: + # String + # + # == Description + # + # Public setter for the query component +v+. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("http://my.example.com/?id=25") + # uri.query = "id=1" + # uri.to_s #=> "http://my.example.com/?id=1" + # + # @raise [InvalidURIError] + # + # source://uri//lib/uri/generic.rb#839 + def query=(v); end + + # source://uri//lib/uri/generic.rb#252 + def registry; end + + # @raise [InvalidURIError] + # + # source://uri//lib/uri/generic.rb#745 + def registry=(v); end + + # Returns true if URI does not have a scheme (e.g. http:// or https://) specified. + # + # @return [Boolean] + # + # source://uri//lib/uri/generic.rb#984 + def relative?; end + + # == Args + # + # +oth+:: + # URI or String + # + # == Description + # + # Calculates relative path from oth to self. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse('http://my.example.com/main.rbx?page=1') + # uri.route_from('http://my.example.com') + # #=> # + # + # source://uri//lib/uri/generic.rb#1261 + def route_from(oth); end + + # == Args + # + # +oth+:: + # URI or String + # + # == Description + # + # Calculates relative path to oth from self. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse('http://my.example.com') + # uri.route_to('http://my.example.com/main.rbx?page=1') + # #=> # + # + # source://uri//lib/uri/generic.rb#1301 + def route_to(oth); end + + # Returns the scheme component of the URI. + # + # URI("http://foo/bar/baz").scheme #=> "http" + # + # source://uri//lib/uri/generic.rb#221 + def scheme; end + + # == Args + # + # +v+:: + # String + # + # == Description + # + # Public setter for the scheme component +v+ + # (with validation). + # + # See also URI::Generic.check_scheme. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("http://my.example.com") + # uri.scheme = "https" + # uri.to_s #=> "https://my.example.com" + # + # source://uri//lib/uri/generic.rb#360 + def scheme=(v); end + + # == Args + # + # +components+:: + # Multiple Symbol arguments defined in URI::HTTP. + # + # == Description + # + # Selects specified components from URI. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse('http://myuser:mypass@my.example.com/test.rbx') + # uri.select(:userinfo, :host, :path) + # # => ["myuser:mypass", "my.example.com", "/test.rbx"] + # + # source://uri//lib/uri/generic.rb#1431 + def select(*components); end + + # Constructs String from URI. + # + # source://uri//lib/uri/generic.rb#1342 + def to_s; end + + # Constructs String from URI. + # + # source://uri//lib/uri/generic.rb#1342 + def to_str; end + + # Returns the user component (without URI decoding). + # + # source://uri//lib/uri/generic.rb#568 + def user; end + + # == Args + # + # +v+:: + # String + # + # == Description + # + # Public setter for the +user+ component + # (with validation). + # + # See also URI::Generic.check_user. + # + # == Usage + # + # require 'uri' + # + # uri = URI.parse("http://john:S3nsit1ve@my.example.com") + # uri.user = "sam" + # uri.to_s #=> "http://sam:V3ry_S3nsit1ve@my.example.com" + # + # source://uri//lib/uri/generic.rb#471 + def user=(user); end + + # Returns the userinfo, either as 'user' or 'user:password'. + # + # source://uri//lib/uri/generic.rb#557 + def userinfo; end + + # Sets userinfo, argument is string like 'name:pass'. + # + # source://uri//lib/uri/generic.rb#441 + def userinfo=(userinfo); end + + protected + + # Returns an Array of the components defined from the COMPONENT Array. + # + # source://uri//lib/uri/generic.rb#1407 + def component_ary; end + + # Protected setter for the host component +v+. + # + # See also URI::Generic.host=. + # + # source://uri//lib/uri/generic.rb#613 + def set_host(v); end + + # Protected setter for the opaque component +v+. + # + # See also URI::Generic.opaque=. + # + # source://uri//lib/uri/generic.rb#883 + def set_opaque(v); end + + # Protected setter for the password component +v+. + # + # See also URI::Generic.password=. + # + # source://uri//lib/uri/generic.rb#534 + def set_password(v); end + + # Protected setter for the path component +v+. + # + # See also URI::Generic.path=. + # + # source://uri//lib/uri/generic.rb#789 + def set_path(v); end + + # Protected setter for the port component +v+. + # + # See also URI::Generic.port=. + # + # source://uri//lib/uri/generic.rb#702 + def set_port(v); end + + # @raise [InvalidURIError] + # + # source://uri//lib/uri/generic.rb#740 + def set_registry(v); end + + # Protected setter for the scheme component +v+. + # + # See also URI::Generic.scheme=. + # + # source://uri//lib/uri/generic.rb#334 + def set_scheme(v); end + + # Protected setter for the user component +v+. + # + # See also URI::Generic.user=. + # + # source://uri//lib/uri/generic.rb#524 + def set_user(v); end + + # Protected setter for the +user+ component, and +password+ if available + # (with validation). + # + # See also URI::Generic.userinfo=. + # + # source://uri//lib/uri/generic.rb#509 + def set_userinfo(user, password = T.unsafe(nil)); end + + private + + # Checks the host +v+ component for RFC2396 compliance + # and against the URI::Parser Regexp for :HOST. + # + # Can not have a registry or opaque component defined, + # with a host component defined. + # + # source://uri//lib/uri/generic.rb#594 + def check_host(v); end + + # Checks the opaque +v+ component for RFC2396 compliance and + # against the URI::Parser Regexp for :OPAQUE. + # + # Can not have a host, port, user, or path component defined, + # with an opaque component defined. + # + # source://uri//lib/uri/generic.rb#861 + def check_opaque(v); end + + # Checks the password +v+ component for RFC2396 compliance + # and against the URI::Parser Regexp for :USERINFO. + # + # Can not have a registry or opaque component defined, + # with a user component defined. + # + # source://uri//lib/uri/generic.rb#417 + def check_password(v, user = T.unsafe(nil)); end + + # Checks the path +v+ component for RFC2396 compliance + # and against the URI::Parser Regexp + # for :ABS_PATH and :REL_PATH. + # + # Can not have a opaque component defined, + # with a path component defined. + # + # source://uri//lib/uri/generic.rb#757 + def check_path(v); end + + # Checks the port +v+ component for RFC2396 compliance + # and against the URI::Parser Regexp for :PORT. + # + # Can not have a registry or opaque component defined, + # with a port component defined. + # + # source://uri//lib/uri/generic.rb#683 + def check_port(v); end + + # @raise [InvalidURIError] + # + # source://uri//lib/uri/generic.rb#735 + def check_registry(v); end + + # Checks the scheme +v+ component against the URI::Parser Regexp for :SCHEME. + # + # source://uri//lib/uri/generic.rb#320 + def check_scheme(v); end + + # Checks the user +v+ component for RFC2396 compliance + # and against the URI::Parser Regexp for :USERINFO. + # + # Can not have a registry or opaque component defined, + # with a user component defined. + # + # source://uri//lib/uri/generic.rb#393 + def check_user(v); end + + # Checks the +user+ and +password+. + # + # If +password+ is not provided, then +user+ is + # split, using URI::Generic.split_userinfo, to + # pull +user+ and +password. + # + # See also URI::Generic.check_user, URI::Generic.check_password. + # + # source://uri//lib/uri/generic.rb#375 + def check_userinfo(user, password = T.unsafe(nil)); end + + # Escapes 'user:password' +v+ based on RFC 1738 section 3.1. + # + # source://uri//lib/uri/generic.rb#551 + def escape_userpass(v); end + + # Merges a base path +base+, with relative path +rel+, + # returns a modified base path. + # + # source://uri//lib/uri/generic.rb#1000 + def merge_path(base, rel); end + + # Replaces self by other URI object. + # + # source://uri//lib/uri/generic.rb#299 + def replace!(oth); end + + # :stopdoc: + # + # source://uri//lib/uri/generic.rb#1193 + def route_from0(oth); end + + # :stopdoc: + # + # source://uri//lib/uri/generic.rb#1154 + def route_from_path(src, dst); end + + # Returns an Array of the path split on '/'. + # + # source://uri//lib/uri/generic.rb#991 + def split_path(path); end + + # Returns the userinfo +ui+ as [user, password] + # if properly formatted as 'user:password'. + # + # source://uri//lib/uri/generic.rb#542 + def split_userinfo(ui); end + + class << self + # == Synopsis + # + # See ::new. + # + # == Description + # + # Creates a new URI::Generic instance from components of URI::Generic + # with check. Components are: scheme, userinfo, host, port, registry, path, + # opaque, query, and fragment. You can provide arguments either by an Array or a Hash. + # See ::new for hash keys to use or for order of array items. + # + # source://uri//lib/uri/generic.rb#116 + def build(args); end + + # == Synopsis + # + # See ::new. + # + # == Description + # + # At first, tries to create a new URI::Generic instance using + # URI::Generic::build. But, if exception URI::InvalidComponentError is raised, + # then it does URI::Escape.escape all URI components and tries again. + # + # source://uri//lib/uri/generic.rb#78 + def build2(args); end + + # Components of the URI in the order. + # + # source://uri//lib/uri/generic.rb#57 + def component; end + + # Returns default port. + # + # source://uri//lib/uri/generic.rb#32 + def default_port; end + + # @return [Boolean] + # + # source://uri//lib/uri/generic.rb#1557 + def use_proxy?(hostname, addr, port, no_proxy); end + + # source://uri//lib/uri/generic.rb#63 + def use_registry; end + end +end + +# The syntax of HTTP URIs is defined in RFC1738 section 3.3. +# +# Note that the Ruby URI library allows HTTP URLs containing usernames and +# passwords. This is not legal as per the RFC, but used to be +# supported in Internet Explorer 5 and 6, before the MS04-004 security +# update. See . +# +# source://uri//lib/uri/http.rb#22 +class URI::HTTP < ::URI::Generic + # == Description + # + # Returns the authority for an HTTP uri, as defined in + # https://www.rfc-editor.org/rfc/rfc3986#section-3.2. + # + # + # Example: + # + # URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').authority #=> "www.example.com" + # URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').authority #=> "www.example.com:8000" + # URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').authority #=> "www.example.com" + # + # source://uri//lib/uri/http.rb#97 + def authority; end + + # == Description + # + # Returns the origin for an HTTP uri, as defined in + # https://www.rfc-editor.org/rfc/rfc6454. + # + # + # Example: + # + # URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').origin #=> "http://www.example.com" + # URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').origin #=> "http://www.example.com:8000" + # URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').origin #=> "http://www.example.com" + # URI::HTTPS.build(host: 'www.example.com', path: '/foo/bar').origin #=> "https://www.example.com" + # + # source://uri//lib/uri/http.rb#119 + def origin; end + + # == Description + # + # Returns the full path for an HTTP request, as required by Net::HTTP::Get. + # + # If the URI contains a query, the full path is URI#path + '?' + URI#query. + # Otherwise, the path is simply URI#path. + # + # Example: + # + # uri = URI::HTTP.build(path: '/foo/bar', query: 'test=true') + # uri.request_uri # => "/foo/bar?test=true" + # + # source://uri//lib/uri/http.rb#77 + def request_uri; end + + class << self + # == Description + # + # Creates a new URI::HTTP object from components, with syntax checking. + # + # The components accepted are userinfo, host, port, path, query, and + # fragment. + # + # The components should be provided either as an Array, or as a Hash + # with keys formed by preceding the component names with a colon. + # + # If an Array is used, the components must be passed in the + # order [userinfo, host, port, path, query, fragment]. + # + # Example: + # + # uri = URI::HTTP.build(host: 'www.example.com', path: '/foo/bar') + # + # uri = URI::HTTP.build([nil, "www.example.com", nil, "/path", + # "query", 'fragment']) + # + # Currently, if passed userinfo components this method generates + # invalid HTTP URIs as per RFC 1738. + # + # source://uri//lib/uri/http.rb#59 + def build(args); end + end +end + +# source://uri//lib/uri/common.rb#130 +URI::INITIAL_SCHEMES = T.let(T.unsafe(nil), Hash) + +# LDAP URI SCHEMA (described in RFC2255). +# -- +# ldap:///[?[?[?[?]]]] +# ++ +# +# source://uri//lib/uri/ldap.rb#23 +class URI::LDAP < ::URI::Generic + # == Description + # + # Creates a new URI::LDAP object from generic URI components as per + # RFC 2396. No LDAP-specific syntax checking is performed. + # + # Arguments are +scheme+, +userinfo+, +host+, +port+, +registry+, +path+, + # +opaque+, +query+, and +fragment+, in that order. + # + # Example: + # + # uri = URI::LDAP.new("ldap", nil, "ldap.example.com", nil, nil, + # "/dc=example;dc=com", nil, "query", nil) + # + # See also URI::Generic.new. + # + # @return [LDAP] a new instance of LDAP + # + # source://uri//lib/uri/ldap.rb#108 + def initialize(*arg); end + + # Returns attributes. + # + # source://uri//lib/uri/ldap.rb#178 + def attributes; end + + # Setter for attributes +val+. + # + # source://uri//lib/uri/ldap.rb#191 + def attributes=(val); end + + # Returns dn. + # + # source://uri//lib/uri/ldap.rb#159 + def dn; end + + # Setter for dn +val+. + # + # source://uri//lib/uri/ldap.rb#172 + def dn=(val); end + + # Returns extensions. + # + # source://uri//lib/uri/ldap.rb#235 + def extensions; end + + # Setter for extensions +val+. + # + # source://uri//lib/uri/ldap.rb#248 + def extensions=(val); end + + # Returns filter. + # + # source://uri//lib/uri/ldap.rb#216 + def filter; end + + # Setter for filter +val+. + # + # source://uri//lib/uri/ldap.rb#229 + def filter=(val); end + + # Checks if URI has a path. + # For URI::LDAP this will return +false+. + # + # @return [Boolean] + # + # source://uri//lib/uri/ldap.rb#255 + def hierarchical?; end + + # Returns scope. + # + # source://uri//lib/uri/ldap.rb#197 + def scope; end + + # Setter for scope +val+. + # + # source://uri//lib/uri/ldap.rb#210 + def scope=(val); end + + protected + + # Private setter for attributes +val+. + # + # source://uri//lib/uri/ldap.rb#183 + def set_attributes(val); end + + # Private setter for dn +val+. + # + # source://uri//lib/uri/ldap.rb#164 + def set_dn(val); end + + # Private setter for extensions +val+. + # + # source://uri//lib/uri/ldap.rb#240 + def set_extensions(val); end + + # Private setter for filter +val+. + # + # source://uri//lib/uri/ldap.rb#221 + def set_filter(val); end + + # Private setter for scope +val+. + # + # source://uri//lib/uri/ldap.rb#202 + def set_scope(val); end + + private + + # Private method to assemble +query+ from +attributes+, +scope+, +filter+, and +extensions+. + # + # source://uri//lib/uri/ldap.rb#146 + def build_path_query; end + + # Private method to cleanup +dn+ from using the +path+ component attribute. + # + # @raise [InvalidURIError] + # + # source://uri//lib/uri/ldap.rb#120 + def parse_dn; end + + # Private method to cleanup +attributes+, +scope+, +filter+, and +extensions+ + # from using the +query+ component attribute. + # + # source://uri//lib/uri/ldap.rb#128 + def parse_query; end + + class << self + # == Description + # + # Creates a new URI::LDAP object from components, with syntax checking. + # + # The components accepted are host, port, dn, attributes, + # scope, filter, and extensions. + # + # The components should be provided either as an Array, or as a Hash + # with keys formed by preceding the component names with a colon. + # + # If an Array is used, the components must be passed in the + # order [host, port, dn, attributes, scope, filter, extensions]. + # + # Example: + # + # uri = URI::LDAP.build({:host => 'ldap.example.com', + # :dn => '/dc=example'}) + # + # uri = URI::LDAP.build(["ldap.example.com", nil, + # "/dc=example;dc=com", "query", nil, nil, nil]) + # + # source://uri//lib/uri/ldap.rb#74 + def build(args); end + end +end + +# RFC6068, the mailto URL scheme. +# +# source://uri//lib/uri/mailto.rb#17 +class URI::MailTo < ::URI::Generic + include ::URI::RFC2396_REGEXP + + # == Description + # + # Creates a new URI::MailTo object from generic URL components with + # no syntax checking. + # + # This method is usually called from URI::parse, which checks + # the validity of each component. + # + # @return [MailTo] a new instance of MailTo + # + # source://uri//lib/uri/mailto.rb#132 + def initialize(*arg); end + + # E-mail headers set by the URL, as an Array of Arrays. + # + # source://uri//lib/uri/mailto.rb#166 + def headers; end + + # Setter for headers +v+. + # + # source://uri//lib/uri/mailto.rb#232 + def headers=(v); end + + # The primary e-mail address of the URL, as a String. + # + # source://uri//lib/uri/mailto.rb#163 + def to; end + + # Setter for to +v+. + # + # source://uri//lib/uri/mailto.rb#200 + def to=(v); end + + # Returns the RFC822 e-mail text equivalent of the URL, as a String. + # + # Example: + # + # require 'uri' + # + # uri = URI.parse("mailto:ruby-list@ruby-lang.org?Subject=subscribe&cc=myaddr") + # uri.to_mailtext + # # => "To: ruby-list@ruby-lang.org\nSubject: subscribe\nCc: myaddr\n\n\n" + # + # source://uri//lib/uri/mailto.rb#268 + def to_mailtext; end + + # Returns the RFC822 e-mail text equivalent of the URL, as a String. + # + # Example: + # + # require 'uri' + # + # uri = URI.parse("mailto:ruby-list@ruby-lang.org?Subject=subscribe&cc=myaddr") + # uri.to_mailtext + # # => "To: ruby-list@ruby-lang.org\nSubject: subscribe\nCc: myaddr\n\n\n" + # + # source://uri//lib/uri/mailto.rb#268 + def to_rfc822text; end + + # Constructs String from URI. + # + # source://uri//lib/uri/mailto.rb#239 + def to_s; end + + protected + + # Private setter for headers +v+. + # + # source://uri//lib/uri/mailto.rb#221 + def set_headers(v); end + + # Private setter for to +v+. + # + # source://uri//lib/uri/mailto.rb#194 + def set_to(v); end + + private + + # Checks the headers +v+ component against either + # * HEADER_REGEXP + # + # source://uri//lib/uri/mailto.rb#208 + def check_headers(v); end + + # Checks the to +v+ component. + # + # source://uri//lib/uri/mailto.rb#169 + def check_to(v); end + + class << self + # == Description + # + # Creates a new URI::MailTo object from components, with syntax checking. + # + # Components can be provided as an Array or Hash. If an Array is used, + # the components must be supplied as [to, headers]. + # + # If a Hash is used, the keys are the component names preceded by colons. + # + # The headers can be supplied as a pre-encoded string, such as + # "subject=subscribe&cc=address", or as an Array of Arrays + # like [['subject', 'subscribe'], ['cc', 'address']]. + # + # Examples: + # + # require 'uri' + # + # m1 = URI::MailTo.build(['joe@example.com', 'subject=Ruby']) + # m1.to_s # => "mailto:joe@example.com?subject=Ruby" + # + # m2 = URI::MailTo.build(['john@example.com', [['Subject', 'Ruby'], ['Cc', 'jack@example.com']]]) + # m2.to_s # => "mailto:john@example.com?Subject=Ruby&Cc=jack@example.com" + # + # m3 = URI::MailTo.build({:to => 'listman@example.com', :headers => [['subject', 'subscribe']]}) + # m3.to_s # => "mailto:listman@example.com?subject=subscribe" + # + # source://uri//lib/uri/mailto.rb#85 + def build(args); end + end +end + +# Class that parses String's into URI's. +# +# It contains a Hash set of patterns and Regexp's that match and validate. +# +# source://uri//lib/uri/rfc2396_parser.rb#64 +class URI::RFC2396_Parser + include ::URI::RFC2396_REGEXP + + # == Synopsis + # + # URI::Parser.new([opts]) + # + # == Args + # + # The constructor accepts a hash as options for parser. + # Keys of options are pattern names of URI components + # and values of options are pattern strings. + # The constructor generates set of regexps for parsing URIs. + # + # You can use the following keys: + # + # * :ESCAPED (URI::PATTERN::ESCAPED in default) + # * :UNRESERVED (URI::PATTERN::UNRESERVED in default) + # * :DOMLABEL (URI::PATTERN::DOMLABEL in default) + # * :TOPLABEL (URI::PATTERN::TOPLABEL in default) + # * :HOSTNAME (URI::PATTERN::HOSTNAME in default) + # + # == Examples + # + # p = URI::Parser.new(:ESCAPED => "(?:%[a-fA-F0-9]{2}|%u[a-fA-F0-9]{4})") + # u = p.parse("http://example.jp/%uABCD") #=> # + # URI.parse(u.to_s) #=> raises URI::InvalidURIError + # + # s = "http://example.com/ABCD" + # u1 = p.parse(s) #=> # + # u2 = URI.parse(s) #=> # + # u1 == u2 #=> true + # u1.eql?(u2) #=> false + # + # @return [RFC2396_Parser] a new instance of RFC2396_Parser + # + # source://uri//lib/uri/rfc2396_parser.rb#99 + def initialize(opts = T.unsafe(nil)); end + + # :call-seq: + # escape( str ) + # escape( str, unsafe ) + # + # == Args + # + # +str+:: + # String to make safe + # +unsafe+:: + # Regexp to apply. Defaults to +self.regexp[:UNSAFE]+ + # + # == Description + # + # Constructs a safe String from +str+, removing unsafe characters, + # replacing them with codes. + # + # source://uri//lib/uri/rfc2396_parser.rb#287 + def escape(str, unsafe = T.unsafe(nil)); end + + # :call-seq: + # extract( str ) + # extract( str, schemes ) + # extract( str, schemes ) {|item| block } + # + # == Args + # + # +str+:: + # String to search + # +schemes+:: + # Patterns to apply to +str+ + # + # == Description + # + # Attempts to parse and merge a set of URIs. + # If no +block+ given, then returns the result, + # else it calls +block+ for each element in result. + # + # See also URI::Parser.make_regexp. + # + # source://uri//lib/uri/rfc2396_parser.rb#249 + def extract(str, schemes = T.unsafe(nil)); end + + # source://uri//lib/uri/rfc2396_parser.rb#326 + def inspect; end + + # == Args + # + # +uris+:: + # an Array of Strings + # + # == Description + # + # Attempts to parse and merge a set of URIs. + # + # source://uri//lib/uri/rfc2396_parser.rb#223 + def join(*uris); end + + # Returns Regexp that is default +self.regexp[:ABS_URI_REF]+, + # unless +schemes+ is provided. Then it is a Regexp.union with +self.pattern[:X_ABS_URI]+. + # + # source://uri//lib/uri/rfc2396_parser.rb#262 + def make_regexp(schemes = T.unsafe(nil)); end + + # == Args + # + # +uri+:: + # String + # + # == Description + # + # Parses +uri+ and constructs either matching URI scheme object + # (File, FTP, HTTP, HTTPS, LDAP, LDAPS, or MailTo) or URI::Generic. + # + # == Usage + # + # p = URI::Parser.new + # p.parse("ldap://ldap.example.com/dc=example?user=john") + # #=> # + # + # source://uri//lib/uri/rfc2396_parser.rb#209 + def parse(uri); end + + # The Hash of patterns. + # + # See also URI::Parser.initialize_pattern. + # + # source://uri//lib/uri/rfc2396_parser.rb#112 + def pattern; end + + # The Hash of Regexp. + # + # See also URI::Parser.initialize_regexp. + # + # source://uri//lib/uri/rfc2396_parser.rb#117 + def regexp; end + + # Returns a split URI against +regexp[:ABS_URI]+. + # + # source://uri//lib/uri/rfc2396_parser.rb#120 + def split(uri); end + + # :call-seq: + # unescape( str ) + # unescape( str, escaped ) + # + # == Args + # + # +str+:: + # String to remove escapes from + # +escaped+:: + # Regexp to apply. Defaults to +self.regexp[:ESCAPED]+ + # + # == Description + # + # Removes escapes from +str+. + # + # source://uri//lib/uri/rfc2396_parser.rb#318 + def unescape(str, escaped = T.unsafe(nil)); end + + private + + # source://uri//lib/uri/rfc2396_parser.rb#527 + def convert_to_uri(uri); end + + # Constructs the default Hash of patterns. + # + # source://uri//lib/uri/rfc2396_parser.rb#338 + def initialize_pattern(opts = T.unsafe(nil)); end + + # Constructs the default Hash of Regexp's. + # + # source://uri//lib/uri/rfc2396_parser.rb#496 + def initialize_regexp(pattern); end +end + +# source://uri//lib/uri/rfc2396_parser.rb#324 +URI::RFC2396_Parser::TO_S = T.let(T.unsafe(nil), UnboundMethod) + +# source://uri//lib/uri/rfc3986_parser.rb#3 +class URI::RFC3986_Parser + # @return [RFC3986_Parser] a new instance of RFC3986_Parser + # + # source://uri//lib/uri/rfc3986_parser.rb#73 + def initialize; end + + # Compatibility for RFC2396 parser + # + # source://uri//lib/uri/rfc3986_parser.rb#156 + def escape(str, unsafe = T.unsafe(nil)); end + + # Compatibility for RFC2396 parser + # + # source://uri//lib/uri/rfc3986_parser.rb#144 + def extract(str, schemes = T.unsafe(nil), &block); end + + # source://uri//lib/uri/rfc3986_parser.rb#169 + def inspect; end + + # source://uri//lib/uri/rfc3986_parser.rb#138 + def join(*uris); end + + # Compatibility for RFC2396 parser + # + # source://uri//lib/uri/rfc3986_parser.rb#150 + def make_regexp(schemes = T.unsafe(nil)); end + + # source://uri//lib/uri/rfc3986_parser.rb#134 + def parse(uri); end + + # Returns the value of attribute regexp. + # + # source://uri//lib/uri/rfc3986_parser.rb#71 + def regexp; end + + # source://uri//lib/uri/rfc3986_parser.rb#77 + def split(uri); end + + # Compatibility for RFC2396 parser + # + # source://uri//lib/uri/rfc3986_parser.rb#162 + def unescape(str, escaped = T.unsafe(nil)); end + + private + + # source://uri//lib/uri/rfc3986_parser.rb#194 + def convert_to_uri(uri); end + + # source://uri//lib/uri/rfc3986_parser.rb#180 + def default_regexp; end +end + +# source://uri//lib/uri/rfc3986_parser.rb#33 +URI::RFC3986_Parser::FRAGMENT = T.let(T.unsafe(nil), String) + +# URI defined in RFC3986 +# +# source://uri//lib/uri/rfc3986_parser.rb#5 +URI::RFC3986_Parser::HOST = T.let(T.unsafe(nil), Regexp) + +# source://uri//lib/uri/rfc3986_parser.rb#54 +URI::RFC3986_Parser::RFC3986_relative_ref = T.let(T.unsafe(nil), Regexp) + +# source://uri//lib/uri/rfc3986_parser.rb#30 +URI::RFC3986_Parser::SCHEME = T.let(T.unsafe(nil), String) + +# source://uri//lib/uri/rfc3986_parser.rb#31 +URI::RFC3986_Parser::SEG = T.let(T.unsafe(nil), String) + +# source://uri//lib/uri/rfc3986_parser.rb#32 +URI::RFC3986_Parser::SEG_NC = T.let(T.unsafe(nil), String) + +# source://uri//lib/uri/rfc3986_parser.rb#28 +URI::RFC3986_Parser::USERINFO = T.let(T.unsafe(nil), Regexp) + +# source://uri//lib/uri/common.rb#94 +module URI::Schemes; end + +# source://uri//lib/uri/common.rb#107 +URI::Schemes::FILE = URI::File + +# source://uri//lib/uri/common.rb#107 +URI::Schemes::FTP = URI::FTP + +# source://uri//lib/uri/common.rb#107 +URI::Schemes::GID = URI::GID + +# source://uri//lib/uri/common.rb#107 +URI::Schemes::HTTP = URI::HTTP + +# source://uri//lib/uri/common.rb#107 +URI::Schemes::HTTPS = URI::HTTPS + +# source://uri//lib/uri/common.rb#107 +URI::Schemes::LDAP = URI::LDAP + +# source://uri//lib/uri/common.rb#107 +URI::Schemes::LDAPS = URI::LDAPS + +# source://uri//lib/uri/common.rb#107 +URI::Schemes::MAILTO = URI::MailTo + +# source://uri//lib/uri/common.rb#107 +URI::Schemes::SOURCE = URI::Source + +# source://uri//lib/uri/common.rb#107 +URI::Schemes::WS = URI::WS + +# source://uri//lib/uri/common.rb#107 +URI::Schemes::WSS = URI::WSS + +# source://uri//lib/uri/common.rb#312 +URI::TBLENCURICOMP_ = T.let(T.unsafe(nil), Hash) + +# source://uri//lib/uri/common.rb#62 +module URI::Util + private + + # source://uri//lib/uri/common.rb#63 + def make_components_hash(klass, array_hash); end + + class << self + # source://uri//lib/uri/common.rb#63 + def make_components_hash(klass, array_hash); end + end +end + +# The syntax of WS URIs is defined in RFC6455 section 3. +# +# Note that the Ruby URI library allows WS URLs containing usernames and +# passwords. This is not legal as per the RFC, but used to be +# supported in Internet Explorer 5 and 6, before the MS04-004 security +# update. See . +# +# source://uri//lib/uri/ws.rb#22 +class URI::WS < ::URI::Generic + # == Description + # + # Returns the full path for a WS URI, as required by Net::HTTP::Get. + # + # If the URI contains a query, the full path is URI#path + '?' + URI#query. + # Otherwise, the path is simply URI#path. + # + # Example: + # + # uri = URI::WS.build(path: '/foo/bar', query: 'test=true') + # uri.request_uri # => "/foo/bar?test=true" + # + # source://uri//lib/uri/ws.rb#74 + def request_uri; end + + class << self + # == Description + # + # Creates a new URI::WS object from components, with syntax checking. + # + # The components accepted are userinfo, host, port, path, and query. + # + # The components should be provided either as an Array, or as a Hash + # with keys formed by preceding the component names with a colon. + # + # If an Array is used, the components must be passed in the + # order [userinfo, host, port, path, query]. + # + # Example: + # + # uri = URI::WS.build(host: 'www.example.com', path: '/foo/bar') + # + # uri = URI::WS.build([nil, "www.example.com", nil, "/path", "query"]) + # + # Currently, if passed userinfo components this method generates + # invalid WS URIs as per RFC 1738. + # + # source://uri//lib/uri/ws.rb#56 + def build(args); end + end +end + +# The default port for WSS URIs is 443, and the scheme is 'wss:' rather +# than 'ws:'. Other than that, WSS URIs are identical to WS URIs; +# see URI::WS. +# +# source://uri//lib/uri/wss.rb#17 +class URI::WSS < ::URI::WS; end + +# A Default port of 443 for URI::WSS +# +# source://uri//lib/uri/wss.rb#19 +URI::WSS::DEFAULT_PORT = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/todo.rbi b/sorbet/rbi/todo.rbi index 5f430ec9..583cc8a3 100644 --- a/sorbet/rbi/todo.rbi +++ b/sorbet/rbi/todo.rbi @@ -6,6 +6,17 @@ module ::MakeMakefile; end module ::Spring; end +module Dry::Core::Cache; end +module Dry::Core::Cache::Methods; end +module Dry::Core::ClassAttributes; end +module Dry::Core::Constants; end +module Dry::Core::Container::Configuration; end +module Dry::Core::Container::Mixin; end +module Dry::Core::Container::Mixin::Initializer; end +module Dry::Core::Deprecations::Interface; end +module Dry::Core::Equalizer::Methods; end +module Dry::Core::Extensions; end +module Dry::Inflector; end module SyntaxTree::Haml; end module SyntaxTree::Haml::Format::Formatter; end module SyntaxTree::RBS; end diff --git a/sorbet/tapioca/require.rb b/sorbet/tapioca/require.rb index aea493f6..8fda5305 100644 --- a/sorbet/tapioca/require.rb +++ b/sorbet/tapioca/require.rb @@ -28,6 +28,11 @@ require "sorbet-runtime" require "syntax_tree" require "timeout" require "rake/dsl_definition" +require "dry-types" +require "dry-struct" +require "dry/core" +require "dry/types" +require "telegram/bot" require "prometheus_exporter/client" require "prometheus_exporter/metric"