diff --git a/.dockerignore b/.dockerignore index 5e64996..ef8423a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,4 +4,5 @@ .gitignore .rubocop.yml deployment/ +sorbet/ state.json diff --git a/.github/scripts/tapioca-exclude-check.rb b/.github/scripts/tapioca-exclude-check.rb new file mode 100755 index 0000000..abad0f8 --- /dev/null +++ b/.github/scripts/tapioca-exclude-check.rb @@ -0,0 +1,42 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require "bundler" +require "psych" + +RBI_ALLOWLIST = %w[ + addressable + faraday + jwt + octokit + rack-session + rack + sinatra +].freeze + +tapioca_config = Psych.safe_load_file("sorbet/tapioca/config.yml") +tapioca_excludes = tapioca_config.dig("gem", "exclude") + +gem_names = Bundler.locked_gems.specs.map(&:name).uniq +gem_names.reject! { |name| name.match?(/\Asorbet(?:-(?:static(?:-.*)?|runtime))?\z/) } # Implicitly excluded + +allowed_and_excluded = RBI_ALLOWLIST & tapioca_excludes +unless allowed_and_excluded.empty? + $stderr.puts "Tapioca excludes contains gems in the allowlist!" + $stderr.puts "Gems affected: #{allowed_and_excluded.join(", ")}" + exit(1) +end + +new_gems = gem_names - tapioca_excludes - RBI_ALLOWLIST +unless new_gems.empty? + $stderr.puts "New gems were added that may need to be added to the Tapioca exclude list." + $stderr.puts "Gems affected: #{new_gems.join(", ")}" + exit(1) +end + +extra_excludes = tapioca_excludes - gem_names +unless new_gems.empty? + $stderr.puts "Tapioca exclude list contains gems that are not in the Gemfile.lock" + $stderr.puts "Gems affected: #{extra_excludes.join(", ")}" + exit(1) +end diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cea7874..b485d40 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,6 +26,15 @@ jobs: with: bundler-cache: true + - name: Check Tapioca excludes + run: bundle exec ./.github/scripts/tapioca-exclude-check.rb + + - name: Check RBI shims + run: bundle exec tapioca check-shims + + - name: Run Sorbet typecheck + run: bundle exec srb tc + - name: Run RuboCop run: bundle exec rubocop diff --git a/.rubocop.yml b/.rubocop.yml index fb57e3f..ac22742 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,9 +1,15 @@ require: - rubocop-performance + - rubocop-sorbet AllCops: TargetRubyVersion: 3.3 NewCops: enable + inherit_mode: + merge: + - Include + Include: + - .*/*.rb Layout/CaseIndentation: EnforcedStyle: end @@ -45,6 +51,24 @@ Metrics/MethodLength: Metrics/ParameterLists: CountKeywordArgs: false +# Incompatible with Sorbet +Naming/BlockForwarding: + Enabled: false + +Sorbet/FalseSigil: + Enabled: false +Sorbet/StrictSigil: + Enabled: true + Include: + - src/server.rb + - src/github_client.rb +Sorbet/StrongSigil: + Enabled: true + Exclude: + - src/server.rb + - src/github_client.rb + - src/octokit/*.rb + Style/AndOr: EnforcedStyle: always diff --git a/Gemfile b/Gemfile index 1cab8fa..9923a12 100644 --- a/Gemfile +++ b/Gemfile @@ -11,8 +11,12 @@ gem "orka_api_client", git: "https://github.com/Homebrew/orka_api_client" gem "puma" gem "rackup" gem "sinatra" +gem "sorbet-runtime" group :development, optional: true do gem "rubocop" gem "rubocop-performance" + gem "rubocop-sorbet" + gem "sorbet-static-and-runtime" + gem "tapioca" end diff --git a/Gemfile.lock b/Gemfile.lock index 9b85b8a..79f5184 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,6 +13,7 @@ GEM public_suffix (>= 2.0.2, < 7.0) ast (2.4.2) base64 (0.2.0) + erubi (1.13.0) faraday (2.12.0) faraday-net_http (>= 2.0, < 3.4) json @@ -33,6 +34,7 @@ GEM ruby2_keywords (~> 0.0.1) net-http (0.4.1) uri + netrc (0.11.0) nio4r (2.7.3) octokit (9.1.0) faraday (>= 1, < 3) @@ -41,6 +43,7 @@ GEM parser (3.3.5.0) ast (~> 2.4.1) racc + prism (1.0.0) public_suffix (6.0.1) puma (6.4.3) nio4r (~> 2.0) @@ -55,6 +58,9 @@ GEM rack (>= 3) webrick (~> 1.8) rainbow (3.1.1) + rbi (0.2.0) + prism (~> 1.0) + sorbet-runtime (>= 0.5.9204) regexp_parser (2.9.2) rubocop (1.66.1) json (~> 2.3) @@ -71,6 +77,8 @@ GEM rubocop-performance (1.22.1) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) + rubocop-sorbet (0.8.5) + rubocop (>= 1) ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) sawyer (0.9.2) @@ -82,13 +90,44 @@ GEM rack-protection (= 4.0.0) rack-session (>= 2.0.0, < 3) tilt (~> 2.0) + sorbet (0.5.11581) + sorbet-static (= 0.5.11581) + sorbet-runtime (0.5.11581) + sorbet-static (0.5.11581-aarch64-linux) + sorbet-static (0.5.11581-universal-darwin) + sorbet-static (0.5.11581-x86_64-linux) + sorbet-static-and-runtime (0.5.11581) + sorbet (= 0.5.11581) + sorbet-runtime (= 0.5.11581) + spoom (1.4.2) + erubi (>= 1.10.0) + prism (>= 0.28.0) + sorbet-static-and-runtime (>= 0.5.10187) + thor (>= 0.19.2) + tapioca (0.16.2) + bundler (>= 2.2.25) + netrc (>= 0.11.0) + parallel (>= 1.21.0) + rbi (~> 0.2) + sorbet-static-and-runtime (>= 0.5.11087) + spoom (>= 1.2.0) + thor (>= 1.2.0) + yard-sorbet + thor (1.3.2) tilt (2.4.0) unicode-display_width (2.6.0) uri (0.13.1) webrick (1.8.2) + yard (0.9.37) + yard-sorbet (0.9.0) + sorbet-runtime + yard PLATFORMS - ruby + aarch64-linux + arm64-darwin + x86_64-darwin + x86_64-linux DEPENDENCIES faraday-retry @@ -99,7 +138,11 @@ DEPENDENCIES rackup rubocop rubocop-performance + rubocop-sorbet sinatra + sorbet-runtime + sorbet-static-and-runtime + tapioca RUBY VERSION ruby 3.3.4p94 diff --git a/sorbet/config b/sorbet/config new file mode 100644 index 0000000..c2ad709 --- /dev/null +++ b/sorbet/config @@ -0,0 +1,3 @@ +--dir=. +--allowed-extension=.rb,.rbi,.ru +--ignore=tmp/,vendor/ diff --git a/sorbet/rbi/annotations/.gitattributes b/sorbet/rbi/annotations/.gitattributes new file mode 100644 index 0000000..d2eacd2 --- /dev/null +++ b/sorbet/rbi/annotations/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-vendored=true diff --git a/sorbet/rbi/annotations/faraday.rbi b/sorbet/rbi/annotations/faraday.rbi new file mode 100644 index 0000000..c992c1a --- /dev/null +++ b/sorbet/rbi/annotations/faraday.rbi @@ -0,0 +1,17 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module Faraday + class << self + sig { params(url: T.untyped, options: T::Hash[Symbol, T.untyped], block: T.nilable(T.proc.params(connection: Faraday::Connection).void)).returns(Faraday::Connection) } + def new(url = nil, options = {}, &block); end + end +end + +class Faraday::Response + sig { returns(T::Boolean) } + def success?; end +end diff --git a/sorbet/rbi/annotations/rainbow.rbi b/sorbet/rbi/annotations/rainbow.rbi new file mode 100644 index 0000000..0d2cb4e --- /dev/null +++ b/sorbet/rbi/annotations/rainbow.rbi @@ -0,0 +1,269 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This file was pulled from a central RBI files repository. +# Please run `bin/tapioca annotations` to update it. + +module Rainbow + # @shim: https://github.com/sickill/rainbow/blob/master/lib/rainbow.rb#L10-L12 + sig { returns(T::Boolean) } + attr_accessor :enabled + + class Color + sig { returns(Symbol) } + attr_reader :ground + + sig { params(ground: Symbol, values: T.any([Integer], [Integer, Integer, Integer])).returns(Color) } + def self.build(ground, values); end + + sig { params(hex: String).returns([Integer, Integer, Integer]) } + def self.parse_hex_color(hex); end + + class Indexed < Rainbow::Color + sig { returns(Integer) } + attr_reader :num + + sig { params(ground: Symbol, num: Integer).void } + def initialize(ground, num); end + + sig { returns(T::Array[Integer]) } + def codes; end + end + + class Named < Rainbow::Color::Indexed + NAMES = T.let(nil, T::Hash[Symbol, Integer]) + + sig { params(ground: Symbol, name: Symbol).void } + def initialize(ground, name); end + + sig { returns(T::Array[Symbol]) } + def self.color_names; end + + sig { returns(String) } + def self.valid_names; end + end + + class RGB < Rainbow::Color::Indexed + sig { returns(Integer) } + attr_reader :r, :g, :b + + sig { params(ground: Symbol, values: Integer).void } + def initialize(ground, *values); end + + sig { returns(T::Array[Integer]) } + def codes; end + + sig { params(value: Numeric).returns(Integer) } + def self.to_ansi_domain(value); end + end + + class X11Named < Rainbow::Color::RGB + include Rainbow::X11ColorNames + + sig { params(ground: Symbol, name: Symbol).void } + def initialize(ground, name); end + + sig { returns(T::Array[Symbol]) } + def self.color_names; end + + sig { returns(String) } + def self.valid_names; end + end + end + + sig { returns(Wrapper) } + def self.global; end + + sig { returns(T::Boolean) } + def self.enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def self.enabled=(value); end + + sig { params(string: String).returns(String) } + def self.uncolor(string); end + + class NullPresenter < String + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def color(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def foreground(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def fg(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def background(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(NullPresenter) } + def bg(*values); end + + sig { returns(NullPresenter) } + def reset; end + + sig { returns(NullPresenter) } + def bright; end + + sig { returns(NullPresenter) } + def faint; end + + sig { returns(NullPresenter) } + def italic; end + + sig { returns(NullPresenter) } + def underline; end + + sig { returns(NullPresenter) } + def blink; end + + sig { returns(NullPresenter) } + def inverse; end + + sig { returns(NullPresenter) } + def hide; end + + sig { returns(NullPresenter) } + def cross_out; end + + sig { returns(NullPresenter) } + def black; end + + sig { returns(NullPresenter) } + def red; end + + sig { returns(NullPresenter) } + def green; end + + sig { returns(NullPresenter) } + def yellow; end + + sig { returns(NullPresenter) } + def blue; end + + sig { returns(NullPresenter) } + def magenta; end + + sig { returns(NullPresenter) } + def cyan; end + + sig { returns(NullPresenter) } + def white; end + + sig { returns(NullPresenter) } + def bold; end + + sig { returns(NullPresenter) } + def dark; end + + sig { returns(NullPresenter) } + def strike; end + end + + class Presenter < String + TERM_EFFECTS = T.let(nil, T::Hash[Symbol, Integer]) + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def color(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def foreground(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def fg(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def background(*values); end + + sig { params(values: T.any([Integer], [Integer, Integer, Integer])).returns(Presenter) } + def bg(*values); end + + sig { returns(Presenter) } + def reset; end + + sig { returns(Presenter) } + def bright; end + + sig { returns(Presenter) } + def faint; end + + sig { returns(Presenter) } + def italic; end + + sig { returns(Presenter) } + def underline; end + + sig { returns(Presenter) } + def blink; end + + sig { returns(Presenter) } + def inverse; end + + sig { returns(Presenter) } + def hide; end + + sig { returns(Presenter) } + def cross_out; end + + sig { returns(Presenter) } + def black; end + + sig { returns(Presenter) } + def red; end + + sig { returns(Presenter) } + def green; end + + sig { returns(Presenter) } + def yellow; end + + sig { returns(Presenter) } + def blue; end + + sig { returns(Presenter) } + def magenta; end + + sig { returns(Presenter) } + def cyan; end + + sig { returns(Presenter) } + def white; end + + sig { returns(Presenter) } + def bold; end + + sig { returns(Presenter) } + def dark; end + + sig { returns(Presenter) } + def strike; end + end + + class StringUtils + sig { params(string: String, codes: T::Array[Integer]).returns(String) } + def self.wrap_with_sgr(string, codes); end + + sig { params(string: String).returns(String) } + def self.uncolor(string); end + end + + VERSION = T.let(nil, String) + + class Wrapper + sig { returns(T::Boolean) } + attr_accessor :enabled + + sig { params(enabled: T::Boolean).void } + def initialize(enabled = true); end + + sig { params(string: String).returns(T.any(Rainbow::Presenter, Rainbow::NullPresenter)) } + def wrap(string); end + end + + module X11ColorNames + NAMES = T.let(nil, T::Hash[Symbol, [Integer, Integer, Integer]]) + end +end + +sig { params(string: String).returns(Rainbow::Presenter) } +def Rainbow(string); end diff --git a/sorbet/rbi/faraday.rbi b/sorbet/rbi/faraday.rbi new file mode 100644 index 0000000..a7a6492 --- /dev/null +++ b/sorbet/rbi/faraday.rbi @@ -0,0 +1,6 @@ +# typed: strong + +class Faraday::Error + sig { returns(T.nilable(String)) } + def response_body; end +end diff --git a/sorbet/rbi/gems/.gitattributes b/sorbet/rbi/gems/.gitattributes new file mode 100644 index 0000000..d9bb82a --- /dev/null +++ b/sorbet/rbi/gems/.gitattributes @@ -0,0 +1 @@ +**/*.rbi linguist-generated=true diff --git a/sorbet/rbi/gems/addressable@2.8.7.rbi b/sorbet/rbi/gems/addressable@2.8.7.rbi new file mode 100644 index 0000000..eb8dae4 --- /dev/null +++ b/sorbet/rbi/gems/addressable@2.8.7.rbi @@ -0,0 +1,1994 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `addressable` gem. +# Please instead update this file by running `bin/tapioca gem addressable`. + + +# Addressable is a library for processing links and URIs. +# +# source://addressable//lib/addressable/version.rb#22 +module Addressable; end + +# source://addressable//lib/addressable/idna/pure.rb#21 +module Addressable::IDNA + class << self + # source://addressable//lib/addressable/idna/pure.rb#117 + def _deprecated_unicode_normalize_kc(value); end + + # Converts from a Unicode internationalized domain name to an ASCII + # domain name as described in RFC 3490. + # + # source://addressable//lib/addressable/idna/pure.rb#67 + def to_ascii(input); end + + # Converts from an ASCII domain name to a Unicode internationalized + # domain name as described in RFC 3490. + # + # source://addressable//lib/addressable/idna/pure.rb#93 + def to_unicode(input); end + + # @deprecated Use {String#unicode_normalize(:nfkc)} instead + def unicode_normalize_kc(*args, **_arg1, &block); end + + private + + # source://addressable//lib/addressable/idna/pure.rb#140 + def lookup_unicode_lowercase(codepoint); end + + # Bias adaptation method + # + # source://addressable//lib/addressable/idna/pure.rb#488 + def punycode_adapt(delta, numpoints, firsttime); end + + # @return [Boolean] + # + # source://addressable//lib/addressable/idna/pure.rb#456 + def punycode_basic?(codepoint); end + + # source://addressable//lib/addressable/idna/pure.rb#334 + def punycode_decode(punycode); end + + # Returns the numeric value of a basic codepoint + # (for use in representing integers) in the range 0 to + # base - 1, or PUNYCODE_BASE if codepoint does not represent a value. + # + # source://addressable//lib/addressable/idna/pure.rb#474 + def punycode_decode_digit(codepoint); end + + # @return [Boolean] + # + # source://addressable//lib/addressable/idna/pure.rb#461 + def punycode_delimiter?(codepoint); end + + # source://addressable//lib/addressable/idna/pure.rb#213 + def punycode_encode(unicode); end + + # source://addressable//lib/addressable/idna/pure.rb#466 + def punycode_encode_digit(d); end + + # Unicode aware downcase method. + # + # @api private + # @param input [String] The input string. + # @return [String] The downcased result. + # + # source://addressable//lib/addressable/idna/pure.rb#132 + def unicode_downcase(input); end + end +end + +# source://addressable//lib/addressable/idna/pure.rb#183 +Addressable::IDNA::ACE_MAX_LENGTH = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#40 +Addressable::IDNA::ACE_PREFIX = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/idna/pure.rb#172 +Addressable::IDNA::COMPOSITION_TABLE = T.let(T.unsafe(nil), Hash) + +# source://addressable//lib/addressable/idna/pure.rb#185 +Addressable::IDNA::PUNYCODE_BASE = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#189 +Addressable::IDNA::PUNYCODE_DAMP = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#192 +Addressable::IDNA::PUNYCODE_DELIMITER = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#190 +Addressable::IDNA::PUNYCODE_INITIAL_BIAS = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#191 +Addressable::IDNA::PUNYCODE_INITIAL_N = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#194 +Addressable::IDNA::PUNYCODE_MAXINT = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#196 +Addressable::IDNA::PUNYCODE_PRINT_ASCII = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/idna/pure.rb#188 +Addressable::IDNA::PUNYCODE_SKEW = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#187 +Addressable::IDNA::PUNYCODE_TMAX = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#186 +Addressable::IDNA::PUNYCODE_TMIN = T.let(T.unsafe(nil), Integer) + +# Input is invalid. +# +# source://addressable//lib/addressable/idna/pure.rb#207 +class Addressable::IDNA::PunycodeBadInput < ::StandardError; end + +# Output would exceed the space provided. +# +# source://addressable//lib/addressable/idna/pure.rb#209 +class Addressable::IDNA::PunycodeBigOutput < ::StandardError; end + +# Input needs wider integers to process. +# +# source://addressable//lib/addressable/idna/pure.rb#211 +class Addressable::IDNA::PunycodeOverflow < ::StandardError; end + +# source://addressable//lib/addressable/idna/pure.rb#163 +Addressable::IDNA::UNICODE_DATA = T.let(T.unsafe(nil), Hash) + +# source://addressable//lib/addressable/idna/pure.rb#150 +Addressable::IDNA::UNICODE_DATA_CANONICAL = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#148 +Addressable::IDNA::UNICODE_DATA_COMBINING_CLASS = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#151 +Addressable::IDNA::UNICODE_DATA_COMPATIBILITY = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#149 +Addressable::IDNA::UNICODE_DATA_EXCLUSION = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#153 +Addressable::IDNA::UNICODE_DATA_LOWERCASE = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#154 +Addressable::IDNA::UNICODE_DATA_TITLECASE = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#152 +Addressable::IDNA::UNICODE_DATA_UPPERCASE = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#182 +Addressable::IDNA::UNICODE_MAX_LENGTH = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/idna/pure.rb#36 +Addressable::IDNA::UNICODE_TABLE = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/idna/pure.rb#42 +Addressable::IDNA::UTF8_REGEX = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/idna/pure.rb#53 +Addressable::IDNA::UTF8_REGEX_MULTIBYTE = T.let(T.unsafe(nil), Regexp) + +# This is an implementation of a URI template based on +# RFC 6570 (http://tools.ietf.org/html/rfc6570). +# +# source://addressable//lib/addressable/template.rb#27 +class Addressable::Template + # Creates a new Addressable::Template object. + # + # @param pattern [#to_str] The URI Template pattern. + # @return [Addressable::Template] The initialized Template object. + # + # source://addressable//lib/addressable/template.rb#234 + def initialize(pattern); end + + # Returns true if the Template objects are equal. This method + # does NOT normalize either Template before doing the comparison. + # + # @param template [Object] The Template to compare. + # @return [TrueClass, FalseClass] true if the Templates are equivalent, false + # otherwise. + # + # source://addressable//lib/addressable/template.rb#274 + def ==(template); end + + # Returns true if the Template objects are equal. This method + # does NOT normalize either Template before doing the comparison. + # Addressable::Template makes no distinction between `==` and `eql?`. + # + # @param template [Object] The Template to compare. + # @return [TrueClass, FalseClass] true if the Templates are equivalent, false + # otherwise. + # @see #== + # + # source://addressable//lib/addressable/template.rb#274 + def eql?(template); end + + # Expands a URI template into a full URI. + # + # The object should respond to either the validate or + # transform messages or both. Both the validate and + # transform methods should take two parameters: name and + # value. The validate method should return true + # or false; true if the value of the variable is valid, + # false otherwise. An InvalidTemplateValueError + # exception will be raised if the value is invalid. The transform + # method should return the transformed variable value as a String. + # If a transform method is used, the value will not be percent + # encoded automatically. Unicode normalization will be performed both + # before and after sending the value to the transform method. + # + # @example + # class ExampleProcessor + # def self.validate(name, value) + # return !!(value =~ /^[\w ]+$/) if name == "query" + # return true + # end + # + # def self.transform(name, value) + # return value.gsub(/ /, "+") if name == "query" + # return value + # end + # end + # + # Addressable::Template.new( + # "http://example.com/search/{query}/" + # ).expand( + # {"query" => "an example search query"}, + # ExampleProcessor + # ).to_str + # #=> "http://example.com/search/an+example+search+query/" + # + # Addressable::Template.new( + # "http://example.com/search/{query}/" + # ).expand( + # {"query" => "an example search query"} + # ).to_str + # #=> "http://example.com/search/an%20example%20search%20query/" + # + # Addressable::Template.new( + # "http://example.com/search/{query}/" + # ).expand( + # {"query" => "bogus!"}, + # ExampleProcessor + # ).to_str + # #=> Addressable::Template::InvalidTemplateValueError + # @param mapping [Hash] The mapping that corresponds to the pattern. + # @param processor [#validate, #transform] An optional processor object may be supplied. + # @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true + # @return [Addressable::URI] The expanded URI template. + # + # source://addressable//lib/addressable/template.rb#591 + def expand(mapping, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end + + # Extracts a mapping from the URI using a URI Template pattern. + # + # @example + # class ExampleProcessor + # def self.restore(name, value) + # return value.gsub(/\+/, " ") if name == "query" + # return value + # end + # + # def self.match(name) + # return ".*?" if name == "first" + # return ".*" + # end + # end + # + # uri = Addressable::URI.parse( + # "http://example.com/search/an+example+search+query/" + # ) + # Addressable::Template.new( + # "http://example.com/search/{query}/" + # ).extract(uri, ExampleProcessor) + # #=> {"query" => "an example search query"} + # + # uri = Addressable::URI.parse("http://example.com/a/b/c/") + # Addressable::Template.new( + # "http://example.com/{first}/{second}/" + # ).extract(uri, ExampleProcessor) + # #=> {"first" => "a", "second" => "b/c"} + # + # uri = Addressable::URI.parse("http://example.com/a/b/c/") + # Addressable::Template.new( + # "http://example.com/{first}/{-list|/|second}/" + # ).extract(uri) + # #=> {"first" => "a", "second" => ["b", "c"]} + # @param uri [Addressable::URI, #to_str] The URI to extract from. + # @param processor [#restore, #match] A template processor object may optionally be supplied. + # + # The object should respond to either the restore or + # match messages or both. The restore method should + # take two parameters: `[String] name` and `[String] value`. + # The restore method should reverse any transformations that + # have been performed on the value to ensure a valid URI. + # The match method should take a single + # parameter: `[String] name`. The match method should return + # a String containing a regular expression capture group for + # matching on that particular variable. The default value is `".*?"`. + # The match method has no effect on multivariate operator + # expansions. + # @return [Hash, NilClass] The Hash mapping that was extracted from the URI, or + # nil if the URI didn't match the template. + # + # source://addressable//lib/addressable/template.rb#342 + def extract(uri, processor = T.unsafe(nil)); end + + # Freeze URI, initializing instance variables. + # + # @return [Addressable::URI] The frozen URI object. + # + # source://addressable//lib/addressable/template.rb#245 + def freeze; end + + # Returns a String representation of the Template object's state. + # + # @return [String] The Template object's state, as a String. + # + # source://addressable//lib/addressable/template.rb#260 + def inspect; end + + # Returns an Array of variables used within the template pattern. + # The variables are listed in the Array in the order they appear within + # the pattern. Multiple occurrences of a variable within a pattern are + # not represented in this Array. + # + # @return [Array] The variables present in the template's pattern. + # + # source://addressable//lib/addressable/template.rb#607 + def keys; end + + # Extracts match data from the URI using a URI Template pattern. + # + # @example + # class ExampleProcessor + # def self.restore(name, value) + # return value.gsub(/\+/, " ") if name == "query" + # return value + # end + # + # def self.match(name) + # return ".*?" if name == "first" + # return ".*" + # end + # end + # + # uri = Addressable::URI.parse( + # "http://example.com/search/an+example+search+query/" + # ) + # match = Addressable::Template.new( + # "http://example.com/search/{query}/" + # ).match(uri, ExampleProcessor) + # match.variables + # #=> ["query"] + # match.captures + # #=> ["an example search query"] + # + # uri = Addressable::URI.parse("http://example.com/a/b/c/") + # match = Addressable::Template.new( + # "http://example.com/{first}/{+second}/" + # ).match(uri, ExampleProcessor) + # match.variables + # #=> ["first", "second"] + # match.captures + # #=> ["a", "b/c"] + # + # uri = Addressable::URI.parse("http://example.com/a/b/c/") + # match = Addressable::Template.new( + # "http://example.com/{first}{/second*}/" + # ).match(uri) + # match.variables + # #=> ["first", "second"] + # match.captures + # #=> ["a", ["b", "c"]] + # @param uri [Addressable::URI, #to_str] The URI to extract from. + # @param processor [#restore, #match] A template processor object may optionally be supplied. + # + # The object should respond to either the restore or + # match messages or both. The restore method should + # take two parameters: `[String] name` and `[String] value`. + # The restore method should reverse any transformations that + # have been performed on the value to ensure a valid URI. + # The match method should take a single + # parameter: `[String] name`. The match method should return + # a String containing a regular expression capture group for + # matching on that particular variable. The default value is `".*?"`. + # The match method has no effect on multivariate operator + # expansions. + # @return [Hash, NilClass] The Hash mapping that was extracted from the URI, or + # nil if the URI didn't match the template. + # + # source://addressable//lib/addressable/template.rb#413 + def match(uri, processor = T.unsafe(nil)); end + + # Returns the named captures of the coerced `Regexp`. + # + # @api private + # @return [Hash] The named captures of the `Regexp` given by {#to_regexp}. + # + # source://addressable//lib/addressable/template.rb#651 + def named_captures; end + + # Returns an Array of variables used within the template pattern. + # The variables are listed in the Array in the order they appear within + # the pattern. Multiple occurrences of a variable within a pattern are + # not represented in this Array. + # + # @return [Array] The variables present in the template's pattern. + # + # source://addressable//lib/addressable/template.rb#607 + def names; end + + # Expands a URI template into another URI template. + # + # The object should respond to either the validate or + # transform messages or both. Both the validate and + # transform methods should take two parameters: name and + # value. The validate method should return true + # or false; true if the value of the variable is valid, + # false otherwise. An InvalidTemplateValueError + # exception will be raised if the value is invalid. The transform + # method should return the transformed variable value as a String. + # If a transform method is used, the value will not be percent + # encoded automatically. Unicode normalization will be performed both + # before and after sending the value to the transform method. + # + # @example + # Addressable::Template.new( + # "http://example.com/{one}/{two}/" + # ).partial_expand({"one" => "1"}).pattern + # #=> "http://example.com/1/{two}/" + # + # Addressable::Template.new( + # "http://example.com/{?one,two}/" + # ).partial_expand({"one" => "1"}).pattern + # #=> "http://example.com/?one=1{&two}/" + # + # Addressable::Template.new( + # "http://example.com/{?one,two,three}/" + # ).partial_expand({"one" => "1", "three" => 3}).pattern + # #=> "http://example.com/?one=1{&two}&three=3" + # @param mapping [Hash] The mapping that corresponds to the pattern. + # @param processor [#validate, #transform] An optional processor object may be supplied. + # @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true + # @return [Addressable::Template] The partially expanded URI template. + # + # source://addressable//lib/addressable/template.rb#524 + def partial_expand(mapping, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end + + # @return [String] The Template object's pattern. + # + # source://addressable//lib/addressable/template.rb#254 + def pattern; end + + # Returns the source of the coerced `Regexp`. + # + # @api private + # @return [String] The source of the `Regexp` given by {#to_regexp}. + # + # source://addressable//lib/addressable/template.rb#641 + def source; end + + # Coerces a template into a `Regexp` object. This regular expression will + # behave very similarly to the actual template, and should match the same + # URI values, but it cannot fully handle, for example, values that would + # extract to an `Array`. + # + # @return [Regexp] A regular expression which should match the template. + # + # source://addressable//lib/addressable/template.rb#630 + def to_regexp; end + + # Returns a mapping of variables to their default values specified + # in the template. Variables without defaults are not returned. + # + # @return [Hash] Mapping of template variables to their defaults + # + # source://addressable//lib/addressable/template.rb#618 + def variable_defaults; end + + # Returns an Array of variables used within the template pattern. + # The variables are listed in the Array in the order they appear within + # the pattern. Multiple occurrences of a variable within a pattern are + # not represented in this Array. + # + # @return [Array] The variables present in the template's pattern. + # + # source://addressable//lib/addressable/template.rb#607 + def variables; end + + private + + # Takes a set of values, and joins them together based on the + # operator. + # + # @param operator [String, Nil] One of the operators from the set + # (?,&,+,#,;,/,.), or nil if there wasn't one. + # @param return_value [Array] The set of return values (as [variable_name, value] tuples) that will + # be joined together. + # @return [String] The transformed mapped value + # + # source://addressable//lib/addressable/template.rb#861 + def join_values(operator, return_value); end + + # Generates a hash with string keys + # + # @param mapping [Hash] A mapping hash to normalize + # @return [Hash] A hash with stringified keys + # + # source://addressable//lib/addressable/template.rb#924 + def normalize_keys(mapping); end + + # Takes a set of values, and joins them together based on the + # operator. + # + # @param value [Hash, Array, String] Normalizes unicode keys and values with String#unicode_normalize (NFC) + # @return [Hash, Array, String] The normalized values + # + # source://addressable//lib/addressable/template.rb#898 + def normalize_value(value); end + + # source://addressable//lib/addressable/template.rb#656 + def ordered_variable_defaults; end + + # Generates the Regexp that parses a template pattern. + # + # @param pattern [String] The URI template pattern. + # @param processor [#match] The template processor to use. + # @return [Array, Regexp] An array of expansion variables nad a regular expression which may be + # used to parse a template pattern + # + # source://addressable//lib/addressable/template.rb#968 + def parse_new_template_pattern(pattern, processor = T.unsafe(nil)); end + + # Generates the Regexp that parses a template pattern. Memoizes the + # value if template processor not set (processors may not be deterministic) + # + # @param pattern [String] The URI template pattern. + # @param processor [#match] The template processor to use. + # @return [Array, Regexp] An array of expansion variables nad a regular expression which may be + # used to parse a template pattern + # + # source://addressable//lib/addressable/template.rb#950 + def parse_template_pattern(pattern, processor = T.unsafe(nil)); end + + # Transforms a mapped value so that values can be substituted into the + # template. + # + # The object should respond to either the validate or + # transform messages or both. Both the validate and + # transform methods should take two parameters: name and + # value. The validate method should return true + # or false; true if the value of the variable is valid, + # false otherwise. An InvalidTemplateValueError exception + # will be raised if the value is invalid. The transform method + # should return the transformed variable value as a String. If a + # transform method is used, the value will not be percent encoded + # automatically. Unicode normalization will be performed both before and + # after sending the value to the transform method. + # + # @param mapping [Hash] The mapping to replace captures + # @param capture [String] The expression to replace + # @param processor [#validate, #transform] An optional processor object may be supplied. + # @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true + # @return [String] The expanded expression + # + # source://addressable//lib/addressable/template.rb#753 + def transform_capture(mapping, capture, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end + + # Loops through each capture and expands any values available in mapping + # + # The object should respond to either the validate or + # transform messages or both. Both the validate and + # transform methods should take two parameters: name and + # value. The validate method should return true + # or false; true if the value of the variable is valid, + # false otherwise. An InvalidTemplateValueError exception + # will be raised if the value is invalid. The transform method + # should return the transformed variable value as a String. If a + # transform method is used, the value will not be percent encoded + # automatically. Unicode normalization will be performed both before and + # after sending the value to the transform method. + # + # @param mapping [Hash] Set of keys to expand + # @param capture [String] The expression to expand + # @param processor [#validate, #transform] An optional processor object may be supplied. + # @param normalize_values [Boolean] Optional flag to enable/disable unicode normalization. Default: true + # @return [String] The expanded expression + # + # source://addressable//lib/addressable/template.rb#694 + def transform_partial_capture(mapping, capture, processor = T.unsafe(nil), normalize_values = T.unsafe(nil)); end +end + +# source://addressable//lib/addressable/template.rb#58 +Addressable::Template::EXPRESSION = T.let(T.unsafe(nil), Regexp) + +# Raised if an invalid template operator is used in a pattern. +# +# source://addressable//lib/addressable/template.rb#85 +class Addressable::Template::InvalidTemplateOperatorError < ::StandardError; end + +# Raised if an invalid template value is supplied. +# +# source://addressable//lib/addressable/template.rb#80 +class Addressable::Template::InvalidTemplateValueError < ::StandardError; end + +# source://addressable//lib/addressable/template.rb#70 +Addressable::Template::JOINERS = T.let(T.unsafe(nil), Hash) + +# source://addressable//lib/addressable/template.rb#62 +Addressable::Template::LEADERS = T.let(T.unsafe(nil), Hash) + +# This class represents the data that is extracted when a Template +# is matched against a URI. +# +# source://addressable//lib/addressable/template.rb#96 +class Addressable::Template::MatchData + # Creates a new MatchData object. + # MatchData objects should never be instantiated directly. + # + # @param uri [Addressable::URI] The URI that the template was matched against. + # @return [MatchData] a new instance of MatchData + # + # source://addressable//lib/addressable/template.rb#103 + def initialize(uri, template, mapping); end + + # Accesses captured values by name or by index. + # + # @param key [String, Symbol, Fixnum] Capture index or name. Note that when accessing by with index + # of 0, the full URI will be returned. The intention is to mimic + # the ::MatchData#[] behavior. + # @param len [#to_int, nil] If provided, an array of values will be returned with the given + # parameter used as length. + # @return [Array, String, nil] The captured value corresponding to the index or name. If the + # value was not provided or the key is unknown, nil will be + # returned. + # + # If the second parameter is provided, an array of that length will + # be returned instead. + # + # source://addressable//lib/addressable/template.rb#170 + def [](key, len = T.unsafe(nil)); end + + # @return [Array] The list of values that were captured by the Template. + # Note that this list will include nils for any variables which + # were in the Template, but did not appear in the URI. + # + # source://addressable//lib/addressable/template.rb#143 + def captures; end + + # Returns a String representation of the MatchData's state. + # + # @return [String] The MatchData's state, as a String. + # + # source://addressable//lib/addressable/template.rb#213 + def inspect; end + + # @return [Array] The list of variables that were present in the Template. + # Note that this list will include variables which do not appear + # in the mapping because they were not present in URI. + # + # source://addressable//lib/addressable/template.rb#132 + def keys; end + + # @return [Hash] The mapping that resulted from the match. + # Note that this mapping does not include keys or values for + # variables that appear in the Template, but are not present + # in the URI. + # + # source://addressable//lib/addressable/template.rb#125 + def mapping; end + + # @return [Array] The list of variables that were present in the Template. + # Note that this list will include variables which do not appear + # in the mapping because they were not present in URI. + # + # source://addressable//lib/addressable/template.rb#132 + def names; end + + # Dummy method for code expecting a ::MatchData instance + # + # @return [String] An empty string. + # + # source://addressable//lib/addressable/template.rb#222 + def post_match; end + + # Dummy method for code expecting a ::MatchData instance + # + # @return [String] An empty string. + # + # source://addressable//lib/addressable/template.rb#222 + def pre_match; end + + # @return [String] The matched URI as String. + # + # source://addressable//lib/addressable/template.rb#191 + def string; end + + # @return [Addressable::Template] The Template used for the match. + # + # source://addressable//lib/addressable/template.rb#117 + def template; end + + # @return [Array] Array with the matched URI as first element followed by the captured + # values. + # + # source://addressable//lib/addressable/template.rb#184 + def to_a; end + + # @return [String] The matched URI as String. + # + # source://addressable//lib/addressable/template.rb#191 + def to_s; end + + # @return [Addressable::URI] The URI that the Template was matched against. + # + # source://addressable//lib/addressable/template.rb#112 + def uri; end + + # @return [Array] The list of values that were captured by the Template. + # Note that this list will include nils for any variables which + # were in the Template, but did not appear in the URI. + # + # source://addressable//lib/addressable/template.rb#143 + def values; end + + # Returns multiple captured values at once. + # + # @param *indexes [String, Symbol, Fixnum] Indices of the captures to be returned + # @return [Array] Values corresponding to given indices. + # @see Addressable::Template::MatchData#[] + # + # source://addressable//lib/addressable/template.rb#205 + def values_at(*indexes); end + + # @return [Array] The list of variables that were present in the Template. + # Note that this list will include variables which do not appear + # in the mapping because they were not present in URI. + # + # source://addressable//lib/addressable/template.rb#132 + def variables; end +end + +# source://addressable//lib/addressable/template.rb#40 +Addressable::Template::RESERVED = T.let(T.unsafe(nil), String) + +# Raised if an invalid template operator is used in a pattern. +# +# source://addressable//lib/addressable/template.rb#90 +class Addressable::Template::TemplateOperatorAbortedError < ::StandardError; end + +# source://addressable//lib/addressable/template.rb#42 +Addressable::Template::UNRESERVED = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/template.rb#54 +Addressable::Template::VARIABLE_LIST = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/template.rb#50 +Addressable::Template::VARNAME = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/template.rb#52 +Addressable::Template::VARSPEC = T.let(T.unsafe(nil), Regexp) + +# This is an implementation of a URI parser based on +# RFC 3986, +# RFC 3987. +# +# source://addressable//lib/addressable/uri.rb#31 +class Addressable::URI + # Creates a new uri object from component parts. + # + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @option [String, + # @param [String, [Hash] a customizable set of options + # @return [Addressable::URI] The constructed URI object. + # + # source://addressable//lib/addressable/uri.rb#830 + def initialize(options = T.unsafe(nil)); end + + # Joins two URIs together. + # + # @param The [String, Addressable::URI, #to_str] URI to join with. + # @return [Addressable::URI] The joined URI. + # + # source://addressable//lib/addressable/uri.rb#1889 + def +(uri); end + + # Returns true if the URI objects are equal. This method + # normalizes both URIs before doing the comparison. + # + # @param uri [Object] The URI to compare. + # @return [TrueClass, FalseClass] true if the URIs are equivalent, false + # otherwise. + # + # source://addressable//lib/addressable/uri.rb#2239 + def ==(uri); end + + # Returns true if the URI objects are equal. This method + # normalizes both URIs before doing the comparison, and allows comparison + # against Strings. + # + # @param uri [Object] The URI to compare. + # @return [TrueClass, FalseClass] true if the URIs are equivalent, false + # otherwise. + # + # source://addressable//lib/addressable/uri.rb#2217 + def ===(uri); end + + # Determines if the URI is absolute. + # + # @return [TrueClass, FalseClass] true if the URI is absolute. false + # otherwise. + # + # source://addressable//lib/addressable/uri.rb#1879 + def absolute?; end + + # The authority component for this URI. + # Combines the user, password, host, and port components. + # + # @return [String] The authority component. + # + # source://addressable//lib/addressable/uri.rb#1234 + def authority; end + + # Sets the authority component for this URI. + # + # @param new_authority [String, #to_str] The new authority component. + # + # source://addressable//lib/addressable/uri.rb#1274 + def authority=(new_authority); end + + # The basename, if any, of the file in the path component. + # + # @return [String] The path's basename. + # + # source://addressable//lib/addressable/uri.rb#1588 + def basename; end + + # The default port for this URI's scheme. + # This method will always returns the default port for the URI's scheme + # regardless of the presence of an explicit port in the URI. + # + # @return [Integer] The default port. + # + # source://addressable//lib/addressable/uri.rb#1454 + def default_port; end + + # This method allows you to make several changes to a URI simultaneously, + # which separately would cause validation errors, but in conjunction, + # are valid. The URI will be revalidated as soon as the entire block has + # been executed. + # + # @param block [Proc] A set of operations to perform on a given URI. + # + # source://addressable//lib/addressable/uri.rb#2396 + def defer_validation; end + + # Creates a URI suitable for display to users. If semantic attacks are + # likely, the application should try to detect these and warn the user. + # See RFC 3986, + # section 7.6 for more information. + # + # @return [Addressable::URI] A URI suitable for display purposes. + # + # source://addressable//lib/addressable/uri.rb#2201 + def display_uri; end + + # Returns the public suffix domain for this host. + # + # @example + # Addressable::URI.parse("http://www.example.co.uk").domain # => "example.co.uk" + # + # source://addressable//lib/addressable/uri.rb#1225 + def domain; end + + # Clones the URI object. + # + # @return [Addressable::URI] The cloned URI. + # + # source://addressable//lib/addressable/uri.rb#2271 + def dup; end + + # Determines if the URI is an empty string. + # + # @return [TrueClass, FalseClass] Returns true if empty, false otherwise. + # + # source://addressable//lib/addressable/uri.rb#2333 + def empty?; end + + # source://addressable//lib/addressable/uri.rb#2406 + def encode_with(coder); end + + # Returns true if the URI objects are equal. This method + # does NOT normalize either URI before doing the comparison. + # + # @param uri [Object] The URI to compare. + # @return [TrueClass, FalseClass] true if the URIs are equivalent, false + # otherwise. + # + # source://addressable//lib/addressable/uri.rb#2253 + def eql?(uri); end + + # The extname, if any, of the file in the path component. + # Empty string if there is no extension. + # + # @return [String] The path's extname. + # + # source://addressable//lib/addressable/uri.rb#1598 + def extname; end + + # The fragment component for this URI. + # + # @return [String] The fragment component. + # + # source://addressable//lib/addressable/uri.rb#1810 + def fragment; end + + # Sets the fragment component for this URI. + # + # @param new_fragment [String, #to_str] The new fragment component. + # + # source://addressable//lib/addressable/uri.rb#1835 + def fragment=(new_fragment); end + + # Freeze URI, initializing instance variables. + # + # @return [Addressable::URI] The frozen URI object. + # + # source://addressable//lib/addressable/uri.rb#870 + def freeze; end + + # A hash value that will make a URI equivalent to its normalized + # form. + # + # @return [Integer] A hash of the URI. + # + # source://addressable//lib/addressable/uri.rb#2263 + def hash; end + + # The host component for this URI. + # + # @return [String] The host component. + # + # source://addressable//lib/addressable/uri.rb#1120 + def host; end + + # Sets the host component for this URI. + # + # @param new_host [String, #to_str] The new host component. + # + # source://addressable//lib/addressable/uri.rb#1156 + def host=(new_host); end + + # This method is same as URI::Generic#host except + # brackets for IPv6 (and 'IPvFuture') addresses are removed. + # + # @return [String] The hostname for this URI. + # @see Addressable::URI#host + # + # source://addressable//lib/addressable/uri.rb#1178 + def hostname; end + + # This method is same as URI::Generic#host= except + # the argument can be a bare IPv6 address (or 'IPvFuture'). + # + # @param new_hostname [String, #to_str] The new hostname for this URI. + # @see Addressable::URI#host= + # + # source://addressable//lib/addressable/uri.rb#1190 + def hostname=(new_hostname); end + + # The inferred port component for this URI. + # This method will normalize to the default port for the URI's scheme if + # the port isn't explicitly specified in the URI. + # + # @return [Integer] The inferred port component. + # + # source://addressable//lib/addressable/uri.rb#1440 + def inferred_port; end + + # source://addressable//lib/addressable/uri.rb#2417 + def init_with(coder); end + + # Returns a String representation of the URI object's state. + # + # @return [String] The URI object's state, as a String. + # + # source://addressable//lib/addressable/uri.rb#2384 + def inspect; end + + # Determines if the scheme indicates an IP-based protocol. + # + # @return [TrueClass, FalseClass] true if the scheme indicates an IP-based protocol. + # false otherwise. + # + # source://addressable//lib/addressable/uri.rb#1855 + def ip_based?; end + + # Joins two URIs together. + # + # @param The [String, Addressable::URI, #to_str] URI to join with. + # @return [Addressable::URI] The joined URI. + # + # source://addressable//lib/addressable/uri.rb#1889 + def join(uri); end + + # Destructive form of join. + # + # @param The [String, Addressable::URI, #to_str] URI to join with. + # @return [Addressable::URI] The joined URI. + # @see Addressable::URI#join + # + # source://addressable//lib/addressable/uri.rb#1992 + def join!(uri); end + + # Merges a URI with a Hash of components. + # This method has different behavior from join. Any + # components present in the hash parameter will override the + # original components. The path component is not treated specially. + # + # @param The [Hash, Addressable::URI, #to_hash] components to merge with. + # @return [Addressable::URI] The merged URI. + # @see Hash#merge + # + # source://addressable//lib/addressable/uri.rb#2007 + def merge(hash); end + + # Destructive form of merge. + # + # @param The [Hash, Addressable::URI, #to_hash] components to merge with. + # @return [Addressable::URI] The merged URI. + # @see Addressable::URI#merge + # + # source://addressable//lib/addressable/uri.rb#2072 + def merge!(uri); end + + # Returns a normalized URI object. + # + # NOTE: This method does not attempt to fully conform to specifications. + # It exists largely to correct other people's failures to read the + # specifications, and also to deal with caching issues since several + # different URIs may represent the same resource and should not be + # cached multiple times. + # + # @return [Addressable::URI] The normalized URI. + # + # source://addressable//lib/addressable/uri.rb#2164 + def normalize; end + + # Destructively normalizes this URI object. + # + # @return [Addressable::URI] The normalized URI. + # @see Addressable::URI#normalize + # + # source://addressable//lib/addressable/uri.rb#2190 + def normalize!; end + + # The authority component for this URI, normalized. + # + # @return [String] The authority component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1252 + def normalized_authority; end + + # The fragment component for this URI, normalized. + # + # @return [String] The fragment component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1816 + def normalized_fragment; end + + # The host component for this URI, normalized. + # + # @return [String] The host component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1126 + def normalized_host; end + + # The password component for this URI, normalized. + # + # @return [String] The password component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1002 + def normalized_password; end + + # The path component for this URI, normalized. + # + # @return [String] The path component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1535 + def normalized_path; end + + # The port component for this URI, normalized. + # + # @return [Integer] The port component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1392 + def normalized_port; end + + # The query component for this URI, normalized. + # + # @return [String] The query component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1613 + def normalized_query(*flags); end + + # The scheme component for this URI, normalized. + # + # @return [String] The scheme component, normalized. + # + # source://addressable//lib/addressable/uri.rb#896 + def normalized_scheme; end + + # The normalized combination of components that represent a site. + # Combines the scheme, user, password, host, and port components. + # Primarily useful for HTTP and HTTPS. + # + # For example, "http://example.com/path?query" would have a + # site value of "http://example.com". + # + # @return [String] The normalized components that identify a site. + # + # source://addressable//lib/addressable/uri.rb#1485 + def normalized_site; end + + # The user component for this URI, normalized. + # + # @return [String] The user component, normalized. + # + # source://addressable//lib/addressable/uri.rb#947 + def normalized_user; end + + # The userinfo component for this URI, normalized. + # + # @return [String] The userinfo component, normalized. + # + # source://addressable//lib/addressable/uri.rb#1068 + def normalized_userinfo; end + + # Omits components from a URI. + # + # @example + # uri = Addressable::URI.parse("http://example.com/path?query") + # #=> # + # uri.omit(:scheme, :authority) + # #=> # + # @param *components [Symbol] The components to be omitted. + # @return [Addressable::URI] The URI with components omitted. + # + # source://addressable//lib/addressable/uri.rb#2297 + def omit(*components); end + + # Destructive form of omit. + # + # @param *components [Symbol] The components to be omitted. + # @return [Addressable::URI] The URI with components omitted. + # @see Addressable::URI#omit + # + # source://addressable//lib/addressable/uri.rb#2324 + def omit!(*components); end + + # The origin for this URI, serialized to ASCII, as per + # RFC 6454, section 6.2. + # + # @return [String] The serialized origin. + # + # source://addressable//lib/addressable/uri.rb#1314 + def origin; end + + # Sets the origin for this URI, serialized to ASCII, as per + # RFC 6454, section 6.2. This assignment will reset the `userinfo` + # component. + # + # @param new_origin [String, #to_str] The new origin component. + # + # source://addressable//lib/addressable/uri.rb#1333 + def origin=(new_origin); end + + # The password component for this URI. + # + # @return [String] The password component. + # + # source://addressable//lib/addressable/uri.rb#996 + def password; end + + # Sets the password component for this URI. + # + # @param new_password [String, #to_str] The new password component. + # + # source://addressable//lib/addressable/uri.rb#1025 + def password=(new_password); end + + # The path component for this URI. + # + # @return [String] The path component. + # + # source://addressable//lib/addressable/uri.rb#1528 + def path; end + + # Sets the path component for this URI. + # + # @param new_path [String, #to_str] The new path component. + # + # source://addressable//lib/addressable/uri.rb#1567 + def path=(new_path); end + + # The port component for this URI. + # This is the port number actually given in the URI. This does not + # infer port numbers from default values. + # + # @return [Integer] The port component. + # + # source://addressable//lib/addressable/uri.rb#1386 + def port; end + + # Sets the port component for this URI. + # + # @param new_port [String, Integer, #to_s] The new port component. + # + # source://addressable//lib/addressable/uri.rb#1408 + def port=(new_port); end + + # The query component for this URI. + # + # @return [String] The query component. + # + # source://addressable//lib/addressable/uri.rb#1607 + def query; end + + # Sets the query component for this URI. + # + # @param new_query [String, #to_str] The new query component. + # + # source://addressable//lib/addressable/uri.rb#1641 + def query=(new_query); end + + # Converts the query component to a Hash value. + # + # @example + # Addressable::URI.parse("?one=1&two=2&three=3").query_values + # #=> {"one" => "1", "two" => "2", "three" => "3"} + # Addressable::URI.parse("?one=two&one=three").query_values(Array) + # #=> [["one", "two"], ["one", "three"]] + # Addressable::URI.parse("?one=two&one=three").query_values(Hash) + # #=> {"one" => "three"} + # Addressable::URI.parse("?").query_values + # #=> {} + # Addressable::URI.parse("").query_values + # #=> nil + # @param return_type [Class] The return type desired. Value must be either + # `Hash` or `Array`. + # @return [Hash, Array, nil] The query string parsed as a Hash or Array + # or nil if the query string is blank. + # + # source://addressable//lib/addressable/uri.rb#1672 + def query_values(return_type = T.unsafe(nil)); end + + # Sets the query component for this URI from a Hash object. + # An empty Hash or Array will result in an empty query string. + # + # @example + # uri.query_values = {:a => "a", :b => ["c", "d", "e"]} + # uri.query + # # => "a=a&b=c&b=d&b=e" + # uri.query_values = [['a', 'a'], ['b', 'c'], ['b', 'd'], ['b', 'e']] + # uri.query + # # => "a=a&b=c&b=d&b=e" + # uri.query_values = [['a', 'a'], ['b', ['c', 'd', 'e']]] + # uri.query + # # => "a=a&b=c&b=d&b=e" + # uri.query_values = [['flag'], ['key', 'value']] + # uri.query + # # => "flag&key=value" + # @param new_query_values [Hash, #to_hash, Array] The new query values. + # + # source://addressable//lib/addressable/uri.rb#1723 + def query_values=(new_query_values); end + + # Determines if the URI is relative. + # + # @return [TrueClass, FalseClass] true if the URI is relative. false + # otherwise. + # + # source://addressable//lib/addressable/uri.rb#1869 + def relative?; end + + # The HTTP request URI for this URI. This is the path and the + # query string. + # + # @return [String] The request URI required for an HTTP request. + # + # source://addressable//lib/addressable/uri.rb#1774 + def request_uri; end + + # Sets the HTTP request URI for this URI. + # + # @param new_request_uri [String, #to_str] The new HTTP request URI. + # + # source://addressable//lib/addressable/uri.rb#1786 + def request_uri=(new_request_uri); end + + # Returns the shortest normalized relative form of this URI that uses the + # supplied URI as a base for resolution. Returns an absolute URI if + # necessary. This is effectively the opposite of route_to. + # + # @param uri [String, Addressable::URI, #to_str] The URI to route from. + # @return [Addressable::URI] The normalized relative URI that is equivalent to the original URI. + # + # source://addressable//lib/addressable/uri.rb#2085 + def route_from(uri); end + + # Returns the shortest normalized relative form of the supplied URI that + # uses this URI as a base for resolution. Returns an absolute URI if + # necessary. This is effectively the opposite of route_from. + # + # @param uri [String, Addressable::URI, #to_str] The URI to route to. + # @return [Addressable::URI] The normalized relative URI that is equivalent to the supplied URI. + # + # source://addressable//lib/addressable/uri.rb#2150 + def route_to(uri); end + + # The scheme component for this URI. + # + # @return [String] The scheme component. + # + # source://addressable//lib/addressable/uri.rb#890 + def scheme; end + + # Sets the scheme component for this URI. + # + # @param new_scheme [String, #to_str] The new scheme component. + # + # source://addressable//lib/addressable/uri.rb#917 + def scheme=(new_scheme); end + + # The combination of components that represent a site. + # Combines the scheme, user, password, host, and port components. + # Primarily useful for HTTP and HTTPS. + # + # For example, "http://example.com/path?query" would have a + # site value of "http://example.com". + # + # @return [String] The components that identify a site. + # + # source://addressable//lib/addressable/uri.rb#1467 + def site; end + + # Sets the site value for this URI. + # + # @param new_site [String, #to_str] The new site value. + # + # source://addressable//lib/addressable/uri.rb#1506 + def site=(new_site); end + + # Returns the top-level domain for this host. + # + # @example + # Addressable::URI.parse("http://www.example.co.uk").tld # => "co.uk" + # + # source://addressable//lib/addressable/uri.rb#1207 + def tld; end + + # Sets the top-level domain for this URI. + # + # @param new_tld [String, #to_str] The new top-level domain. + # + # source://addressable//lib/addressable/uri.rb#1215 + def tld=(new_tld); end + + # Returns a Hash of the URI components. + # + # @return [Hash] The URI as a Hash of components. + # + # source://addressable//lib/addressable/uri.rb#2367 + def to_hash; end + + # Converts the URI to a String. + # + # @return [String] The URI's String representation. + # + # source://addressable//lib/addressable/uri.rb#2341 + def to_s; end + + # Converts the URI to a String. + # URI's are glorified Strings. Allow implicit conversion. + # + # @return [String] The URI's String representation. + # + # source://addressable//lib/addressable/uri.rb#2341 + def to_str; end + + # The user component for this URI. + # + # @return [String] The user component. + # + # source://addressable//lib/addressable/uri.rb#941 + def user; end + + # Sets the user component for this URI. + # + # @param new_user [String, #to_str] The new user component. + # + # source://addressable//lib/addressable/uri.rb#970 + def user=(new_user); end + + # The userinfo component for this URI. + # Combines the user and password components. + # + # @return [String] The userinfo component. + # + # source://addressable//lib/addressable/uri.rb#1052 + def userinfo; end + + # Sets the userinfo component for this URI. + # + # @param new_userinfo [String, #to_str] The new userinfo component. + # + # source://addressable//lib/addressable/uri.rb#1091 + def userinfo=(new_userinfo); end + + protected + + # Converts the string to be UTF-8 if it is not already UTF-8 + # + # @api private + # + # source://addressable//lib/addressable/uri.rb#2561 + def force_utf8_encoding_if_needed(str); end + + # Resets composite values for the entire URI + # + # @api private + # + # source://addressable//lib/addressable/uri.rb#2552 + def remove_composite_values; end + + # Replaces the internal state of self with the specified URI's state. + # Used in destructive operations to avoid massive code repetition. + # + # @param uri [Addressable::URI] The URI to replace self with. + # @return [Addressable::URI] self. + # + # source://addressable//lib/addressable/uri.rb#2519 + def replace_self(uri); end + + # Splits path string with "/" (slash). + # It is considered that there is empty string after last slash when + # path ends with slash. + # + # @param path [String] The path to split. + # @return [Array] An array of parts of path. + # + # source://addressable//lib/addressable/uri.rb#2542 + def split_path(path); end + + # Ensures that the URI is valid. + # + # source://addressable//lib/addressable/uri.rb#2476 + def validate; end + + private + + # Resets instance variables + # + # @api private + # + # source://addressable//lib/addressable/uri.rb#2573 + def reset_ivs; end + + class << self + # Converts a path to a file scheme URI. If the path supplied is + # relative, it will be returned as a relative URI. If the path supplied + # is actually a non-file URI, it will parse the URI as if it had been + # parsed with Addressable::URI.parse. Handles all of the + # various Microsoft-specific formats for specifying paths. + # + # @example + # base = Addressable::URI.convert_path("/absolute/path/") + # uri = Addressable::URI.convert_path("relative/path") + # (base + uri).to_s + # #=> "file:///absolute/path/relative/path" + # + # Addressable::URI.convert_path( + # "c:\\windows\\My Documents 100%20\\foo.txt" + # ).to_s + # #=> "file:///c:/windows/My%20Documents%20100%20/foo.txt" + # + # Addressable::URI.convert_path("http://example.com/").to_s + # #=> "http://example.com/" + # @param path [String, Addressable::URI, #to_str] Typically a String path to a file or directory, but + # will return a sensible return value if an absolute URI is supplied + # instead. + # @return [Addressable::URI] The parsed file scheme URI or the original URI if some other URI + # scheme was provided. + # + # source://addressable//lib/addressable/uri.rb#292 + def convert_path(path); end + + # Percent encodes any special characters in the URI. + # + # @param uri [String, Addressable::URI, #to_str] The URI to encode. + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @return [String, Addressable::URI] The encoded URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#616 + def encode(uri, return_type = T.unsafe(nil)); end + + # Percent encodes a URI component. + # + # '9' to be percent encoded. If a Regexp is passed, the + # value /[^b-zB-Z0-9]/ would have the same effect. A set of + # useful String values may be found in the + # Addressable::URI::CharacterClasses module. The default + # value is the reserved plus unreserved character classes specified in + # RFC 3986. + # + # @example + # Addressable::URI.encode_component("simple/example", "b-zB-Z0-9") + # => "simple%2Fex%61mple" + # Addressable::URI.encode_component("simple/example", /[^b-zB-Z0-9]/) + # => "simple%2Fex%61mple" + # Addressable::URI.encode_component( + # "simple/example", Addressable::URI::CharacterClasses::UNRESERVED + # ) + # => "simple%2Fexample" + # @param component [String, #to_str] The URI component to encode. + # @param character_class [String, Regexp] The characters which are not percent encoded. If a String + # is passed, the String must be formatted as a regular + # expression character class. (Do not include the surrounding square + # brackets.) For example, "b-zB-Z0-9" would cause + # everything but the letters 'b' through 'z' and the numbers '0' through + # @param upcase_encoded [Regexp] A string of characters that may already be percent encoded, and whose + # encodings should be upcased. This allows normalization of percent + # encodings for characters not included in the + # character_class. + # @return [String] The encoded component. + # + # source://addressable//lib/addressable/uri.rb#403 + def encode_component(component, character_class = T.unsafe(nil), upcase_encoded = T.unsafe(nil)); end + + # Percent encodes any special characters in the URI. + # + # @param uri [String, Addressable::URI, #to_str] The URI to encode. + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @return [String, Addressable::URI] The encoded URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#616 + def escape(uri, return_type = T.unsafe(nil)); end + + # Percent encodes a URI component. + # + # '9' to be percent encoded. If a Regexp is passed, the + # value /[^b-zB-Z0-9]/ would have the same effect. A set of + # useful String values may be found in the + # Addressable::URI::CharacterClasses module. The default + # value is the reserved plus unreserved character classes specified in + # RFC 3986. + # + # @example + # Addressable::URI.encode_component("simple/example", "b-zB-Z0-9") + # => "simple%2Fex%61mple" + # Addressable::URI.encode_component("simple/example", /[^b-zB-Z0-9]/) + # => "simple%2Fex%61mple" + # Addressable::URI.encode_component( + # "simple/example", Addressable::URI::CharacterClasses::UNRESERVED + # ) + # => "simple%2Fexample" + # @param component [String, #to_str] The URI component to encode. + # @param character_class [String, Regexp] The characters which are not percent encoded. If a String + # is passed, the String must be formatted as a regular + # expression character class. (Do not include the surrounding square + # brackets.) For example, "b-zB-Z0-9" would cause + # everything but the letters 'b' through 'z' and the numbers '0' through + # @param upcase_encoded [Regexp] A string of characters that may already be percent encoded, and whose + # encodings should be upcased. This allows normalization of percent + # encodings for characters not included in the + # character_class. + # @return [String] The encoded component. + # + # source://addressable//lib/addressable/uri.rb#403 + def escape_component(component, character_class = T.unsafe(nil), upcase_encoded = T.unsafe(nil)); end + + # Encodes a set of key/value pairs according to the rules for the + # application/x-www-form-urlencoded MIME type. + # + # @param form_values [#to_hash, #to_ary] The form values to encode. + # @param sort [TrueClass, FalseClass] Sort the key/value pairs prior to encoding. + # Defaults to false. + # @return [String] The encoded value. + # + # source://addressable//lib/addressable/uri.rb#740 + def form_encode(form_values, sort = T.unsafe(nil)); end + + # Decodes a String according to the rules for the + # application/x-www-form-urlencoded MIME type. + # + # @param encoded_value [String, #to_str] The form values to decode. + # @return [Array] The decoded values. + # This is not a Hash because of the possibility for + # duplicate keys. + # + # source://addressable//lib/addressable/uri.rb#793 + def form_unencode(encoded_value); end + + # Converts an input to a URI. The input does not have to be a valid + # URI — the method will use heuristics to guess what URI was intended. + # This is not standards-compliant, merely user-friendly. + # + # @param uri [String, Addressable::URI, #to_str] The URI string to parse. + # No parsing is performed if the object is already an + # Addressable::URI. + # @param hints [Hash] A Hash of hints to the heuristic parser. + # Defaults to {:scheme => "http"}. + # @return [Addressable::URI] The parsed URI. + # + # source://addressable//lib/addressable/uri.rb#191 + def heuristic_parse(uri, hints = T.unsafe(nil)); end + + # Returns an array of known ip-based schemes. These schemes typically + # use a similar URI form: + # //:@:/ + # + # source://addressable//lib/addressable/uri.rb#1369 + def ip_based_schemes; end + + # Joins several URIs together. + # + # @example + # base = "http://example.com/" + # uri = Addressable::URI.parse("relative/path") + # Addressable::URI.join(base, uri) + # #=> # + # @param *uris [String, Addressable::URI, #to_str] The URIs to join. + # @return [Addressable::URI] The joined URI. + # + # source://addressable//lib/addressable/uri.rb#343 + def join(*uris); end + + # Normalizes the encoding of a URI component. + # + # @example + # Addressable::URI.normalize_component("simpl%65/%65xampl%65", "b-zB-Z") + # => "simple%2Fex%61mple" + # Addressable::URI.normalize_component( + # "simpl%65/%65xampl%65", /[^b-zB-Z]/ + # ) + # => "simple%2Fex%61mple" + # Addressable::URI.normalize_component( + # "simpl%65/%65xampl%65", + # Addressable::URI::CharacterClasses::UNRESERVED + # ) + # => "simple%2Fexample" + # Addressable::URI.normalize_component( + # "one%20two%2fthree%26four", + # "0-9a-zA-Z &/", + # "/" + # ) + # => "one two%2Fthree&four" + # @param component [String, #to_str] The URI component to encode. + # @param character_class [String, Regexp] The characters which are not percent encoded. If a String + # is passed, the String must be formatted as a regular + # expression character class. (Do not include the surrounding square + # brackets.) For example, "b-zB-Z0-9" would cause + # everything but the letters 'b' through 'z' and the numbers '0' + # through '9' to be percent encoded. If a Regexp is passed, + # the value /[^b-zB-Z0-9]/ would have the same effect. A + # set of useful String values may be found in the + # Addressable::URI::CharacterClasses module. The default + # value is the reserved plus unreserved character classes specified in + # RFC 3986. + # @param leave_encoded [String] When character_class is a String then + # leave_encoded is a string of characters that should remain + # percent encoded while normalizing the component; if they appear percent + # encoded in the original component, then they will be upcased ("%2f" + # normalized to "%2F") but otherwise left alone. + # @return [String] The normalized component. + # + # source://addressable//lib/addressable/uri.rb#552 + def normalize_component(component, character_class = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end + + # Resolves paths to their simplest form. + # + # @param path [String] The path to normalize. + # @return [String] The normalized path. + # + # source://addressable//lib/addressable/uri.rb#2440 + def normalize_path(path); end + + # Normalizes the encoding of a URI. Characters within a hostname are + # not percent encoded to allow for internationalized domain names. + # + # @param uri [String, Addressable::URI, #to_str] The URI to encode. + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @return [String, Addressable::URI] The encoded URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#671 + def normalized_encode(uri, return_type = T.unsafe(nil)); end + + # Returns a URI object based on the parsed string. + # + # @param uri [String, Addressable::URI, #to_str] The URI string to parse. + # No parsing is performed if the object is already an + # Addressable::URI. + # @return [Addressable::URI] The parsed URI. + # + # source://addressable//lib/addressable/uri.rb#114 + def parse(uri); end + + # Returns a hash of common IP-based schemes and their default port + # numbers. Adding new schemes to this hash, as necessary, will allow + # for better URI normalization. + # + # source://addressable//lib/addressable/uri.rb#1376 + def port_mapping; end + + # Unencodes any percent encoded characters within a URI component. + # This method may be used for unencoding either components or full URIs, + # however, it is recommended to use the unencode_component + # alias when unencoding components. + # + # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode. + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character + # in this list is encountered then it will remain percent encoded. + # @return [String, Addressable::URI] The unencoded component or URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#472 + def unencode(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end + + # Unencodes any percent encoded characters within a URI component. + # This method may be used for unencoding either components or full URIs, + # however, it is recommended to use the unencode_component + # alias when unencoding components. + # + # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode. + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character + # in this list is encountered then it will remain percent encoded. + # @return [String, Addressable::URI] The unencoded component or URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#472 + def unencode_component(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end + + # Unencodes any percent encoded characters within a URI component. + # This method may be used for unencoding either components or full URIs, + # however, it is recommended to use the unencode_component + # alias when unencoding components. + # + # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode. + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character + # in this list is encountered then it will remain percent encoded. + # @return [String, Addressable::URI] The unencoded component or URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#472 + def unescape(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end + + # Unencodes any percent encoded characters within a URI component. + # This method may be used for unencoding either components or full URIs, + # however, it is recommended to use the unencode_component + # alias when unencoding components. + # + # @param uri [String, Addressable::URI, #to_str] The URI or component to unencode. + # @param return_type [Class] The type of object to return. + # This value may only be set to String or + # Addressable::URI. All other values are invalid. Defaults + # to String. + # @param leave_encoded [String] A string of characters to leave encoded. If a percent encoded character + # in this list is encountered then it will remain percent encoded. + # @return [String, Addressable::URI] The unencoded component or URI. + # The return type is determined by the return_type + # parameter. + # + # source://addressable//lib/addressable/uri.rb#472 + def unescape_component(uri, return_type = T.unsafe(nil), leave_encoded = T.unsafe(nil)); end + end +end + +# Container for the character classes specified in +# RFC 3986. +# +# Note: Concatenated and interpolated `String`s are not affected by the +# `frozen_string_literal` directive and must be frozen explicitly. +# +# Interpolated `String`s *were* frozen this way before Ruby 3.0: +# https://bugs.ruby-lang.org/issues/17104 +# +# source://addressable//lib/addressable/uri.rb#46 +module Addressable::URI::CharacterClasses; end + +# source://addressable//lib/addressable/uri.rb#47 +Addressable::URI::CharacterClasses::ALPHA = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#57 +Addressable::URI::CharacterClasses::AUTHORITY = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#48 +Addressable::URI::CharacterClasses::DIGIT = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#60 +Addressable::URI::CharacterClasses::FRAGMENT = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#49 +Addressable::URI::CharacterClasses::GEN_DELIMS = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#56 +Addressable::URI::CharacterClasses::HOST = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#58 +Addressable::URI::CharacterClasses::PATH = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#54 +Addressable::URI::CharacterClasses::PCHAR = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#59 +Addressable::URI::CharacterClasses::QUERY = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#51 +Addressable::URI::CharacterClasses::RESERVED = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#53 +Addressable::URI::CharacterClasses::RESERVED_AND_UNRESERVED = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#55 +Addressable::URI::CharacterClasses::SCHEME = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#50 +Addressable::URI::CharacterClasses::SUB_DELIMS = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#52 +Addressable::URI::CharacterClasses::UNRESERVED = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#72 +module Addressable::URI::CharacterClassesRegexps; end + +# source://addressable//lib/addressable/uri.rb#73 +Addressable::URI::CharacterClassesRegexps::AUTHORITY = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#74 +Addressable::URI::CharacterClassesRegexps::FRAGMENT = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#75 +Addressable::URI::CharacterClassesRegexps::HOST = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#76 +Addressable::URI::CharacterClassesRegexps::PATH = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#77 +Addressable::URI::CharacterClassesRegexps::QUERY = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#78 +Addressable::URI::CharacterClassesRegexps::RESERVED = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#79 +Addressable::URI::CharacterClassesRegexps::RESERVED_AND_UNRESERVED = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#80 +Addressable::URI::CharacterClassesRegexps::SCHEME = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#81 +Addressable::URI::CharacterClassesRegexps::UNRESERVED = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#85 +Addressable::URI::EMPTY_STR = T.let(T.unsafe(nil), String) + +# Raised if something other than a uri is supplied. +# +# source://addressable//lib/addressable/uri.rb#34 +class Addressable::URI::InvalidURIError < ::StandardError; end + +# source://addressable//lib/addressable/uri.rb#2598 +module Addressable::URI::NONE; end + +# source://addressable//lib/addressable/uri.rb#1530 +Addressable::URI::NORMPATH = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#63 +module Addressable::URI::NormalizeCharacterClasses; end + +# source://addressable//lib/addressable/uri.rb#68 +Addressable::URI::NormalizeCharacterClasses::FRAGMENT = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#64 +Addressable::URI::NormalizeCharacterClasses::HOST = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#66 +Addressable::URI::NormalizeCharacterClasses::PCHAR = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#69 +Addressable::URI::NormalizeCharacterClasses::QUERY = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#67 +Addressable::URI::NormalizeCharacterClasses::SCHEME = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#65 +Addressable::URI::NormalizeCharacterClasses::UNRESERVED = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#2427 +Addressable::URI::PARENT = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#89 +Addressable::URI::PORT_MAPPING = T.let(T.unsafe(nil), Hash) + +# source://addressable//lib/addressable/uri.rb#2429 +Addressable::URI::RULE_2A = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#2430 +Addressable::URI::RULE_2B_2C = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#2431 +Addressable::URI::RULE_2D = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#2432 +Addressable::URI::RULE_PREFIXED_PARENT = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/uri.rb#2426 +Addressable::URI::SELF_REF = T.let(T.unsafe(nil), String) + +# Tables used to optimize encoding operations in `self.encode_component` +# and `self.normalize_component` +# +# source://addressable//lib/addressable/uri.rb#360 +Addressable::URI::SEQUENCE_ENCODING_TABLE = T.let(T.unsafe(nil), Array) + +# source://addressable//lib/addressable/uri.rb#364 +Addressable::URI::SEQUENCE_UPCASED_PERCENT_ENCODING_TABLE = T.let(T.unsafe(nil), Array) + +# source://addressable//lib/addressable/uri.rb#84 +Addressable::URI::SLASH = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/uri.rb#87 +Addressable::URI::URIREGEX = T.let(T.unsafe(nil), Regexp) + +# source://addressable//lib/addressable/version.rb#23 +module Addressable::VERSION; end + +# source://addressable//lib/addressable/version.rb#24 +Addressable::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/version.rb#25 +Addressable::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# source://addressable//lib/addressable/version.rb#28 +Addressable::VERSION::STRING = T.let(T.unsafe(nil), String) + +# source://addressable//lib/addressable/version.rb#26 +Addressable::VERSION::TINY = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/faraday@2.12.0.rbi b/sorbet/rbi/gems/faraday@2.12.0.rbi new file mode 100644 index 0000000..ad6e1e2 --- /dev/null +++ b/sorbet/rbi/gems/faraday@2.12.0.rbi @@ -0,0 +1,2966 @@ +# 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`. + + +# conn.get '/' +# +# source://faraday//lib/faraday/version.rb#3 +module Faraday + class << self + # @overload default_adapter + # @overload default_adapter= + # + # source://faraday//lib/faraday.rb#55 + def default_adapter; end + + # Documented elsewhere, see default_adapter reader + # + # source://faraday//lib/faraday.rb#102 + def default_adapter=(adapter); end + + # Option for the default_adapter + # @return [Hash] default_adapter options + # + # source://faraday//lib/faraday.rb#59 + def default_adapter_options; end + + # Option for the default_adapter + # @return [Hash] default_adapter options + # + # source://faraday//lib/faraday.rb#59 + def default_adapter_options=(_arg0); end + + # @overload default_connection + # @overload default_connection= + # + # source://faraday//lib/faraday.rb#120 + def default_connection; end + + # Documented below, see default_connection + # + # source://faraday//lib/faraday.rb#62 + def default_connection=(_arg0); end + + # Gets the default connection options used when calling {Faraday#new}. + # + # @return [Faraday::ConnectionOptions] + # + # source://faraday//lib/faraday.rb#127 + def default_connection_options; end + + # Sets the default options used when calling {Faraday#new}. + # + # @param options [Hash, Faraday::ConnectionOptions] + # + # source://faraday//lib/faraday.rb#134 + def default_connection_options=(options); end + + # Tells Faraday to ignore the environment proxy (http_proxy). + # Defaults to `false`. + # + # @return [Boolean] + # + # source://faraday//lib/faraday.rb#67 + def ignore_env_proxy; end + + # Tells Faraday to ignore the environment proxy (http_proxy). + # Defaults to `false`. + # + # @return [Boolean] + # + # source://faraday//lib/faraday.rb#67 + def ignore_env_proxy=(_arg0); end + + # Gets or sets the path that the Faraday libs are loaded from. + # + # @return [String] + # + # source://faraday//lib/faraday.rb#46 + def lib_path; end + + # Gets or sets the path that the Faraday libs are loaded from. + # + # @return [String] + # + # source://faraday//lib/faraday.rb#46 + def lib_path=(_arg0); end + + # Initializes a new {Connection}. + # + # @example With an URL argument + # Faraday.new 'http://faraday.com' + # # => Faraday::Connection to http://faraday.com + # @example With everything in an options hash + # Faraday.new url: 'http://faraday.com', + # params: { page: 1 } + # # => Faraday::Connection to http://faraday.com?page=1 + # @example With an URL argument and an options hash + # Faraday.new 'http://faraday.com', params: { page: 1 } + # # => Faraday::Connection to http://faraday.com?page=1 + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param url [String, Hash] The optional String base URL to use as a prefix + # for all requests. Can also be the options Hash. Any of these + # values will be set on every request made, unless overridden + # for a specific request. + # @param options [Hash] + # @return [Faraday::Connection] + # + # source://faraday//lib/faraday.rb#96 + def new(url = T.unsafe(nil), options = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://faraday//lib/faraday.rb#107 + def respond_to_missing?(symbol, include_private = T.unsafe(nil)); end + + # The root path that Faraday is being loaded from. + # + # This is the root from where the libraries are auto-loaded. + # + # @return [String] + # + # source://faraday//lib/faraday.rb#42 + def root_path; end + + # The root path that Faraday is being loaded from. + # + # This is the root from where the libraries are auto-loaded. + # + # @return [String] + # + # source://faraday//lib/faraday.rb#42 + def root_path=(_arg0); end + + private + + # Internal: Proxies method calls on the Faraday constant to + # .default_connection. + # + # source://faraday//lib/faraday.rb#143 + def method_missing(name, *args, &block); end + end +end + +# Base class for all Faraday adapters. Adapters are +# responsible for fulfilling a Faraday request. +# +# source://faraday//lib/faraday/adapter.rb#6 +class Faraday::Adapter + extend ::Faraday::MiddlewareRegistry + extend ::Faraday::Adapter::Parallelism + + # @return [Adapter] a new instance of Adapter + # + # source://faraday//lib/faraday/adapter.rb#28 + def initialize(_app = T.unsafe(nil), opts = T.unsafe(nil), &block); end + + # source://faraday//lib/faraday/adapter.rb#55 + def call(env); end + + # Close any persistent connections. The adapter should still be usable + # after calling close. + # + # source://faraday//lib/faraday/adapter.rb#50 + def close; end + + # Yields or returns an adapter's configured connection. Depends on + # #build_connection being defined on this adapter. + # + # @param env [Faraday::Env, Hash] The env object for a faraday request. + # @return The return value of the given block, or the HTTP connection object + # if no block is given. + # @yield [conn] + # + # source://faraday//lib/faraday/adapter.rb#41 + def connection(env); end + + private + + # Fetches either a read, write, or open timeout setting. Defaults to the + # :timeout value if a more specific one is not given. + # + # @param type [Symbol] Describes which timeout setting to get: :read, + # :write, or :open. + # @param options [Hash] Hash containing Symbol keys like :timeout, + # :read_timeout, :write_timeout, or :open_timeout + # @return [Integer, nil] Timeout duration in seconds, or nil if no timeout + # has been set. + # + # source://faraday//lib/faraday/adapter.rb#85 + def request_timeout(type, options); end + + # source://faraday//lib/faraday/adapter.rb#62 + def save_response(env, status, body, headers = T.unsafe(nil), reason_phrase = T.unsafe(nil), finished: T.unsafe(nil)); end +end + +# source://faraday//lib/faraday/adapter.rb#9 +Faraday::Adapter::CONTENT_LENGTH = T.let(T.unsafe(nil), String) + +# This module marks an Adapter as supporting parallel requests. +# +# source://faraday//lib/faraday/adapter.rb#12 +module Faraday::Adapter::Parallelism + # source://faraday//lib/faraday/adapter.rb#19 + def inherited(subclass); end + + # Sets the attribute supports_parallel + # + # @param value the value to set the attribute supports_parallel to. + # + # source://faraday//lib/faraday/adapter.rb#13 + def supports_parallel=(_arg0); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/adapter.rb#15 + def supports_parallel?; end +end + +# source://faraday//lib/faraday/adapter.rb#93 +Faraday::Adapter::TIMEOUT_KEYS = T.let(T.unsafe(nil), Hash) + +# @example +# test = Faraday::Connection.new do +# use Faraday::Adapter::Test do |stub| +# # Define matcher to match the request +# stub.get '/resource.json' do +# # return static content +# [200, {'Content-Type' => 'application/json'}, 'hi world'] +# end +# +# # response with content generated based on request +# stub.get '/showget' do |env| +# [200, {'Content-Type' => 'text/plain'}, env[:method].to_s] +# end +# +# # A regular expression can be used as matching filter +# stub.get /\A\/items\/(\d+)\z/ do |env, meta| +# # in case regular expression is used, an instance of MatchData +# # can be received +# [200, +# {'Content-Type' => 'text/plain'}, +# "showing item: #{meta[:match_data][1]}" +# ] +# end +# +# # Test the request body is the same as the stubbed body +# stub.post('/bar', 'name=YK&word=call') { [200, {}, ''] } +# +# # You can pass a proc as a stubbed body and check the request body in your way. +# # In this case, the proc should return true or false. +# stub.post('/foo', ->(request_body) do +# JSON.parse(request_body).slice('name') == { 'name' => 'YK' } }) { [200, {}, ''] +# end +# +# # You can set strict_mode to exactly match the stubbed requests. +# stub.strict_mode = true +# end +# end +# +# resp = test.get '/resource.json' +# resp.body # => 'hi world' +# +# resp = test.get '/showget' +# resp.body # => 'get' +# +# resp = test.get '/items/1' +# resp.body # => 'showing item: 1' +# +# resp = test.get '/items/2' +# resp.body # => 'showing item: 2' +# +# resp = test.post '/bar', 'name=YK&word=call' +# resp.status # => 200 +# +# resp = test.post '/foo', JSON.dump(name: 'YK', created_at: Time.now) +# resp.status # => 200 +# +# source://faraday//lib/faraday/adapter/test.rb#62 +class Faraday::Adapter::Test < ::Faraday::Adapter + # @return [Test] a new instance of Test + # + # source://faraday//lib/faraday/adapter/test.rb#258 + def initialize(app, stubs = T.unsafe(nil), &block); end + + # @param env [Faraday::Env] + # + # source://faraday//lib/faraday/adapter/test.rb#269 + def call(env); end + + # @yield [stubs] + # + # source://faraday//lib/faraday/adapter/test.rb#264 + def configure; end + + # Returns the value of attribute stubs. + # + # source://faraday//lib/faraday/adapter/test.rb#63 + def stubs; end + + # Sets the attribute stubs + # + # @param value the value to set the attribute stubs to. + # + # source://faraday//lib/faraday/adapter/test.rb#63 + def stubs=(_arg0); end +end + +# Stub request +# +# source://faraday//lib/faraday/adapter/test.rb#187 +class Faraday::Adapter::Test::Stub < ::Struct + # Returns the value of attribute block + # + # @return [Object] the current value of block + def block; end + + # Sets the attribute block + # + # @param value [Object] the value to set the attribute block to. + # @return [Object] the newly set value + def block=(_); end + + # Returns the value of attribute body + # + # @return [Object] the current value of body + def body; end + + # Sets the attribute body + # + # @param value [Object] the value to set the attribute body to. + # @return [Object] the newly set value + def body=(_); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/adapter/test.rb#242 + def body_match?(request_body); end + + # Returns the value of attribute headers + # + # @return [Object] the current value of headers + def headers; end + + # Sets the attribute headers + # + # @param value [Object] the value to set the attribute headers to. + # @return [Object] the newly set value + def headers=(_); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/adapter/test.rb#227 + def headers_match?(request_headers); end + + # Returns the value of attribute host + # + # @return [Object] the current value of host + def host; end + + # Sets the attribute host + # + # @param value [Object] the value to set the attribute host to. + # @return [Object] the newly set value + def host=(_); end + + # @param env [Faraday::Env] + # @return [Boolean] + # + # source://faraday//lib/faraday/adapter/test.rb#189 + def matches?(env); end + + # @param env [Faraday::Env] + # @return [Boolean] + # + # source://faraday//lib/faraday/adapter/test.rb#214 + def params_match?(env); end + + # Returns the value of attribute path + # + # @return [Object] the current value of path + def path; end + + # Sets the attribute path + # + # @param value [Object] the value to set the attribute path to. + # @return [Object] the newly set value + def path=(_); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/adapter/test.rb#205 + def path_match?(request_path, meta); end + + # Returns the value of attribute query + # + # @return [Object] the current value of query + def query; end + + # Sets the attribute query + # + # @param value [Object] the value to set the attribute query to. + # @return [Object] the newly set value + def query=(_); end + + # Returns the value of attribute strict_mode + # + # @return [Object] the current value of strict_mode + def strict_mode; end + + # Sets the attribute strict_mode + # + # @param value [Object] the value to set the attribute strict_mode to. + # @return [Object] the newly set value + def strict_mode=(_); end + + # source://faraday//lib/faraday/adapter/test.rb#253 + def to_s; end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# A stack of Stubs +# +# source://faraday//lib/faraday/adapter/test.rb#66 +class Faraday::Adapter::Test::Stubs + # @return [Stubs] a new instance of Stubs + # @yield [_self] + # @yieldparam _self [Faraday::Adapter::Test::Stubs] the object that the method was called on + # + # source://faraday//lib/faraday/adapter/test.rb#70 + def initialize(strict_mode: T.unsafe(nil)); end + + # source://faraday//lib/faraday/adapter/test.rb#122 + def delete(path, headers = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/adapter/test.rb#79 + def empty?; end + + # source://faraday//lib/faraday/adapter/test.rb#102 + def get(path, headers = T.unsafe(nil), &block); end + + # source://faraday//lib/faraday/adapter/test.rb#106 + def head(path, headers = T.unsafe(nil), &block); end + + # @param env [Faraday::Env] + # + # source://faraday//lib/faraday/adapter/test.rb#84 + def match(env); end + + # source://faraday//lib/faraday/adapter/test.rb#126 + def options(path, headers = T.unsafe(nil), &block); end + + # source://faraday//lib/faraday/adapter/test.rb#118 + def patch(path, body = T.unsafe(nil), headers = T.unsafe(nil), &block); end + + # source://faraday//lib/faraday/adapter/test.rb#110 + def post(path, body = T.unsafe(nil), headers = T.unsafe(nil), &block); end + + # source://faraday//lib/faraday/adapter/test.rb#114 + def put(path, body = T.unsafe(nil), headers = T.unsafe(nil), &block); end + + # Set strict_mode. If the value is true, this adapter tries to find matched requests strictly, + # which means that all of a path, parameters, and headers must be the same as an actual request. + # + # source://faraday//lib/faraday/adapter/test.rb#147 + def strict_mode=(value); end + + # Raises an error if any of the stubbed calls have not been made. + # + # source://faraday//lib/faraday/adapter/test.rb#131 + def verify_stubbed_calls; end + + protected + + # @param stack [Hash] + # @param env [Faraday::Env] + # @return [Boolean] + # + # source://faraday//lib/faraday/adapter/test.rb#177 + def matches?(stack, env); end + + # source://faraday//lib/faraday/adapter/test.rb#158 + def new_stub(request_method, path, headers = T.unsafe(nil), body = T.unsafe(nil), &block); end +end + +# source://faraday//lib/faraday/adapter/test.rb#67 +class Faraday::Adapter::Test::Stubs::NotFound < ::StandardError; end + +# AdapterRegistry registers adapter class names so they can be looked up by a +# String or Symbol name. +# +# source://faraday//lib/faraday/adapter_registry.rb#8 +class Faraday::AdapterRegistry + # @return [AdapterRegistry] a new instance of AdapterRegistry + # + # source://faraday//lib/faraday/adapter_registry.rb#9 + def initialize; end + + # source://faraday//lib/faraday/adapter_registry.rb#14 + def get(name); end + + # source://faraday//lib/faraday/adapter_registry.rb#23 + def set(klass, name = T.unsafe(nil)); end +end + +# Raised by Faraday::Response::RaiseError in case of a 400 response. +# +# source://faraday//lib/faraday/error.rb#96 +class Faraday::BadRequestError < ::Faraday::ClientError; end + +# source://faraday//lib/faraday.rb#34 +Faraday::CONTENT_TYPE = T.let(T.unsafe(nil), String) + +# Faraday client error class. Represents 4xx status responses. +# +# source://faraday//lib/faraday/error.rb#92 +class Faraday::ClientError < ::Faraday::Error; end + +# Raised by Faraday::Response::RaiseError in case of a 409 response. +# +# source://faraday//lib/faraday/error.rb#120 +class Faraday::ConflictError < ::Faraday::ClientError; end + +# Connection objects manage the default properties and the middleware +# stack for fulfilling an HTTP request. +# +# @example +# +# conn = Faraday::Connection.new 'http://httpbingo.org' +# +# # GET http://httpbingo.org/nigiri +# conn.get 'nigiri' +# # => # +# +# source://faraday//lib/faraday/connection.rb#15 +class Faraday::Connection + extend ::Forwardable + + # Initializes a new Faraday::Connection. + # + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param url [URI, String] URI or String base URL to use as a prefix for all + # requests (optional). + # @param options [Hash, Faraday::ConnectionOptions] + # @return [Connection] a new instance of Connection + # @yield [self] after all setup has been done + # + # source://faraday//lib/faraday/connection.rb#63 + def initialize(url = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def adapter(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def app(*args, **_arg1, &block); end + + # Build an absolute URL based on url_prefix. + # + # of the resulting url (default: nil). + # + # @param url [String, URI, nil] + # @param params [Faraday::Utils::ParamsHash] A Faraday::Utils::ParamsHash to + # replace the query values + # @return [URI] + # + # source://faraday//lib/faraday/connection.rb#478 + def build_exclusive_url(url = T.unsafe(nil), params = T.unsafe(nil), params_encoder = T.unsafe(nil)); end + + # Creates and configures the request object. + # + # @param method [Symbol] + # @return [Faraday::Request] + # @yield [Faraday::Request] if block given + # + # source://faraday//lib/faraday/connection.rb#461 + def build_request(method); end + + # Takes a relative url for a request and combines it with the defaults + # set on the connection instance. + # + # @example + # conn = Faraday::Connection.new { ... } + # conn.url_prefix = "https://httpbingo.org/api?token=abc" + # conn.scheme # => https + # conn.path_prefix # => "/api" + # + # conn.build_url("nigiri?page=2") + # # => https://httpbingo.org/api/nigiri?token=abc&page=2 + # + # conn.build_url("nigiri", page: 2) + # # => https://httpbingo.org/api/nigiri?token=abc&page=2 + # @param url [String, URI, nil] + # @param extra_params [Hash] + # + # source://faraday//lib/faraday/connection.rb#415 + def build_url(url = T.unsafe(nil), extra_params = T.unsafe(nil)); end + + # @return [Faraday::RackBuilder] Builder for this Connection. + # + # source://faraday//lib/faraday/connection.rb#31 + def builder; end + + # Closes the underlying resources and/or connections. In the case of + # persistent connections, this closes all currently open connections + # but does not prevent new connections from being made. + # + # source://faraday//lib/faraday/connection.rb#125 + def close; end + + # Check if the adapter is parallel-capable. + # + # @api private + # @return [Object, nil] a parallel manager or nil if yielded + # @yield if the adapter isn't parallel-capable, or if no adapter is set yet. + # + # source://faraday//lib/faraday/connection.rb#291 + def default_parallel_manager; end + + # Sets the default parallel manager for this connection. + # + # source://faraday//lib/faraday/connection.rb#40 + def default_parallel_manager=(_arg0); end + + # source://faraday//lib/faraday/connection.rb#199 + def delete(url = T.unsafe(nil), params = T.unsafe(nil), headers = T.unsafe(nil)); end + + # Creates a duplicate of this Faraday::Connection. + # + # @api private + # @return [Faraday::Connection] + # + # source://faraday//lib/faraday/connection.rb#499 + def dup; end + + # source://faraday//lib/faraday/connection.rb#542 + def find_default_proxy; end + + # source://faraday//lib/faraday/connection.rb#199 + def get(url = T.unsafe(nil), params = T.unsafe(nil), headers = T.unsafe(nil)); end + + # source://faraday//lib/faraday/connection.rb#199 + def head(url = T.unsafe(nil), params = T.unsafe(nil), headers = T.unsafe(nil)); end + + # @return [Hash] unencoded HTTP header key/value pairs. + # + # source://faraday//lib/faraday/connection.rb#24 + def headers; end + + # Sets the Hash of unencoded HTTP header key/value pairs. + # + # @param hash [Hash] + # + # source://faraday//lib/faraday/connection.rb#114 + def headers=(hash); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def host(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def host=(*args, **_arg1, &block); end + + # Sets up the parallel manager to make a set of requests. + # + # @param manager [Object] The parallel manager that this Connection's + # Adapter uses. + # @return [void] + # @yield a block to execute multiple requests. + # + # source://faraday//lib/faraday/connection.rb#317 + def in_parallel(manager = T.unsafe(nil), &block); end + + # Determine if this Faraday::Connection can make parallel requests. + # + # @return [Boolean] + # + # source://faraday//lib/faraday/connection.rb#306 + def in_parallel?; end + + # source://faraday//lib/faraday/connection.rb#96 + def initialize_proxy(url, options); end + + # @example + # conn.options '/items/1' + # @overload options + # @overload options + # @return [Faraday::Response] + # @yield [Faraday::Request] for further request customizations + # + # source://faraday//lib/faraday/connection.rb#222 + def options(*args); end + + # @return [Object] the parallel manager for this Connection. + # + # source://faraday//lib/faraday/connection.rb#37 + def parallel_manager; end + + # @return [Hash] URI query unencoded key/value pairs. + # + # source://faraday//lib/faraday/connection.rb#21 + def params; end + + # Sets the Hash of URI query unencoded key/value pairs. + # + # @param hash [Hash] + # + # source://faraday//lib/faraday/connection.rb#108 + def params=(hash); end + + # source://faraday//lib/faraday/connection.rb#279 + def patch(url = T.unsafe(nil), body = T.unsafe(nil), headers = T.unsafe(nil), &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def path_prefix(*args, **_arg1, &block); end + + # Sets the path prefix and ensures that it always has a leading + # slash. + # + # @param value [String] + # @return [String] the new path prefix + # + # source://faraday//lib/faraday/connection.rb#390 + def path_prefix=(value); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def port(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def port=(*args, **_arg1, &block); end + + # source://faraday//lib/faraday/connection.rb#279 + def post(url = T.unsafe(nil), body = T.unsafe(nil), headers = T.unsafe(nil), &block); end + + # @return [Hash] proxy options. + # + # source://faraday//lib/faraday/connection.rb#43 + def proxy; end + + # Sets the Hash proxy options. + # + # @param new_value [Object] + # + # source://faraday//lib/faraday/connection.rb#341 + def proxy=(new_value); end + + # source://faraday//lib/faraday/connection.rb#550 + def proxy_for_request(url); end + + # source://faraday//lib/faraday/connection.rb#522 + def proxy_from_env(url); end + + # source://faraday//lib/faraday/connection.rb#279 + def put(url = T.unsafe(nil), body = T.unsafe(nil), headers = T.unsafe(nil), &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def request(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def response(*args, **_arg1, &block); end + + # Builds and runs the Faraday::Request. + # + # @param method [Symbol] HTTP method. + # @param url [String, URI, nil] String or URI to access. + # @param body [String, Hash, Array, nil] The request body that will eventually be converted to + # a string; middlewares can be used to support more complex types. + # @param headers [Hash, nil] unencoded HTTP header key/value pairs. + # @return [Faraday::Response] + # + # source://faraday//lib/faraday/connection.rb#439 + def run_request(method, url, body, headers); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def scheme(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def scheme=(*args, **_arg1, &block); end + + # source://faraday//lib/faraday/connection.rb#379 + def set_basic_auth(user, password); end + + # @return [Hash] SSL options. + # + # source://faraday//lib/faraday/connection.rb#34 + def ssl; end + + # @return [Boolean] + # + # source://faraday//lib/faraday/connection.rb#560 + def support_parallel?(adapter); end + + # source://faraday//lib/faraday/connection.rb#199 + def trace(url = T.unsafe(nil), params = T.unsafe(nil), headers = T.unsafe(nil)); end + + # @return [String] a URI with the prefix used for all requests from this + # Connection. This includes a default host name, scheme, port, and path. + # + # source://faraday//lib/faraday/connection.rb#28 + def url_prefix; end + + # Parses the given URL with URI and stores the individual + # components in this connection. These components serve as defaults for + # requests made by this connection. + # + # @example + # + # conn = Faraday::Connection.new { ... } + # conn.url_prefix = "https://httpbingo.org/api" + # conn.scheme # => https + # conn.path_prefix # => "/api" + # + # conn.get("nigiri?page=2") # accesses https://httpbingo.org/api/nigiri + # @param url [String, URI] + # @param encoder [Object] + # + # source://faraday//lib/faraday/connection.rb#364 + def url_prefix=(url, encoder = T.unsafe(nil)); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def use(*args, **_arg1, &block); end + + # Yields username and password extracted from a URI if they both exist. + # + # @api private + # @param uri [URI] + # @return [void] + # @yield [username, password] any username and password + # @yieldparam username [String] any username from URI + # @yieldparam password [String] any password from URI + # + # source://faraday//lib/faraday/connection.rb#516 + def with_uri_credentials(uri); end +end + +# A Set of allowed HTTP verbs. +# +# source://faraday//lib/faraday/connection.rb#17 +Faraday::Connection::METHODS = T.let(T.unsafe(nil), Set) + +# source://faraday//lib/faraday/connection.rb#18 +Faraday::Connection::USER_AGENT = T.let(T.unsafe(nil), String) + +# A unified error for failed connections. +# +# source://faraday//lib/faraday/error.rb#151 +class Faraday::ConnectionFailed < ::Faraday::Error; end + +# ConnectionOptions contains the configurable properties for a Faraday +# connection object. +# +# source://faraday//lib/faraday/options/connection_options.rb#8 +class Faraday::ConnectionOptions < ::Faraday::Options + def builder; end + def builder=(_); end + + # source://faraday//lib/faraday/options.rb#178 + def builder_class; end + + def builder_class=(_); end + def headers; end + def headers=(_); end + + # source://faraday//lib/faraday/options/connection_options.rb#19 + def new_builder(block); end + + def parallel_manager; end + def parallel_manager=(_); end + def params; end + def params=(_); end + def proxy; end + def proxy=(_); end + + # source://faraday//lib/faraday/options.rb#178 + def request; end + + def request=(_); end + + # source://faraday//lib/faraday/options.rb#178 + def ssl; end + + def ssl=(_); end + def url; end + def url=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# Sub-module for decoding query-string into parameters. +# +# source://faraday//lib/faraday/encoders/nested_params_encoder.rb#81 +module Faraday::DecodeMethods + # @param query [nil, String] + # @raise [TypeError] if the nesting is incorrect + # @return [Array] the decoded params + # + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#87 + def decode(query); end + + protected + + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#144 + def add_to_context(is_array, context, value, subkey); end + + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#107 + def decode_pair(key, value, context); end + + # Internal: convert a nested hash with purely numeric keys into an array. + # FIXME: this is not compatible with Rack::Utils.parse_nested_query + # + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#151 + def dehash(hash, depth); end + + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#139 + def match_context(context, subkey); end + + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#129 + def new_context(subkey, is_array, context); end + + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#119 + def prepare_context(context, subkey, is_array, last_subkey); end +end + +# source://faraday//lib/faraday/encoders/nested_params_encoder.rb#105 +Faraday::DecodeMethods::SUBKEYS_REGEX = T.let(T.unsafe(nil), Regexp) + +# Sub-module for encoding parameters into query-string. +# +# source://faraday//lib/faraday/encoders/nested_params_encoder.rb#5 +module Faraday::EncodeMethods + # @param params [nil, Array, #to_hash] parameters to be encoded + # @raise [TypeError] if params can not be converted to a Hash + # @return [String] the encoded params + # + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#11 + def encode(params); end + + protected + + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#64 + def encode_array(parent, value); end + + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#53 + def encode_hash(parent, value); end + + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#40 + def encode_pair(parent, value); end +end + +# source://faraday//lib/faraday/options/env.rb#57 +class Faraday::Env < ::Faraday::Options + extend ::Forwardable + + # source://faraday//lib/faraday/options/env.rb#89 + def [](key); end + + # source://faraday//lib/faraday/options/env.rb#101 + def []=(key, value); end + + # string. + # + # @return [String] The request body that will eventually be converted to a + # + # source://faraday//lib/faraday/options/env.rb#118 + def body; end + + # string. + # + # @return [String] The request body that will eventually be converted to a + # + # source://faraday//lib/faraday/options/env.rb#122 + def body=(value); end + + # source://faraday//lib/faraday/options/env.rb#138 + def clear_body; end + + # source://faraday//lib/faraday/options/env.rb#114 + def current_body; end + + # source://faraday//lib/faraday/options/env.rb#184 + def custom_members; end + + # source://faraday//lib/faraday/options/env.rb#190 + def in_member_set?(key); end + + # source://faraday//lib/faraday/options/env.rb#154 + def inspect; end + + # @return [Symbol] HTTP method (`:get`, `:post`) + def method; end + + # @return [Symbol] HTTP method (`:get`, `:post`) + def method=(_); end + + # source://faraday//lib/faraday/options/env.rb#133 + def needs_body?; end + + # source://faraday//lib/faraday/options/env.rb#150 + def parallel?; end + + # @return [Object] sent if the connection is in parallel mode + def parallel_manager; end + + # @return [Object] sent if the connection is in parallel mode + def parallel_manager=(_); end + + # @return [Hash] + def params; end + + # @return [Hash] + def params=(_); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def params_encoder(*args, **_arg1, &block); end + + # source://faraday//lib/faraday/options/env.rb#145 + def parse_body?; end + + # @return [String] + def reason_phrase; end + + # @return [String] + def reason_phrase=(_); end + + # Options for configuring the request. + # + # - `:timeout` - time limit for the entire request (Integer in + # seconds) + # - `:open_timeout` - time limit for just the connection phase (e.g. + # handshake) (Integer in seconds) + # - `:read_timeout` - time limit for the first response byte received from + # the server (Integer in seconds) + # - `:write_timeout` - time limit for the client to send the request to the + # server (Integer in seconds) + # - `:on_data` - Proc for streaming + # - `:proxy` - Hash of proxy options + # - `:uri` - Proxy server URI + # - `:user` - Proxy server username + # - `:password` - Proxy server password + # + # @return [Hash] options for configuring the request. + def request; end + + # Options for configuring the request. + # + # - `:timeout` - time limit for the entire request (Integer in + # seconds) + # - `:open_timeout` - time limit for just the connection phase (e.g. + # handshake) (Integer in seconds) + # - `:read_timeout` - time limit for the first response byte received from + # the server (Integer in seconds) + # - `:write_timeout` - time limit for the client to send the request to the + # server (Integer in seconds) + # - `:on_data` - Proc for streaming + # - `:proxy` - Hash of proxy options + # - `:uri` - Proxy server URI + # - `:user` - Proxy server username + # - `:password` - Proxy server password + # + # @return [Hash] options for configuring the request. + def request=(_); end + + def request_body; end + def request_body=(_); end + + # @return [Hash] HTTP Headers to be sent to the server. + def request_headers; end + + # @return [Hash] HTTP Headers to be sent to the server. + def request_headers=(_); end + + # @return [Response] + def response; end + + # @return [Response] + def response=(_); end + + def response_body; end + def response_body=(_); end + + # @return [Hash] HTTP headers from the server + def response_headers; end + + # @return [Hash] HTTP headers from the server + def response_headers=(_); end + + # @return [Hash] options for configuring SSL requests + def ssl; end + + # @return [Hash] options for configuring SSL requests + def ssl=(_); end + + # @return [Integer] HTTP response status code + def status; end + + # @return [Integer] HTTP response status code + def status=(_); end + + # source://faraday//lib/faraday/options/env.rb#169 + def stream_response(&block); end + + # source://faraday//lib/faraday/options/env.rb#165 + def stream_response?; end + + # source://faraday//lib/faraday/options/env.rb#127 + def success?; end + + # @return [URI] URI instance for the current request. + def url; end + + # @return [URI] URI instance for the current request. + def url=(_); end + + class << self + def [](*_arg0); end + + # source://faraday//lib/faraday/options/env.rb#80 + def from(value); end + + def inspect; end + def keyword_init?; end + + # source://faraday//lib/faraday/options/env.rb#200 + def member_set; end + + def members; end + def new(*_arg0); end + end +end + +# source://faraday//lib/faraday/options/env.rb#61 +Faraday::Env::ContentLength = T.let(T.unsafe(nil), String) + +# source://faraday//lib/faraday/options/env.rb#67 +Faraday::Env::MethodsWithBodies = T.let(T.unsafe(nil), Set) + +# source://faraday//lib/faraday/options/env.rb#62 +Faraday::Env::StatusesWithoutBody = T.let(T.unsafe(nil), Set) + +# source://faraday//lib/faraday/options/env.rb#63 +Faraday::Env::SuccessfulStatuses = T.let(T.unsafe(nil), Range) + +# Faraday error base class. +# +# source://faraday//lib/faraday/error.rb#6 +class Faraday::Error < ::StandardError + # @return [Error] a new instance of Error + # + # source://faraday//lib/faraday/error.rb#9 + def initialize(exc = T.unsafe(nil), response = T.unsafe(nil)); end + + # source://faraday//lib/faraday/error.rb#15 + def backtrace; end + + # source://faraday//lib/faraday/error.rb#23 + def inspect; end + + # Returns the value of attribute response. + # + # source://faraday//lib/faraday/error.rb#7 + def response; end + + # source://faraday//lib/faraday/error.rb#43 + def response_body; end + + # source://faraday//lib/faraday/error.rb#37 + def response_headers; end + + # source://faraday//lib/faraday/error.rb#31 + def response_status; end + + # Returns the value of attribute wrapped_exception. + # + # source://faraday//lib/faraday/error.rb#7 + def wrapped_exception; end + + protected + + # Pulls out potential parent exception and response hash. + # + # source://faraday//lib/faraday/error.rb#81 + def exc_msg_and_response(exc, response = T.unsafe(nil)); end + + # Pulls out potential parent exception and response hash, storing them in + # instance variables. + # exc - Either an Exception, a string message, or a response hash. + # response - Hash + # :status - Optional integer HTTP response status + # :headers - String key/value hash of HTTP response header + # values. + # :body - Optional string HTTP response body. + # :request - Hash + # :method - Symbol with the request HTTP method. + # :url - URI object with the url requested. + # :url_path - String with the url path requested. + # :params - String key/value hash of query params + # present in the request. + # :headers - String key/value hash of HTTP request + # header values. + # :body - String HTTP request body. + # + # If a subclass has to call this, then it should pass a string message + # to `super`. See NilStatusError. + # + # source://faraday//lib/faraday/error.rb#71 + def exc_msg_and_response!(exc, response = T.unsafe(nil)); end +end + +# FlatParamsEncoder manages URI params as a flat hash. Any Array values repeat +# the parameter multiple times. +# +# source://faraday//lib/faraday/encoders/flat_params_encoder.rb#6 +module Faraday::FlatParamsEncoder + class << self + # Decode converts the given URI querystring into a hash. + # + # @example + # + # decode('a=one&a=two&a=three&b=true&c=C') + # # => {"a"=>["one", "two", "three"], "b"=>"true", "c"=>"C"} + # @param query [String] query arguments to parse. + # @return [Hash] parsed keys and value strings from the querystring. + # + # source://faraday//lib/faraday/encoders/flat_params_encoder.rb#74 + def decode(query); end + + # Encode converts the given param into a URI querystring. Keys and values + # will converted to strings and appropriately escaped for the URI. + # + # @example + # + # encode({a: %w[one two three], b: true, c: "C"}) + # # => 'a=one&a=two&a=three&b=true&c=C' + # @param params [Hash] query arguments to convert. + # @return [String] the URI querystring (without the leading '?') + # + # source://faraday//lib/faraday/encoders/flat_params_encoder.rb#23 + def encode(params); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def escape(*args, **_arg1, &block); end + + # Returns the value of attribute sort_params. + # + # source://faraday//lib/faraday/encoders/flat_params_encoder.rb#99 + def sort_params; end + + # Sets the attribute sort_params + # + # @param value the value to set the attribute sort_params to. + # + # source://faraday//lib/faraday/encoders/flat_params_encoder.rb#99 + def sort_params=(_arg0); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def unescape(*args, **_arg1, &block); end + end +end + +# Raised by Faraday::Response::RaiseError in case of a 403 response. +# +# source://faraday//lib/faraday/error.rb#104 +class Faraday::ForbiddenError < ::Faraday::ClientError; end + +# Raised by Faraday::Middleware and subclasses when invalid default_options are used +# +# source://faraday//lib/faraday/error.rb#163 +class Faraday::InitializationError < ::Faraday::Error; end + +# source://faraday//lib/faraday/logging/formatter.rb#6 +module Faraday::Logging; end + +# Serves as an integration point to customize logging +# +# source://faraday//lib/faraday/logging/formatter.rb#8 +class Faraday::Logging::Formatter + extend ::Forwardable + + # @return [Formatter] a new instance of Formatter + # + # source://faraday//lib/faraday/logging/formatter.rb#14 + def initialize(logger:, options:); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def debug(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def error(*args, **_arg1, &block); end + + # source://faraday//lib/faraday/logging/formatter.rb#41 + def exception(exc); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def fatal(*args, **_arg1, &block); end + + # source://faraday//lib/faraday/logging/formatter.rb#52 + def filter(filter_word, filter_replacement); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def info(*args, **_arg1, &block); end + + # source://faraday//lib/faraday/logging/formatter.rb#25 + def request(env); end + + # source://faraday//lib/faraday/logging/formatter.rb#34 + def response(env); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def warn(*args, **_arg1, &block); end + + private + + # source://faraday//lib/faraday/logging/formatter.rb#98 + def apply_filters(output); end + + # source://faraday//lib/faraday/logging/formatter.rb#64 + def dump_body(body); end + + # source://faraday//lib/faraday/logging/formatter.rb#58 + def dump_headers(headers); end + + # source://faraday//lib/faraday/logging/formatter.rb#113 + def log_body(type, body); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/logging/formatter.rb#85 + def log_body?(type); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/logging/formatter.rb#94 + def log_errors?; end + + # source://faraday//lib/faraday/logging/formatter.rb#109 + def log_headers(type, headers); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/logging/formatter.rb#76 + def log_headers?(type); end + + # source://faraday//lib/faraday/logging/formatter.rb#105 + def log_level; end + + # source://faraday//lib/faraday/logging/formatter.rb#72 + def pretty_inspect(body); end +end + +# source://faraday//lib/faraday/logging/formatter.rb#11 +Faraday::Logging::Formatter::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://faraday//lib/faraday/methods.rb#5 +Faraday::METHODS_WITH_BODY = T.let(T.unsafe(nil), Array) + +# source://faraday//lib/faraday/methods.rb#4 +Faraday::METHODS_WITH_QUERY = T.let(T.unsafe(nil), Array) + +# Middleware is the basic base class of any Faraday middleware. +# +# source://faraday//lib/faraday/middleware.rb#7 +class Faraday::Middleware + extend ::Faraday::MiddlewareRegistry + + # @return [Middleware] a new instance of Middleware + # + # source://faraday//lib/faraday/middleware.rb#15 + def initialize(app = T.unsafe(nil), options = T.unsafe(nil)); end + + # Returns the value of attribute app. + # + # source://faraday//lib/faraday/middleware.rb#10 + def app; end + + # source://faraday//lib/faraday/middleware.rb#54 + def call(env); end + + # source://faraday//lib/faraday/middleware.rb#64 + def close; end + + # Returns the value of attribute options. + # + # source://faraday//lib/faraday/middleware.rb#10 + def options; end + + class << self + # default_options attr_reader that initializes class instance variable + # with the values of any Faraday::Middleware defaults, and merges with + # subclass defaults + # + # source://faraday//lib/faraday/middleware.rb#39 + def default_options; end + + # Faraday::Middleware::default_options= allows user to set default options at the Faraday::Middleware + # class level. + # + # my_app/config/initializers/my_faraday_middleware.rb + # + # Faraday::Response::RaiseError.default_options = { include_request: false } + # + # @example Set the Faraday::Response::RaiseError option, `include_request` to `false` + # + # source://faraday//lib/faraday/middleware.rb#29 + def default_options=(options = T.unsafe(nil)); end + + private + + # @raise [Faraday::InitializationError] + # + # source://faraday//lib/faraday/middleware.rb#45 + def validate_default_options(options); end + end +end + +# source://faraday//lib/faraday/middleware.rb#12 +Faraday::Middleware::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://faraday//lib/faraday/middleware.rb#13 +Faraday::Middleware::LOCK = T.let(T.unsafe(nil), Thread::Mutex) + +# Adds the ability for other modules to register and lookup +# middleware classes. +# +# source://faraday//lib/faraday/middleware_registry.rb#8 +module Faraday::MiddlewareRegistry + # Lookup middleware class with a registered Symbol shortcut. + # + # @example + # + # module Faraday + # class Whatever < Middleware + # register_middleware(foo: Whatever) + # end + # end + # + # Faraday::Middleware.lookup_middleware(:foo) + # # => Faraday::Whatever + # @param key [Symbol] key for the registered middleware. + # @raise [Faraday::Error] if given key is not registered + # @return [Class] a middleware Class. + # + # source://faraday//lib/faraday/middleware_registry.rb#55 + def lookup_middleware(key); end + + # Register middleware class(es) on the current module. + # + # @example Lookup by a constant + # + # module Faraday + # class Whatever < Middleware + # # Middleware looked up by :foo returns Faraday::Whatever::Foo. + # register_middleware(foo: Whatever) + # end + # end + # @param mappings [Hash] Middleware mappings from a lookup symbol to a middleware class. + # @return [void] + # + # source://faraday//lib/faraday/middleware_registry.rb#26 + def register_middleware(**mappings); end + + # source://faraday//lib/faraday/middleware_registry.rb#9 + def registered_middleware; end + + # Unregister a previously registered middleware class. + # + # @param key [Symbol] key for the registered middleware. + # + # source://faraday//lib/faraday/middleware_registry.rb#35 + def unregister_middleware(key); end + + private + + # source://faraday//lib/faraday/middleware_registry.rb#67 + def load_middleware(key); end + + # source://faraday//lib/faraday/middleware_registry.rb#62 + def middleware_mutex(&block); end +end + +# This is the default encoder for Faraday requests. +# Using this encoder, parameters will be encoded respecting their structure, +# so you can send objects such as Arrays or Hashes as parameters +# for your requests. +# +# source://faraday//lib/faraday/encoders/nested_params_encoder.rb#168 +module Faraday::NestedParamsEncoder + extend ::Faraday::EncodeMethods + extend ::Faraday::DecodeMethods + + class << self + # Returns the value of attribute array_indices. + # + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#170 + def array_indices; end + + # Sets the attribute array_indices + # + # @param value the value to set the attribute array_indices to. + # + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#170 + def array_indices=(_arg0); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def escape(*args, **_arg1, &block); end + + # Returns the value of attribute sort_params. + # + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#170 + def sort_params; end + + # Sets the attribute sort_params + # + # @param value the value to set the attribute sort_params to. + # + # source://faraday//lib/faraday/encoders/nested_params_encoder.rb#170 + def sort_params=(_arg0); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def unescape(*args, **_arg1, &block); end + end +end + +# Raised by Faraday::Response::RaiseError in case of a nil status in response. +# +# source://faraday//lib/faraday/error.rb#143 +class Faraday::NilStatusError < ::Faraday::ServerError + # @return [NilStatusError] a new instance of NilStatusError + # + # source://faraday//lib/faraday/error.rb#144 + def initialize(exc, response = T.unsafe(nil)); end +end + +# Subclasses Struct with some special helpers for converting from a Hash to +# a Struct. +# +# source://faraday//lib/faraday/options.rb#6 +class Faraday::Options < ::Struct + # source://faraday//lib/faraday/options.rb#186 + def [](key); end + + # Public + # + # source://faraday//lib/faraday/options.rb#46 + def clear; end + + # Public + # + # source://faraday//lib/faraday/options.rb#71 + def deep_dup; end + + # Public + # + # source://faraday//lib/faraday/options.rb#39 + def delete(key); end + + # Public + # + # source://faraday//lib/faraday/options.rb#13 + def each; end + + # Public + # + # source://faraday//lib/faraday/options.rb#106 + def each_key(&block); end + + # Public + # + # source://faraday//lib/faraday/options.rb#120 + def each_value(&block); end + + # Public + # + # @return [Boolean] + # + # source://faraday//lib/faraday/options.rb#101 + def empty?; end + + # Public + # + # source://faraday//lib/faraday/options.rb#76 + def fetch(key, *args); end + + # Public + # + # @return [Boolean] + # + # source://faraday//lib/faraday/options.rb#113 + def has_key?(key); end + + # Public + # + # @return [Boolean] + # + # source://faraday//lib/faraday/options.rb#127 + def has_value?(value); end + + # Internal + # + # source://faraday//lib/faraday/options.rb#144 + def inspect; end + + # Public + # + # @return [Boolean] + # + # source://faraday//lib/faraday/options.rb#113 + def key?(key); end + + # Public + # + # source://faraday//lib/faraday/options.rb#96 + def keys; end + + # Public + # + # source://faraday//lib/faraday/options.rb#66 + def merge(other); end + + # Public + # + # source://faraday//lib/faraday/options.rb#51 + def merge!(other); end + + # source://faraday//lib/faraday/options.rb#195 + def symbolized_key_set; end + + # Public + # + # source://faraday//lib/faraday/options.rb#134 + def to_hash; end + + # Public + # + # source://faraday//lib/faraday/options.rb#22 + def update(obj); end + + # Public + # + # @return [Boolean] + # + # source://faraday//lib/faraday/options.rb#127 + def value?(value); end + + # Public + # + # source://faraday//lib/faraday/options.rb#91 + def values_at(*keys); end + + class << self + # Internal + # + # source://faraday//lib/faraday/options.rb#166 + def attribute_options; end + + # source://faraday//lib/faraday/options.rb#205 + def fetch_error_class; end + + # Public + # + # source://faraday//lib/faraday/options.rb#8 + def from(value); end + + # @private + # + # source://faraday//lib/faraday/options.rb#199 + def inherited(subclass); end + + # source://faraday//lib/faraday/options.rb#170 + def memoized(key, &block); end + + # source://faraday//lib/faraday/options.rb#182 + def memoized_attributes; end + + # Internal + # + # source://faraday//lib/faraday/options.rb#156 + def options(mapping); end + + # Internal + # + # source://faraday//lib/faraday/options.rb#161 + def options_for(key); end + end +end + +# Raised by middlewares that parse the response, like the JSON response middleware. +# +# source://faraday//lib/faraday/error.rb#159 +class Faraday::ParsingError < ::Faraday::Error; end + +# Raised by Faraday::Response::RaiseError in case of a 407 response. +# +# source://faraday//lib/faraday/error.rb#112 +class Faraday::ProxyAuthError < ::Faraday::ClientError; end + +# ProxyOptions contains the configurable properties for the proxy +# configuration used when making an HTTP request. +# +# source://faraday//lib/faraday/options/proxy_options.rb#8 +class Faraday::ProxyOptions < ::Faraday::Options + extend ::Forwardable + + # source://forwardable/1.3.3/forwardable.rb#231 + def host(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def host=(*args, **_arg1, &block); end + + # source://faraday//lib/faraday/options.rb#178 + def password; end + + def password=(_); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def path(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def path=(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def port(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def port=(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def scheme(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def scheme=(*args, **_arg1, &block); end + + def uri; end + def uri=(_); end + + # source://faraday//lib/faraday/options.rb#178 + def user; end + + def user=(_); end + + class << self + def [](*_arg0); end + + # source://faraday//lib/faraday/options/proxy_options.rb#13 + def from(value); end + + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# A Builder that processes requests into responses by passing through an inner +# middleware stack (heavily inspired by Rack). +# +# @example +# Faraday::Connection.new(url: 'http://httpbingo.org') do |builder| +# builder.request :url_encoded # Faraday::Request::UrlEncoded +# builder.adapter :net_http # Faraday::Adapter::NetHttp +# end +# +# source://faraday//lib/faraday/rack_builder.rb#14 +class Faraday::RackBuilder + # @return [RackBuilder] a new instance of RackBuilder + # + # source://faraday//lib/faraday/rack_builder.rb#60 + def initialize(&block); end + + # source://faraday//lib/faraday/rack_builder.rb#178 + def ==(other); end + + # source://faraday//lib/faraday/rack_builder.rb#78 + def [](idx); end + + # source://faraday//lib/faraday/rack_builder.rb#109 + def adapter(klass = T.unsafe(nil), *args, **_arg2, &block); end + + # The "rack app" wrapped in middleware. All requests are sent here. + # + # The builder is responsible for creating the app object. After this, + # the builder gets locked to ensure no further modifications are made + # to the middleware stack. + # + # Returns an object that responds to `call` and returns a Response. + # + # source://faraday//lib/faraday/rack_builder.rb#162 + def app; end + + # source://faraday//lib/faraday/rack_builder.rb#72 + def build; end + + # ENV Keys + # :http_method - a symbolized request HTTP method (:get, :post) + # :body - the request body that will eventually be converted to a string. + # :url - URI instance for the current request. + # :status - HTTP response status code + # :request_headers - hash of HTTP Headers to be sent to the server + # :response_headers - Hash of HTTP headers from the server + # :parallel_manager - sent if the connection is in parallel mode + # :request - Hash of options for configuring the request. + # :timeout - open/read timeout Integer in seconds + # :open_timeout - read timeout Integer in seconds + # :proxy - Hash of proxy options + # :uri - Proxy Server URI + # :user - Proxy server username + # :password - Proxy server password + # :ssl - Hash of options for configuring SSL requests. + # + # source://faraday//lib/faraday/rack_builder.rb#200 + def build_env(connection, request); end + + # Processes a Request into a Response by passing it through this Builder's + # middleware stack. + # + # @param connection [Faraday::Connection] + # @param request [Faraday::Request] + # @return [Faraday::Response] + # + # source://faraday//lib/faraday/rack_builder.rb#151 + def build_response(connection, request); end + + # source://faraday//lib/faraday/rack_builder.rb#139 + def delete(handler); end + + # Returns the value of attribute handlers. + # + # source://faraday//lib/faraday/rack_builder.rb#18 + def handlers; end + + # Sets the attribute handlers + # + # @param value the value to set the attribute handlers to. + # + # source://faraday//lib/faraday/rack_builder.rb#18 + def handlers=(_arg0); end + + # methods to push onto the various positions in the stack: + # + # source://faraday//lib/faraday/rack_builder.rb#118 + def insert(index, *args, **_arg2, &block); end + + # source://faraday//lib/faraday/rack_builder.rb#127 + def insert_after(index, *args, **_arg2, &block); end + + # methods to push onto the various positions in the stack: + # + # source://faraday//lib/faraday/rack_builder.rb#118 + def insert_before(index, *args, **_arg2, &block); end + + # Locks the middleware stack to ensure no further modifications are made. + # + # source://faraday//lib/faraday/rack_builder.rb#83 + def lock!; end + + # @return [Boolean] + # + # source://faraday//lib/faraday/rack_builder.rb#87 + def locked?; end + + # source://faraday//lib/faraday/rack_builder.rb#101 + def request(key, *args, **_arg2, &block); end + + # source://faraday//lib/faraday/rack_builder.rb#105 + def response(key, *args, **_arg2, &block); end + + # source://faraday//lib/faraday/rack_builder.rb#132 + def swap(index, *args, **_arg2, &block); end + + # source://faraday//lib/faraday/rack_builder.rb#170 + def to_app; end + + # source://faraday//lib/faraday/rack_builder.rb#91 + def use(klass, *args, **_arg2, &block); end + + private + + # @return [Boolean] + # + # source://faraday//lib/faraday/rack_builder.rb#232 + def adapter_set?; end + + # source://faraday//lib/faraday/rack_builder.rb#244 + def assert_index(index); end + + # @raise [MISSING_ADAPTER_ERROR] + # + # source://faraday//lib/faraday/rack_builder.rb#228 + def ensure_adapter!; end + + # source://faraday//lib/faraday/rack_builder.rb#66 + def initialize_dup(original); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/rack_builder.rb#236 + def is_adapter?(klass); end + + # source://faraday//lib/faraday/rack_builder.rb#222 + def raise_if_adapter(klass); end + + # @raise [StackLocked] + # + # source://faraday//lib/faraday/rack_builder.rb#218 + def raise_if_locked; end + + # source://faraday//lib/faraday/rack_builder.rb#240 + def use_symbol(mod, key, *args, **_arg3, &block); end +end + +# borrowed from ActiveSupport::Dependencies::Reference & +# ActionDispatch::MiddlewareStack::Middleware +# +# source://faraday//lib/faraday/rack_builder.rb#25 +class Faraday::RackBuilder::Handler + # source://faraday//lib/faraday/rack_builder.rb#30 + def initialize(klass, *args, **_arg2, &block); end + + # source://faraday//lib/faraday/rack_builder.rb#45 + def ==(other); end + + # source://faraday//lib/faraday/rack_builder.rb#55 + def build(app = T.unsafe(nil)); end + + # source://faraday//lib/faraday/rack_builder.rb#41 + def inspect; end + + # source://faraday//lib/faraday/rack_builder.rb#37 + def klass; end + + # Returns the value of attribute name. + # + # source://faraday//lib/faraday/rack_builder.rb#28 + def name; end +end + +# source://faraday//lib/faraday/rack_builder.rb#26 +Faraday::RackBuilder::Handler::REGISTRY = T.let(T.unsafe(nil), Faraday::AdapterRegistry) + +# source://faraday//lib/faraday/rack_builder.rb#213 +Faraday::RackBuilder::LOCK_ERR = T.let(T.unsafe(nil), String) + +# source://faraday//lib/faraday/rack_builder.rb#214 +Faraday::RackBuilder::MISSING_ADAPTER_ERROR = T.let(T.unsafe(nil), String) + +# Used to detect missing arguments +# +# source://faraday//lib/faraday/rack_builder.rb#16 +Faraday::RackBuilder::NO_ARGUMENT = T.let(T.unsafe(nil), Object) + +# Error raised when trying to modify the stack after calling `lock!` +# +# source://faraday//lib/faraday/rack_builder.rb#21 +class Faraday::RackBuilder::StackLocked < ::RuntimeError; end + +# Used to setup URLs, params, headers, and the request body in a sane manner. +# +# @example +# @connection.post do |req| +# req.url 'http://localhost', 'a' => '1' # 'http://localhost?a=1' +# req.headers['b'] = '2' # Header +# req.params['c'] = '3' # GET Param +# req['b'] = '2' # also Header +# req.body = 'abc' +# end +# +# source://faraday//lib/faraday/request.rb#27 +class Faraday::Request < ::Struct + extend ::Faraday::MiddlewareRegistry + + # @param key [Object] key to look up in headers + # @return [Object] value of the given header name + # + # source://faraday//lib/faraday/request.rb#92 + def [](key); end + + # @param key [Object] key of header to write + # @param value [Object] value of header + # + # source://faraday//lib/faraday/request.rb#98 + def []=(key, value); end + + # @return [String] body + def body; end + + # @return [String] body + def body=(_); end + + # @return [Faraday::Utils::Headers] headers + def headers; end + + # Replace request headers, preserving the existing hash type. + # + # @param hash [Hash] new headers + # + # source://faraday//lib/faraday/request.rb#61 + def headers=(hash); end + + # @return [Symbol] the HTTP method of the Request + def http_method; end + + # @return [Symbol] the HTTP method of the Request + def http_method=(_); end + + # Marshal serialization support. + # + # @return [Hash] the hash ready to be serialized in Marshal. + # + # source://faraday//lib/faraday/request.rb#105 + def marshal_dump; end + + # Marshal serialization support. + # Restores the instance variables according to the +serialised+. + # + # @param serialised [Hash] the serialised object. + # + # source://faraday//lib/faraday/request.rb#119 + def marshal_load(serialised); end + + # @return [RequestOptions] options + def options; end + + # @return [RequestOptions] options + def options=(_); end + + # @return [Hash] query parameters + def params; end + + # Replace params, preserving the existing hash type. + # + # @param hash [Hash] new params + # + # source://faraday//lib/faraday/request.rb#49 + def params=(hash); end + + # @return [URI, String] the path + def path; end + + # @return [URI, String] the path + def path=(_); end + + # @return [Env] the Env for this Request + # + # source://faraday//lib/faraday/request.rb#129 + def to_env(connection); end + + # Update path and params. + # + # @param path [URI, String] + # @param params [Hash, nil] + # @return [void] + # + # source://faraday//lib/faraday/request.rb#74 + def url(path, params = T.unsafe(nil)); end + + private + + def member_get(_arg0); end + def member_set(_arg0, _arg1); end + + class << self + def [](*_arg0); end + + # @param request_method [String] + # @return [Request] + # @yield [request] for block customization, if block given + # @yieldparam request [Request] + # + # source://faraday//lib/faraday/request.rb#39 + def create(request_method); end + + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# Request middleware for the Authorization HTTP header +# +# source://faraday//lib/faraday/request/authorization.rb#6 +class Faraday::Request::Authorization < ::Faraday::Middleware + # @param app [#call] + # @param type [String, Symbol] Type of Authorization + # @param params [Array] parameters to build the Authorization header. + # If the type is `:basic`, then these can be a login and password pair. + # Otherwise, a single value is expected that will be appended after the type. + # This value can be a proc or an object responding to `.call`, in which case + # it will be invoked on each request. + # @return [Authorization] a new instance of Authorization + # + # source://faraday//lib/faraday/request/authorization.rb#16 + def initialize(app, type, *params); end + + # @param env [Faraday::Env] + # + # source://faraday//lib/faraday/request/authorization.rb#23 + def on_request(env); end + + private + + # @param type [String, Symbol] + # @param env [Faraday::Env] + # @param params [Array] + # @return [String] a header value + # + # source://faraday//lib/faraday/request/authorization.rb#35 + def header_from(type, env, *params); end +end + +# source://faraday//lib/faraday/request/authorization.rb#7 +Faraday::Request::Authorization::KEY = T.let(T.unsafe(nil), String) + +# Middleware for instrumenting Requests. +# +# source://faraday//lib/faraday/request/instrumentation.rb#6 +class Faraday::Request::Instrumentation < ::Faraday::Middleware + # Instruments requests using Active Support. + # + # Measures time spent only for synchronous requests. + # + # @example Using ActiveSupport::Notifications to measure time spent + # for Faraday requests. + # ActiveSupport::Notifications + # .subscribe('request.faraday') do |name, starts, ends, _, env| + # url = env[:url] + # http_method = env[:method].to_s.upcase + # duration = ends - starts + # $stderr.puts '[%s] %s %s (%.3f s)' % + # [url.host, http_method, url.request_uri, duration] + # end + # @option options + # @option options + # @param app [#call] + # @param options [nil, Hash] Options hash + # @return [Instrumentation] a new instance of Instrumentation + # + # source://faraday//lib/faraday/request/instrumentation.rb#42 + def initialize(app, options = T.unsafe(nil)); end + + # @param env [Faraday::Env] + # + # source://faraday//lib/faraday/request/instrumentation.rb#49 + def call(env); end +end + +# Options class used in Request::Instrumentation class. +# +# source://faraday//lib/faraday/request/instrumentation.rb#8 +class Faraday::Request::Instrumentation::Options < ::Faraday::Options + # source://faraday//lib/faraday/request/instrumentation.rb#17 + def instrumenter; end + + def instrumenter=(_); end + + # source://faraday//lib/faraday/request/instrumentation.rb#11 + def name; end + + def name=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# Request middleware that encodes the body as JSON. +# +# Processes only requests with matching Content-type or those without a type. +# If a request doesn't have a type but has a body, it sets the Content-type +# to JSON MIME-type. +# +# Doesn't try to encode bodies that already are in string form. +# +# source://faraday//lib/faraday/request/json.rb#14 +class Faraday::Request::Json < ::Faraday::Middleware + # source://faraday//lib/faraday/request/json.rb#18 + def on_request(env); end + + private + + # @return [Boolean] + # + # source://faraday//lib/faraday/request/json.rb#48 + def body?(env); end + + # source://faraday//lib/faraday/request/json.rb#26 + def encode(data); end + + # @yield [] + # + # source://faraday//lib/faraday/request/json.rb#36 + def match_content_type(env); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/request/json.rb#43 + def process_request?(env); end + + # source://faraday//lib/faraday/request/json.rb#61 + def request_type(env); end +end + +# source://faraday//lib/faraday/request/json.rb#15 +Faraday::Request::Json::MIME_TYPE = T.let(T.unsafe(nil), String) + +# source://faraday//lib/faraday/request/json.rb#16 +Faraday::Request::Json::MIME_TYPE_REGEX = T.let(T.unsafe(nil), Regexp) + +# Middleware for supporting urlencoded requests. +# +# source://faraday//lib/faraday/request/url_encoded.rb#6 +class Faraday::Request::UrlEncoded < ::Faraday::Middleware + # Encodes as "application/x-www-form-urlencoded" if not already encoded or + # of another type. + # + # @param env [Faraday::Env] + # + # source://faraday//lib/faraday/request/url_encoded.rb#20 + def call(env); end + + # @param env [Faraday::Env] + # @yield [request_body] Body of the request + # + # source://faraday//lib/faraday/request/url_encoded.rb#30 + def match_content_type(env); end + + # @param env [Faraday::Env] + # @return [Boolean] True if the request has a body and its Content-Type is + # urlencoded. + # + # source://faraday//lib/faraday/request/url_encoded.rb#43 + def process_request?(env); end + + # @param env [Faraday::Env] + # @return [String] + # + # source://faraday//lib/faraday/request/url_encoded.rb#51 + def request_type(env); end + + class << self + # Returns the value of attribute mime_type. + # + # source://faraday//lib/faraday/request/url_encoded.rb#12 + def mime_type; end + + # Sets the attribute mime_type + # + # @param value the value to set the attribute mime_type to. + # + # source://faraday//lib/faraday/request/url_encoded.rb#12 + def mime_type=(_arg0); end + end +end + +# source://faraday//lib/faraday/request/url_encoded.rb#8 +Faraday::Request::UrlEncoded::CONTENT_TYPE = T.let(T.unsafe(nil), String) + +# RequestOptions contains the configurable properties for a Faraday request. +# +# source://faraday//lib/faraday/options/request_options.rb#7 +class Faraday::RequestOptions < ::Faraday::Options + # source://faraday//lib/faraday/options/request_options.rb#11 + def []=(key, value); end + + def bind; end + def bind=(_); end + def boundary; end + def boundary=(_); end + def context; end + def context=(_); end + def oauth; end + def oauth=(_); end + def on_data; end + def on_data=(_); end + def open_timeout; end + def open_timeout=(_); end + def params_encoder; end + def params_encoder=(_); end + def proxy; end + def proxy=(_); end + def read_timeout; end + def read_timeout=(_); end + + # source://faraday//lib/faraday/options/request_options.rb#19 + def stream_response?; end + + def timeout; end + def timeout=(_); end + def write_timeout; end + def write_timeout=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# Raised by Faraday::Response::RaiseError in case of a 408 response. +# +# source://faraday//lib/faraday/error.rb#116 +class Faraday::RequestTimeoutError < ::Faraday::ClientError; end + +# Raised by Faraday::Response::RaiseError in case of a 404 response. +# +# source://faraday//lib/faraday/error.rb#108 +class Faraday::ResourceNotFound < ::Faraday::ClientError; end + +# Response represents an HTTP response from making an HTTP request. +# +# source://faraday//lib/faraday/response.rb#7 +class Faraday::Response + extend ::Forwardable + extend ::Faraday::MiddlewareRegistry + + # @return [Response] a new instance of Response + # + # source://faraday//lib/faraday/response.rb#11 + def initialize(env = T.unsafe(nil)); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def [](*args, **_arg1, &block); end + + # Expand the env with more properties, without overriding existing ones. + # Useful for applying request params after restoring a marshalled Response. + # + # source://faraday//lib/faraday/response.rb#80 + def apply_request(request_env); end + + # source://faraday//lib/faraday/response.rb#32 + def body; end + + # Returns the value of attribute env. + # + # source://faraday//lib/faraday/response.rb#16 + def env; end + + # source://faraday//lib/faraday/response.rb#49 + def finish(env); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/response.rb#36 + def finished?; end + + # source://faraday//lib/faraday/response.rb#26 + def headers; end + + # because @on_complete_callbacks cannot be marshalled + # + # source://faraday//lib/faraday/response.rb#70 + def marshal_dump; end + + # source://faraday//lib/faraday/response.rb#74 + def marshal_load(env); end + + # source://faraday//lib/faraday/response.rb#40 + def on_complete(&block); end + + # source://faraday//lib/faraday/response.rb#22 + def reason_phrase; end + + # source://faraday//lib/faraday/response.rb#18 + def status; end + + # @return [Boolean] + # + # source://faraday//lib/faraday/response.rb#57 + def success?; end + + # source://faraday//lib/faraday/response.rb#61 + def to_hash; end +end + +# Parse response bodies as JSON. +# +# source://faraday//lib/faraday/response/json.rb#8 +class Faraday::Response::Json < ::Faraday::Middleware + # @return [Json] a new instance of Json + # + # source://faraday//lib/faraday/response/json.rb#9 + def initialize(app = T.unsafe(nil), parser_options: T.unsafe(nil), content_type: T.unsafe(nil), preserve_raw: T.unsafe(nil)); end + + # source://faraday//lib/faraday/response/json.rb#18 + def on_complete(env); end + + private + + # source://faraday//lib/faraday/response/json.rb#31 + def parse(body); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/response/json.rb#39 + def parse_response?(env); end + + # source://faraday//lib/faraday/response/json.rb#57 + def process_parser_options; end + + # source://faraday//lib/faraday/response/json.rb#24 + def process_response(env); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/response/json.rb#44 + def process_response_type?(env); end + + # source://faraday//lib/faraday/response/json.rb#51 + def response_type(env); end +end + +# Logger is a middleware that logs internal events in the HTTP request +# lifecycle to a given Logger object. By default, this logs to STDOUT. See +# Faraday::Logging::Formatter to see specifically what is logged. +# +# source://faraday//lib/faraday/response/logger.rb#12 +class Faraday::Response::Logger < ::Faraday::Middleware + # @return [Logger] a new instance of Logger + # @yield [@formatter] + # + # source://faraday//lib/faraday/response/logger.rb#13 + def initialize(app, logger = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://faraday//lib/faraday/response/logger.rb#21 + def call(env); end + + # source://faraday//lib/faraday/response/logger.rb#26 + def on_complete(env); end + + # source://faraday//lib/faraday/response/logger.rb#30 + def on_error(exc); end +end + +# RaiseError is a Faraday middleware that raises exceptions on common HTTP +# client or server error responses. +# +# source://faraday//lib/faraday/response/raise_error.rb#7 +class Faraday::Response::RaiseError < ::Faraday::Middleware + # source://faraday//lib/faraday/response/raise_error.rb#25 + def on_complete(env); end + + # source://faraday//lib/faraday/response/raise_error.rb#75 + def query_params(env); end + + # Returns a hash of response data with the following keys: + # - status + # - headers + # - body + # - request + # + # The `request` key is omitted when the middleware is explicitly + # configured with the option `include_request: false`. + # + # source://faraday//lib/faraday/response/raise_error.rb#52 + def response_values(env); end +end + +# source://faraday//lib/faraday/response/raise_error.rb#9 +Faraday::Response::RaiseError::ClientErrorStatuses = T.let(T.unsafe(nil), Range) + +# source://faraday//lib/faraday/response/raise_error.rb#11 +Faraday::Response::RaiseError::ClientErrorStatusesWithCustomExceptions = T.let(T.unsafe(nil), Hash) + +# source://faraday//lib/faraday/response/raise_error.rb#23 +Faraday::Response::RaiseError::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://faraday//lib/faraday/response/raise_error.rb#10 +Faraday::Response::RaiseError::ServerErrorStatuses = T.let(T.unsafe(nil), Range) + +# A unified client error for SSL errors. +# +# source://faraday//lib/faraday/error.rb#155 +class Faraday::SSLError < ::Faraday::Error; end + +# SSL-related options. +# +# source://faraday//lib/faraday/options/ssl_options.rb#53 +class Faraday::SSLOptions < ::Faraday::Options + # @return [String] CA file + def ca_file; end + + # @return [String] CA file + def ca_file=(_); end + + # @return [String] CA path + def ca_path; end + + # @return [String] CA path + def ca_path=(_); end + + # @return [OpenSSL::X509::Store] certificate store + def cert_store; end + + # @return [OpenSSL::X509::Store] certificate store + def cert_store=(_); end + + # @return [OpenSSL::X509::Certificate] certificate (Excon only) + def certificate; end + + # @return [OpenSSL::X509::Certificate] certificate (Excon only) + def certificate=(_); end + + # @return [String] cipher list in OpenSSL format (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-ciphers-3D) + def ciphers; end + + # @return [String] cipher list in OpenSSL format (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-ciphers-3D) + def ciphers=(_); end + + # @return [String, OpenSSL::X509::Certificate] client certificate + def client_cert; end + + # @return [String, OpenSSL::X509::Certificate] client certificate + def client_cert=(_); end + + # @return [String, OpenSSL::PKey::RSA, OpenSSL::PKey::DSA] client key + def client_key; end + + # @return [String, OpenSSL::PKey::RSA, OpenSSL::PKey::DSA] client key + def client_key=(_); end + + # source://faraday//lib/faraday/options/ssl_options.rb#64 + def disable?; end + + # @return [String, Symbol] maximum SSL version (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-max_version-3D) + def max_version; end + + # @return [String, Symbol] maximum SSL version (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-max_version-3D) + def max_version=(_); end + + # @return [String, Symbol] minimum SSL version (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-min_version-3D) + def min_version; end + + # @return [String, Symbol] minimum SSL version (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-min_version-3D) + def min_version=(_); end + + # @return [OpenSSL::PKey::RSA, OpenSSL::PKey::DSA] private key (Excon only) + def private_key; end + + # @return [OpenSSL::PKey::RSA, OpenSSL::PKey::DSA] private key (Excon only) + def private_key=(_); end + + # @return [Boolean] whether to verify SSL certificates or not + def verify; end + + # @return [Boolean] whether to verify SSL certificates or not + def verify=(_); end + + # source://faraday//lib/faraday/options/ssl_options.rb#59 + def verify?; end + + # @return [Integer] maximum depth for the certificate chain verification + def verify_depth; end + + # @return [Integer] maximum depth for the certificate chain verification + def verify_depth=(_); end + + # @return [Boolean] whether to enable hostname verification on server certificates + # during the handshake or not (see https://github.com/ruby/openssl/pull/60) + def verify_hostname; end + + # @return [Boolean] whether to enable hostname verification on server certificates + # during the handshake or not (see https://github.com/ruby/openssl/pull/60) + def verify_hostname=(_); end + + # source://faraday//lib/faraday/options/ssl_options.rb#69 + def verify_hostname?; end + + # @return [Integer] Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) + def verify_mode; end + + # @return [Integer] Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) + def verify_mode=(_); end + + # @return [String, Symbol] SSL version (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-ssl_version-3D) + def version; end + + # @return [String, Symbol] SSL version (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html#method-i-ssl_version-3D) + def version=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# Faraday server error class. Represents 5xx status responses. +# +# source://faraday//lib/faraday/error.rb#132 +class Faraday::ServerError < ::Faraday::Error; end + +# A unified client error for timeouts. +# +# source://faraday//lib/faraday/error.rb#136 +class Faraday::TimeoutError < ::Faraday::ServerError + # @return [TimeoutError] a new instance of TimeoutError + # + # source://faraday//lib/faraday/error.rb#137 + def initialize(exc = T.unsafe(nil), response = T.unsafe(nil)); end +end + +# Raised by Faraday::Response::RaiseError in case of a 429 response. +# +# source://faraday//lib/faraday/error.rb#128 +class Faraday::TooManyRequestsError < ::Faraday::ClientError; end + +# Raised by Faraday::Response::RaiseError in case of a 401 response. +# +# source://faraday//lib/faraday/error.rb#100 +class Faraday::UnauthorizedError < ::Faraday::ClientError; end + +# Raised by Faraday::Response::RaiseError in case of a 422 response. +# +# source://faraday//lib/faraday/error.rb#124 +class Faraday::UnprocessableEntityError < ::Faraday::ClientError; end + +# Utils contains various static helper methods. +# +# source://faraday//lib/faraday/utils/headers.rb#4 +module Faraday::Utils + private + + # Normalize URI() behavior across Ruby versions + # + # url - A String or URI. + # + # Returns a parsed URI. + # + # source://faraday//lib/faraday/utils.rb#70 + def URI(url); end + + # source://faraday//lib/faraday/utils.rb#55 + def basic_header_from(login, pass); end + + # source://faraday//lib/faraday/utils.rb#16 + def build_nested_query(params); end + + # source://faraday//lib/faraday/utils.rb#12 + def build_query(params); end + + # Recursive hash merge + # + # source://faraday//lib/faraday/utils.rb#113 + def deep_merge(source, hash); end + + # Recursive hash update + # + # source://faraday//lib/faraday/utils.rb#101 + def deep_merge!(target, hash); end + + # source://faraday//lib/faraday/utils.rb#51 + def default_params_encoder; end + + # source://faraday//lib/faraday/utils.rb#20 + def default_space_encoding; end + + # source://faraday//lib/faraday/utils.rb#80 + def default_uri_parser; end + + # source://faraday//lib/faraday/utils.rb#84 + def default_uri_parser=(parser); end + + # source://faraday//lib/faraday/utils.rb#30 + def escape(str); end + + # Receives a String or URI and returns just + # the path with the query string sorted. + # + # source://faraday//lib/faraday/utils.rb#94 + def normalize_path(url); end + + # source://faraday//lib/faraday/utils.rb#47 + def parse_nested_query(query); end + + # Adapted from Rack + # + # source://faraday//lib/faraday/utils.rb#43 + def parse_query(query); end + + # source://faraday//lib/faraday/utils.rb#117 + def sort_query_params(query); end + + # source://faraday//lib/faraday/utils.rb#36 + def unescape(str); end + + class << self + # Normalize URI() behavior across Ruby versions + # + # url - A String or URI. + # + # Returns a parsed URI. + # + # source://faraday//lib/faraday/utils.rb#70 + def URI(url); end + + # source://faraday//lib/faraday/utils.rb#55 + def basic_header_from(login, pass); end + + # source://faraday//lib/faraday/utils.rb#16 + def build_nested_query(params); end + + # source://faraday//lib/faraday/utils.rb#12 + def build_query(params); end + + # Recursive hash merge + # + # source://faraday//lib/faraday/utils.rb#113 + def deep_merge(source, hash); end + + # Recursive hash update + # + # source://faraday//lib/faraday/utils.rb#101 + def deep_merge!(target, hash); end + + # source://faraday//lib/faraday/utils.rb#51 + def default_params_encoder; end + + # Sets the attribute default_params_encoder + # + # @param value the value to set the attribute default_params_encoder to. + # + # source://faraday//lib/faraday/utils.rb#62 + def default_params_encoder=(_arg0); end + + # source://faraday//lib/faraday/utils.rb#20 + def default_space_encoding; end + + # Sets the attribute default_space_encoding + # + # @param value the value to set the attribute default_space_encoding to. + # + # source://faraday//lib/faraday/utils.rb#25 + def default_space_encoding=(_arg0); end + + # source://faraday//lib/faraday/utils.rb#80 + def default_uri_parser; end + + # source://faraday//lib/faraday/utils.rb#84 + def default_uri_parser=(parser); end + + # source://faraday//lib/faraday/utils.rb#30 + def escape(str); end + + # Receives a String or URI and returns just + # the path with the query string sorted. + # + # source://faraday//lib/faraday/utils.rb#94 + def normalize_path(url); end + + # source://faraday//lib/faraday/utils.rb#47 + def parse_nested_query(query); end + + # Adapted from Rack + # + # source://faraday//lib/faraday/utils.rb#43 + def parse_query(query); end + + # source://faraday//lib/faraday/utils.rb#117 + def sort_query_params(query); end + + # source://faraday//lib/faraday/utils.rb#36 + def unescape(str); end + end +end + +# source://faraday//lib/faraday/utils.rb#40 +Faraday::Utils::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp) + +# source://faraday//lib/faraday/utils.rb#28 +Faraday::Utils::ESCAPE_RE = T.let(T.unsafe(nil), Regexp) + +# A case-insensitive Hash that preserves the original case of a header +# when set. +# +# Adapted from Rack::Utils::HeaderHash +# +# source://faraday//lib/faraday/utils/headers.rb#9 +class Faraday::Utils::Headers < ::Hash + # @return [Headers] a new instance of Headers + # + # source://faraday//lib/faraday/utils/headers.rb#20 + def initialize(hash = T.unsafe(nil)); end + + # source://faraday//lib/faraday/utils/headers.rb#52 + def [](key); end + + # source://faraday//lib/faraday/utils/headers.rb#57 + def []=(key, val); end + + # source://faraday//lib/faraday/utils/headers.rb#71 + def delete(key); end + + # source://faraday//lib/faraday/utils/headers.rb#80 + def dig(key, *rest); end + + # source://faraday//lib/faraday/utils/headers.rb#65 + def fetch(key, *_arg1, **_arg2, &_arg3); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/utils/headers.rb#86 + def has_key?(key); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/utils/headers.rb#86 + def include?(key); end + + # source://faraday//lib/faraday/utils/headers.rb#26 + def initialize_names; end + + # @return [Boolean] + # + # source://faraday//lib/faraday/utils/headers.rb#86 + def key?(key); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/utils/headers.rb#86 + def member?(key); end + + # source://faraday//lib/faraday/utils/headers.rb#101 + def merge(other); end + + # source://faraday//lib/faraday/utils/headers.rb#94 + def merge!(other); end + + # source://faraday//lib/faraday/utils/headers.rb#117 + def parse(header_string); end + + # source://faraday//lib/faraday/utils/headers.rb#106 + def replace(other); end + + # source://faraday//lib/faraday/utils/headers.rb#113 + def to_hash; end + + # source://faraday//lib/faraday/utils/headers.rb#94 + def update(other); end + + protected + + # Returns the value of attribute names. + # + # source://faraday//lib/faraday/utils/headers.rb#135 + def names; end + + private + + # Join multiple values with a comma. + # + # source://faraday//lib/faraday/utils/headers.rb#140 + def add_parsed(key, value); end + + # on dup/clone, we need to duplicate @names hash + # + # source://faraday//lib/faraday/utils/headers.rb#31 + def initialize_copy(other); end + + class << self + # source://faraday//lib/faraday/utils/headers.rb#14 + def allocate; end + + # source://faraday//lib/faraday/utils/headers.rb#10 + def from(value); end + end +end + +# symbol -> string mapper + cache +# +# source://faraday//lib/faraday/utils/headers.rb#40 +Faraday::Utils::Headers::KeyMap = T.let(T.unsafe(nil), Hash) + +# A hash with stringified keys. +# +# source://faraday//lib/faraday/utils/params_hash.rb#6 +class Faraday::Utils::ParamsHash < ::Hash + # source://faraday//lib/faraday/utils/params_hash.rb#7 + def [](key); end + + # source://faraday//lib/faraday/utils/params_hash.rb#11 + def []=(key, value); end + + # source://faraday//lib/faraday/utils/params_hash.rb#15 + def delete(key); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/utils/params_hash.rb#19 + def has_key?(key); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/utils/params_hash.rb#19 + def include?(key); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/utils/params_hash.rb#19 + def key?(key); end + + # @return [Boolean] + # + # source://faraday//lib/faraday/utils/params_hash.rb#19 + def member?(key); end + + # source://faraday//lib/faraday/utils/params_hash.rb#35 + def merge(params); end + + # source://faraday//lib/faraday/utils/params_hash.rb#27 + def merge!(params); end + + # source://faraday//lib/faraday/utils/params_hash.rb#44 + def merge_query(query, encoder = T.unsafe(nil)); end + + # source://faraday//lib/faraday/utils/params_hash.rb#39 + def replace(other); end + + # source://faraday//lib/faraday/utils/params_hash.rb#50 + def to_query(encoder = T.unsafe(nil)); end + + # source://faraday//lib/faraday/utils/params_hash.rb#27 + def update(params); end + + private + + # source://faraday//lib/faraday/utils/params_hash.rb#56 + def convert_key(key); end +end + +# source://faraday//lib/faraday/version.rb#4 +Faraday::VERSION = T.let(T.unsafe(nil), String) diff --git a/sorbet/rbi/gems/jwt@2.9.1.rbi b/sorbet/rbi/gems/jwt@2.9.1.rbi new file mode 100644 index 0000000..cce4d5f --- /dev/null +++ b/sorbet/rbi/gems/jwt@2.9.1.rbi @@ -0,0 +1,1546 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `jwt` gem. +# Please instead update this file by running `bin/tapioca gem jwt`. + + +# JSON Web Token implementation +# +# Should be up to date with the latest spec: +# https://tools.ietf.org/html/rfc7519 +# +# source://jwt//lib/jwt/version.rb#4 +module JWT + extend ::JWT::Configuration + + private + + # source://jwt//lib/jwt.rb#30 + def decode(jwt, key = T.unsafe(nil), verify = T.unsafe(nil), options = T.unsafe(nil), &keyfinder); end + + # source://jwt//lib/jwt.rb#23 + def encode(payload, key, algorithm = T.unsafe(nil), header_fields = T.unsafe(nil)); end + + class << self + # source://jwt//lib/jwt.rb#30 + def decode(jwt, key = T.unsafe(nil), verify = T.unsafe(nil), options = T.unsafe(nil), &keyfinder); end + + # source://jwt//lib/jwt.rb#23 + def encode(payload, key, algorithm = T.unsafe(nil), header_fields = T.unsafe(nil)); end + + # source://jwt//lib/jwt/version.rb#5 + def gem_version; end + + # @return [Boolean] + # + # source://jwt//lib/jwt/version.rb#24 + def openssl_3?; end + + # @return [Boolean] + # + # source://jwt//lib/jwt/version.rb#38 + def openssl_3_hmac_empty_key_regression?; end + + # source://jwt//lib/jwt/version.rb#42 + def openssl_version; end + + # @return [Boolean] + # + # source://jwt//lib/jwt/version.rb#30 + def rbnacl?; end + + # @return [Boolean] + # + # source://jwt//lib/jwt/version.rb#34 + def rbnacl_6_or_greater?; end + end +end + +# Base64 encoding and decoding +# +# source://jwt//lib/jwt/base64.rb#7 +class JWT::Base64 + class << self + # source://jwt//lib/jwt/base64.rb#27 + def loose_urlsafe_decode64(str); end + + # Decode a string with URL-safe Base64 complying with RFC 4648. + # Deprecated support for RFC 2045 remains for now. ("All line breaks or other characters not found in Table 1 must be ignored by decoding software") + # + # source://jwt//lib/jwt/base64.rb#16 + def url_decode(str); end + + # Encode a string with URL-safe Base64 complying with RFC 4648 (not padded). + # + # source://jwt//lib/jwt/base64.rb#10 + def url_encode(str); end + end +end + +# source://jwt//lib/jwt/error.rb#20 +class JWT::Base64DecodeError < ::JWT::DecodeError; end + +# source://jwt//lib/jwt/claims/audience.rb#4 +module JWT::Claims + class << self + # source://jwt//lib/jwt/claims.rb#29 + def verify!(payload, options); end + end +end + +# source://jwt//lib/jwt/claims/audience.rb#5 +class JWT::Claims::Audience + # @return [Audience] a new instance of Audience + # + # source://jwt//lib/jwt/claims/audience.rb#6 + def initialize(expected_audience:); end + + # @raise [JWT::InvalidAudError] + # + # source://jwt//lib/jwt/claims/audience.rb#10 + def verify!(context:, **_args); end + + private + + # Returns the value of attribute expected_audience. + # + # source://jwt//lib/jwt/claims/audience.rb#17 + def expected_audience; end +end + +# source://jwt//lib/jwt/claims/expiration.rb#5 +class JWT::Claims::Expiration + # @return [Expiration] a new instance of Expiration + # + # source://jwt//lib/jwt/claims/expiration.rb#6 + def initialize(leeway:); end + + # @raise [JWT::ExpiredSignature] + # + # source://jwt//lib/jwt/claims/expiration.rb#10 + def verify!(context:, **_args); end + + private + + # Returns the value of attribute leeway. + # + # source://jwt//lib/jwt/claims/expiration.rb#19 + def leeway; end +end + +# source://jwt//lib/jwt/claims/issued_at.rb#5 +class JWT::Claims::IssuedAt + # @raise [JWT::InvalidIatError] + # + # source://jwt//lib/jwt/claims/issued_at.rb#6 + def verify!(context:, **_args); end +end + +# source://jwt//lib/jwt/claims/issuer.rb#5 +class JWT::Claims::Issuer + # @return [Issuer] a new instance of Issuer + # + # source://jwt//lib/jwt/claims/issuer.rb#6 + def initialize(issuers:); end + + # source://jwt//lib/jwt/claims/issuer.rb#10 + def verify!(context:, **_args); end + + private + + # Returns the value of attribute issuers. + # + # source://jwt//lib/jwt/claims/issuer.rb#21 + def issuers; end +end + +# source://jwt//lib/jwt/claims/jwt_id.rb#5 +class JWT::Claims::JwtId + # @return [JwtId] a new instance of JwtId + # + # source://jwt//lib/jwt/claims/jwt_id.rb#6 + def initialize(validator:); end + + # source://jwt//lib/jwt/claims/jwt_id.rb#10 + def verify!(context:, **_args); end + + private + + # Returns the value of attribute validator. + # + # source://jwt//lib/jwt/claims/jwt_id.rb#22 + def validator; end +end + +# source://jwt//lib/jwt/claims/not_before.rb#5 +class JWT::Claims::NotBefore + # @return [NotBefore] a new instance of NotBefore + # + # source://jwt//lib/jwt/claims/not_before.rb#6 + def initialize(leeway:); end + + # @raise [JWT::ImmatureSignature] + # + # source://jwt//lib/jwt/claims/not_before.rb#10 + def verify!(context:, **_args); end + + private + + # Returns the value of attribute leeway. + # + # source://jwt//lib/jwt/claims/not_before.rb#19 + def leeway; end +end + +# source://jwt//lib/jwt/claims/numeric.rb#5 +class JWT::Claims::Numeric + # @return [Numeric] a new instance of Numeric + # + # source://jwt//lib/jwt/claims/numeric.rb#18 + def initialize(payload); end + + # source://jwt//lib/jwt/claims/numeric.rb#22 + def verify!; end + + private + + # @raise [InvalidPayload] + # + # source://jwt//lib/jwt/claims/numeric.rb#36 + def validate_is_numeric(claim); end + + # source://jwt//lib/jwt/claims/numeric.rb#30 + def validate_numeric_claims; end + + class << self + # source://jwt//lib/jwt/claims/numeric.rb#6 + def verify!(payload:, **_args); end + end +end + +# source://jwt//lib/jwt/claims/numeric.rb#12 +JWT::Claims::Numeric::NUMERIC_CLAIMS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/claims/required.rb#5 +class JWT::Claims::Required + # @return [Required] a new instance of Required + # + # source://jwt//lib/jwt/claims/required.rb#6 + def initialize(required_claims:); end + + # source://jwt//lib/jwt/claims/required.rb#10 + def verify!(context:, **_args); end + + private + + # Returns the value of attribute required_claims. + # + # source://jwt//lib/jwt/claims/required.rb#20 + def required_claims; end +end + +# source://jwt//lib/jwt/claims/subject.rb#5 +class JWT::Claims::Subject + # @return [Subject] a new instance of Subject + # + # source://jwt//lib/jwt/claims/subject.rb#6 + def initialize(expected_subject:); end + + # @raise [JWT::InvalidSubError] + # + # source://jwt//lib/jwt/claims/subject.rb#10 + def verify!(context:, **_args); end + + private + + # Returns the value of attribute expected_subject. + # + # source://jwt//lib/jwt/claims/subject.rb#17 + def expected_subject; end +end + +# source://jwt//lib/jwt/claims.rb#17 +JWT::Claims::VERIFIERS = T.let(T.unsafe(nil), Hash) + +# source://jwt//lib/jwt/claims.rb#15 +class JWT::Claims::VerificationContext < ::Struct + # Returns the value of attribute payload + # + # @return [Object] the current value of payload + def payload; end + + # Sets the attribute payload + # + # @param value [Object] the value to set the attribute payload to. + # @return [Object] the newly set value + def payload=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://jwt//lib/jwt/configuration/decode_configuration.rb#4 +module JWT::Configuration + # source://jwt//lib/jwt/configuration.rb#11 + def configuration; end + + # @yield [configuration] + # + # source://jwt//lib/jwt/configuration.rb#7 + def configure; end +end + +# source://jwt//lib/jwt/configuration/container.rb#8 +class JWT::Configuration::Container + # @return [Container] a new instance of Container + # + # source://jwt//lib/jwt/configuration/container.rb#12 + def initialize; end + + # Returns the value of attribute decode. + # + # source://jwt//lib/jwt/configuration/container.rb#9 + def decode; end + + # Sets the attribute decode + # + # @param value the value to set the attribute decode to. + # + # source://jwt//lib/jwt/configuration/container.rb#9 + def decode=(_arg0); end + + # Returns the value of attribute deprecation_warnings. + # + # source://jwt//lib/jwt/configuration/container.rb#10 + def deprecation_warnings; end + + # @raise [ArgumentError] + # + # source://jwt//lib/jwt/configuration/container.rb#25 + def deprecation_warnings=(value); end + + # Returns the value of attribute jwk. + # + # source://jwt//lib/jwt/configuration/container.rb#9 + def jwk; end + + # Sets the attribute jwk + # + # @param value the value to set the attribute jwk to. + # + # source://jwt//lib/jwt/configuration/container.rb#9 + def jwk=(_arg0); end + + # source://jwt//lib/jwt/configuration/container.rb#16 + def reset!; end + + # Returns the value of attribute strict_base64_decoding. + # + # source://jwt//lib/jwt/configuration/container.rb#9 + def strict_base64_decoding; end + + # Sets the attribute strict_base64_decoding + # + # @param value the value to set the attribute strict_base64_decoding to. + # + # source://jwt//lib/jwt/configuration/container.rb#9 + def strict_base64_decoding=(_arg0); end +end + +# source://jwt//lib/jwt/configuration/container.rb#24 +JWT::Configuration::Container::DEPRECATION_WARNINGS_VALUES = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/configuration/decode_configuration.rb#5 +class JWT::Configuration::DecodeConfiguration + # @return [DecodeConfiguration] a new instance of DecodeConfiguration + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#17 + def initialize; end + + # Returns the value of attribute algorithms. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def algorithms; end + + # Sets the attribute algorithms + # + # @param value the value to set the attribute algorithms to. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def algorithms=(_arg0); end + + # Returns the value of attribute leeway. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def leeway; end + + # Sets the attribute leeway + # + # @param value the value to set the attribute leeway to. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def leeway=(_arg0); end + + # Returns the value of attribute required_claims. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def required_claims; end + + # Sets the attribute required_claims + # + # @param value the value to set the attribute required_claims to. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def required_claims=(_arg0); end + + # source://jwt//lib/jwt/configuration/decode_configuration.rb#30 + def to_h; end + + # Returns the value of attribute verify_aud. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_aud; end + + # Sets the attribute verify_aud + # + # @param value the value to set the attribute verify_aud to. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_aud=(_arg0); end + + # Returns the value of attribute verify_expiration. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_expiration; end + + # Sets the attribute verify_expiration + # + # @param value the value to set the attribute verify_expiration to. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_expiration=(_arg0); end + + # Returns the value of attribute verify_iat. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_iat; end + + # Sets the attribute verify_iat + # + # @param value the value to set the attribute verify_iat to. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_iat=(_arg0); end + + # Returns the value of attribute verify_iss. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_iss; end + + # Sets the attribute verify_iss + # + # @param value the value to set the attribute verify_iss to. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_iss=(_arg0); end + + # Returns the value of attribute verify_jti. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_jti; end + + # Sets the attribute verify_jti + # + # @param value the value to set the attribute verify_jti to. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_jti=(_arg0); end + + # Returns the value of attribute verify_not_before. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_not_before; end + + # Sets the attribute verify_not_before + # + # @param value the value to set the attribute verify_not_before to. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_not_before=(_arg0); end + + # Returns the value of attribute verify_sub. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_sub; end + + # Sets the attribute verify_sub + # + # @param value the value to set the attribute verify_sub to. + # + # source://jwt//lib/jwt/configuration/decode_configuration.rb#6 + def verify_sub=(_arg0); end +end + +# source://jwt//lib/jwt/configuration/jwk_configuration.rb#8 +class JWT::Configuration::JwkConfiguration + # @return [JwkConfiguration] a new instance of JwkConfiguration + # + # source://jwt//lib/jwt/configuration/jwk_configuration.rb#9 + def initialize; end + + # Returns the value of attribute kid_generator. + # + # source://jwt//lib/jwt/configuration/jwk_configuration.rb#24 + def kid_generator; end + + # Sets the attribute kid_generator + # + # @param value the value to set the attribute kid_generator to. + # + # source://jwt//lib/jwt/configuration/jwk_configuration.rb#24 + def kid_generator=(_arg0); end + + # source://jwt//lib/jwt/configuration/jwk_configuration.rb#13 + def kid_generator_type=(value); end +end + +# Decoding logic for JWT +# +# source://jwt//lib/jwt/decode.rb#9 +class JWT::Decode + # @raise [JWT::DecodeError] + # @return [Decode] a new instance of Decode + # + # source://jwt//lib/jwt/decode.rb#10 + def initialize(jwt, key, verify, options, &keyfinder); end + + # @raise [JWT::DecodeError] + # + # source://jwt//lib/jwt/decode.rb#22 + def decode_segments; end + + private + + # source://jwt//lib/jwt/decode.rb#137 + def alg_in_header; end + + # source://jwt//lib/jwt/decode.rb#88 + def allowed_algorithms; end + + # source://jwt//lib/jwt/decode.rb#70 + def allowed_and_valid_algorithms; end + + # source://jwt//lib/jwt/decode.rb#133 + def decode_signature; end + + # @raise [JWT::DecodeError] + # + # source://jwt//lib/jwt/decode.rb#105 + def find_key(&keyfinder); end + + # source://jwt//lib/jwt/decode.rb#80 + def given_algorithms; end + + # source://jwt//lib/jwt/decode.rb#141 + def header; end + + # @return [Boolean] + # + # source://jwt//lib/jwt/decode.rb#129 + def none_algorithm?; end + + # source://jwt//lib/jwt/decode.rb#153 + def parse_and_decode(segment); end + + # source://jwt//lib/jwt/decode.rb#145 + def payload; end + + # source://jwt//lib/jwt/decode.rb#92 + def resolve_allowed_algorithms; end + + # source://jwt//lib/jwt/decode.rb#125 + def segment_length; end + + # source://jwt//lib/jwt/decode.rb#56 + def set_key; end + + # source://jwt//lib/jwt/decode.rb#149 + def signing_input; end + + # Move algorithms matching the JWT alg header to the beginning of the list + # + # source://jwt//lib/jwt/decode.rb#99 + def sort_by_alg_header(algs); end + + # @raise [JWT::DecodeError] + # + # source://jwt//lib/jwt/decode.rb#117 + def validate_segment_count!; end + + # @raise [JWT::IncorrectAlgorithm] + # + # source://jwt//lib/jwt/decode.rb#50 + def verify_algo; end + + # source://jwt//lib/jwt/decode.rb#113 + def verify_claims; end + + # @raise [JWT::DecodeError] + # + # source://jwt//lib/jwt/decode.rb#38 + def verify_signature; end + + # @return [Boolean] + # + # source://jwt//lib/jwt/decode.rb#64 + def verify_signature_for?(key); end +end + +# Order is very important - first check for string keys, next for symbols +# +# source://jwt//lib/jwt/decode.rb#75 +JWT::Decode::ALGORITHM_KEYS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/error.rb#5 +class JWT::DecodeError < ::StandardError; end + +# Deprecations module to handle deprecation warnings in the gem +# +# source://jwt//lib/jwt/deprecations.rb#5 +module JWT::Deprecations + class << self + # source://jwt//lib/jwt/deprecations.rb#7 + def context; end + + # source://jwt//lib/jwt/deprecations.rb#31 + def emit_warnings; end + + # source://jwt//lib/jwt/deprecations.rb#27 + def store(message); end + + # source://jwt//lib/jwt/deprecations.rb#13 + def warning(message, only_if_valid: T.unsafe(nil)); end + + private + + # source://jwt//lib/jwt/deprecations.rb#39 + def record_warned(message); end + end +end + +# Encoding logic for JWT +# +# source://jwt//lib/jwt/encode.rb#8 +class JWT::Encode + # @return [Encode] a new instance of Encode + # + # source://jwt//lib/jwt/encode.rb#9 + def initialize(options); end + + # source://jwt//lib/jwt/encode.rb#16 + def segments; end + + private + + # source://jwt//lib/jwt/encode.rb#65 + def combine(*parts); end + + # source://jwt//lib/jwt/encode.rb#61 + def encode_data(data); end + + # source://jwt//lib/jwt/encode.rb#39 + def encode_header; end + + # source://jwt//lib/jwt/encode.rb#43 + def encode_payload; end + + # source://jwt//lib/jwt/encode.rb#57 + def encode_signature; end + + # source://jwt//lib/jwt/encode.rb#23 + def encoded_header; end + + # source://jwt//lib/jwt/encode.rb#35 + def encoded_header_and_payload; end + + # source://jwt//lib/jwt/encode.rb#27 + def encoded_payload; end + + # source://jwt//lib/jwt/encode.rb#31 + def encoded_signature; end + + # source://jwt//lib/jwt/encode.rb#47 + def signature; end + + # source://jwt//lib/jwt/encode.rb#51 + def validate_claims!; end +end + +# source://jwt//lib/jwt/error.rb#4 +class JWT::EncodeError < ::StandardError; end + +# source://jwt//lib/jwt/error.rb#9 +class JWT::ExpiredSignature < ::JWT::DecodeError; end + +# source://jwt//lib/jwt/error.rb#11 +class JWT::ImmatureSignature < ::JWT::DecodeError; end + +# source://jwt//lib/jwt/error.rb#10 +class JWT::IncorrectAlgorithm < ::JWT::DecodeError; end + +# source://jwt//lib/jwt/error.rb#15 +class JWT::InvalidAudError < ::JWT::DecodeError; end + +# source://jwt//lib/jwt/error.rb#14 +class JWT::InvalidIatError < ::JWT::DecodeError; end + +# source://jwt//lib/jwt/error.rb#12 +class JWT::InvalidIssuerError < ::JWT::DecodeError; end + +# source://jwt//lib/jwt/error.rb#17 +class JWT::InvalidJtiError < ::JWT::DecodeError; end + +# source://jwt//lib/jwt/error.rb#18 +class JWT::InvalidPayload < ::JWT::DecodeError; end + +# source://jwt//lib/jwt/error.rb#16 +class JWT::InvalidSubError < ::JWT::DecodeError; end + +# JSON wrapper +# +# source://jwt//lib/jwt/json.rb#7 +class JWT::JSON + class << self + # source://jwt//lib/jwt/json.rb#9 + def generate(data); end + + # source://jwt//lib/jwt/json.rb#13 + def parse(data); end + end +end + +# source://jwt//lib/jwt/jwa/signing_algorithm.rb#4 +module JWT::JWA + class << self + # source://jwt//lib/jwt/jwa/signing_algorithm.rb#48 + def find(algo); end + + # source://jwt//lib/jwt/jwa/signing_algorithm.rb#44 + def register_algorithm(algo); end + + # source://jwt//lib/jwt/jwa.rb#33 + def resolve(algorithm); end + + private + + # source://jwt//lib/jwt/jwa/signing_algorithm.rb#54 + def algorithms; end + end +end + +# source://jwt//lib/jwt/jwa/ecdsa.rb#5 +class JWT::JWA::Ecdsa + include ::JWT::JWA::SigningAlgorithm + extend ::JWT::JWA::SigningAlgorithm::ClassMethods + + # @return [Ecdsa] a new instance of Ecdsa + # + # source://jwt//lib/jwt/jwa/ecdsa.rb#8 + def initialize(alg, digest); end + + # source://jwt//lib/jwt/jwa/ecdsa.rb#13 + def sign(data:, signing_key:); end + + # source://jwt//lib/jwt/jwa/ecdsa.rb#23 + def verify(data:, signature:, verification_key:); end + + private + + # source://jwt//lib/jwt/jwa/ecdsa.rb#83 + def asn1_to_raw(signature, public_key); end + + # source://jwt//lib/jwt/jwa/ecdsa.rb#72 + def curve_by_name(name); end + + # Returns the value of attribute digest. + # + # source://jwt//lib/jwt/jwa/ecdsa.rb#70 + def digest; end + + # source://jwt//lib/jwt/jwa/ecdsa.rb#76 + def raw_to_asn1(signature, private_key); end + + class << self + # source://jwt//lib/jwt/jwa/ecdsa.rb#62 + def curve_by_name(name); end + end +end + +# source://jwt//lib/jwt/jwa/ecdsa.rb#35 +JWT::JWA::Ecdsa::NAMED_CURVES = T.let(T.unsafe(nil), Hash) + +# source://jwt//lib/jwt/jwa/hmac.rb#5 +class JWT::JWA::Hmac + include ::JWT::JWA::SigningAlgorithm + extend ::JWT::JWA::SigningAlgorithm::ClassMethods + + # @return [Hmac] a new instance of Hmac + # + # source://jwt//lib/jwt/jwa/hmac.rb#8 + def initialize(alg, digest); end + + # source://jwt//lib/jwt/jwa/hmac.rb#13 + def sign(data:, signing_key:); end + + # source://jwt//lib/jwt/jwa/hmac.rb#26 + def verify(data:, signature:, verification_key:); end + + private + + # Returns the value of attribute digest. + # + # source://jwt//lib/jwt/jwa/hmac.rb#36 + def digest; end +end + +# Copy of https://github.com/rails/rails/blob/v7.0.3.1/activesupport/lib/active_support/security_utils.rb +# +# source://jwt//lib/jwt/jwa/hmac.rb#40 +module JWT::JWA::Hmac::SecurityUtils + private + + # :nocov: + # + # @raise [ArgumentError] + # + # source://jwt//lib/jwt/jwa/hmac.rb#47 + def fixed_length_secure_compare(a, b); end + + # Secure string comparison for strings of variable length. + # + # While a timing attack would not be able to discern the content of + # a secret compared via secure_compare, it is possible to determine + # the secret length. This should be considered when using secure_compare + # to compare weak, short secrets to user input. + # + # source://jwt//lib/jwt/jwa/hmac.rb#71 + def secure_compare(a, b); end + + class << self + # :nocov: + # + # @raise [ArgumentError] + # + # source://jwt//lib/jwt/jwa/hmac.rb#47 + def fixed_length_secure_compare(a, b); end + + # Secure string comparison for strings of variable length. + # + # While a timing attack would not be able to discern the content of + # a secret compared via secure_compare, it is possible to determine + # the secret length. This should be considered when using secure_compare + # to compare weak, short secrets to user input. + # + # source://jwt//lib/jwt/jwa/hmac.rb#71 + def secure_compare(a, b); end + end +end + +# source://jwt//lib/jwt/jwa/none.rb#5 +class JWT::JWA::None + include ::JWT::JWA::SigningAlgorithm + extend ::JWT::JWA::SigningAlgorithm::ClassMethods + + # @return [None] a new instance of None + # + # source://jwt//lib/jwt/jwa/none.rb#8 + def initialize; end + + # source://jwt//lib/jwt/jwa/none.rb#12 + def sign(*_arg0); end + + # source://jwt//lib/jwt/jwa/none.rb#16 + def verify(*_arg0); end +end + +# source://jwt//lib/jwt/jwa/ps.rb#5 +class JWT::JWA::Ps + include ::JWT::JWA::SigningAlgorithm + extend ::JWT::JWA::SigningAlgorithm::ClassMethods + + # @return [Ps] a new instance of Ps + # + # source://jwt//lib/jwt/jwa/ps.rb#8 + def initialize(alg); end + + # source://jwt//lib/jwt/jwa/ps.rb#13 + def sign(data:, signing_key:); end + + # source://jwt//lib/jwt/jwa/ps.rb#21 + def verify(data:, signature:, verification_key:); end + + private + + # Returns the value of attribute digest_algorithm. + # + # source://jwt//lib/jwt/jwa/ps.rb#33 + def digest_algorithm; end +end + +# source://jwt//lib/jwt/jwa/rsa.rb#5 +class JWT::JWA::Rsa + include ::JWT::JWA::SigningAlgorithm + extend ::JWT::JWA::SigningAlgorithm::ClassMethods + + # @return [Rsa] a new instance of Rsa + # + # source://jwt//lib/jwt/jwa/rsa.rb#8 + def initialize(alg); end + + # source://jwt//lib/jwt/jwa/rsa.rb#13 + def sign(data:, signing_key:); end + + # source://jwt//lib/jwt/jwa/rsa.rb#21 + def verify(data:, signature:, verification_key:); end + + private + + # Returns the value of attribute digest. + # + # source://jwt//lib/jwt/jwa/rsa.rb#33 + def digest; end +end + +# source://jwt//lib/jwt/jwa/signing_algorithm.rb#5 +module JWT::JWA::SigningAlgorithm + mixes_in_class_methods ::JWT::JWA::SigningAlgorithm::ClassMethods + + # Returns the value of attribute alg. + # + # source://jwt//lib/jwt/jwa/signing_algorithm.rb#16 + def alg; end + + # source://jwt//lib/jwt/jwa/signing_algorithm.rb#22 + def header(*_arg0); end + + # source://jwt//lib/jwt/jwa/signing_algorithm.rb#38 + def raise_sign_error!(message); end + + # source://jwt//lib/jwt/jwa/signing_algorithm.rb#34 + def raise_verify_error!(message); end + + # source://jwt//lib/jwt/jwa/signing_algorithm.rb#26 + def sign(*_arg0); end + + # @return [Boolean] + # + # source://jwt//lib/jwt/jwa/signing_algorithm.rb#18 + def valid_alg?(alg_to_check); end + + # source://jwt//lib/jwt/jwa/signing_algorithm.rb#30 + def verify(*_arg0); end + + class << self + # @private + # + # source://jwt//lib/jwt/jwa/signing_algorithm.rb#12 + def included(klass); end + end +end + +# source://jwt//lib/jwt/jwa/signing_algorithm.rb#6 +module JWT::JWA::SigningAlgorithm::ClassMethods + # source://jwt//lib/jwt/jwa/signing_algorithm.rb#7 + def register_algorithm(algo); end +end + +# source://jwt//lib/jwt/jwa/unsupported.rb#5 +module JWT::JWA::Unsupported + extend ::JWT::JWA::SigningAlgorithm + + class << self + # source://jwt//lib/jwt/jwa/unsupported.rb#9 + def sign(*_arg0); end + + # @raise [JWT::VerificationError] + # + # source://jwt//lib/jwt/jwa/unsupported.rb#13 + def verify(*_arg0); end + end +end + +# source://jwt//lib/jwt/jwa/wrapper.rb#5 +class JWT::JWA::Wrapper + include ::JWT::JWA::SigningAlgorithm + extend ::JWT::JWA::SigningAlgorithm::ClassMethods + + # @return [Wrapper] a new instance of Wrapper + # + # source://jwt//lib/jwt/jwa/wrapper.rb#8 + def initialize(algorithm); end + + # source://jwt//lib/jwt/jwa/wrapper.rb#12 + def alg; end + + # source://jwt//lib/jwt/jwa/wrapper.rb#24 + def header(*args, **kwargs); end + + # source://jwt//lib/jwt/jwa/wrapper.rb#30 + def sign(*args, **kwargs); end + + # @return [Boolean] + # + # source://jwt//lib/jwt/jwa/wrapper.rb#18 + def valid_alg?(alg_to_check); end + + # source://jwt//lib/jwt/jwa/wrapper.rb#36 + def verify(*args, **kwargs); end +end + +# source://jwt//lib/jwt/jwk/kid_as_key_digest.rb#4 +module JWT::JWK + class << self + # source://jwt//lib/jwt/jwk.rb#24 + def classes; end + + # source://jwt//lib/jwt/jwk.rb#9 + def create_from(key, params = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://jwt//lib/jwt/jwk.rb#9 + def import(key, params = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://jwt//lib/jwt/jwk.rb#9 + def new(key, params = T.unsafe(nil), options = T.unsafe(nil)); end + + private + + # source://jwt//lib/jwt/jwk.rb#38 + def generate_mappings; end + + # source://jwt//lib/jwt/jwk.rb#34 + def mappings; end + end +end + +# source://jwt//lib/jwt/jwk/ec.rb#7 +class JWT::JWK::EC < ::JWT::JWK::KeyBase + # @return [EC] a new instance of EC + # + # source://jwt//lib/jwt/jwk/ec.rb#16 + def initialize(key, params = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://jwt//lib/jwt/jwk/ec.rb#67 + def []=(key, value); end + + # source://jwt//lib/jwt/jwk/ec.rb#54 + def export(options = T.unsafe(nil)); end + + # source://jwt//lib/jwt/jwk/ec.rb#60 + def key_digest; end + + # source://jwt//lib/jwt/jwk/ec.rb#30 + def keypair; end + + # source://jwt//lib/jwt/jwk/ec.rb#50 + def members; end + + # @return [Boolean] + # + # source://jwt//lib/jwt/jwk/ec.rb#34 + def private?; end + + # source://jwt//lib/jwt/jwk/ec.rb#46 + def public_key; end + + # source://jwt//lib/jwt/jwk/ec.rb#38 + def signing_key; end + + # source://jwt//lib/jwt/jwk/ec.rb#42 + def verify_key; end + + private + + # @raise [ArgumentError] + # + # source://jwt//lib/jwt/jwk/ec.rb#95 + def check_jwk_params!(key_params, params); end + + # source://jwt//lib/jwt/jwk/ec.rb#145 + def create_ec_key(jwk_crv, jwk_x, jwk_y, jwk_d); end + + # source://jwt//lib/jwt/jwk/ec.rb#208 + def decode_octets(base64_encoded_coordinate); end + + # source://jwt//lib/jwt/jwk/ec.rb#77 + def ec_key; end + + # source://jwt//lib/jwt/jwk/ec.rb#122 + def encode_octets(octets); end + + # source://jwt//lib/jwt/jwk/ec.rb#128 + def encode_open_ssl_bn(key_part); end + + # source://jwt//lib/jwt/jwk/ec.rb#81 + def extract_key_params(key); end + + # source://jwt//lib/jwt/jwk/ec.rb#101 + def keypair_components(ec_keypair); end + + # source://jwt//lib/jwt/jwk/ec.rb#132 + def parse_ec_key(key); end + + class << self + # source://jwt//lib/jwt/jwk/ec.rb#232 + def import(jwk_data); end + + # source://jwt//lib/jwt/jwk/ec.rb#236 + def to_openssl_curve(crv); end + end +end + +# source://jwt//lib/jwt/jwk/ec.rb#10 +JWT::JWK::EC::BINARY = T.let(T.unsafe(nil), Integer) + +# source://jwt//lib/jwt/jwk/ec.rb#13 +JWT::JWK::EC::EC_KEY_ELEMENTS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/jwk/ec.rb#12 +JWT::JWK::EC::EC_PRIVATE_KEY_ELEMENTS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/jwk/ec.rb#11 +JWT::JWK::EC::EC_PUBLIC_KEY_ELEMENTS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/jwk/ec.rb#8 +JWT::JWK::EC::KTY = T.let(T.unsafe(nil), String) + +# source://jwt//lib/jwt/jwk/ec.rb#9 +JWT::JWK::EC::KTYS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/jwk/ec.rb#14 +JWT::JWK::EC::ZERO_BYTE = T.let(T.unsafe(nil), String) + +# source://jwt//lib/jwt/jwk/hmac.rb#5 +class JWT::JWK::HMAC < ::JWT::JWK::KeyBase + # @return [HMAC] a new instance of HMAC + # + # source://jwt//lib/jwt/jwk/hmac.rb#12 + def initialize(key, params = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://jwt//lib/jwt/jwk/hmac.rb#63 + def []=(key, value); end + + # See https://tools.ietf.org/html/rfc7517#appendix-A.3 + # + # source://jwt//lib/jwt/jwk/hmac.rb#47 + def export(options = T.unsafe(nil)); end + + # source://jwt//lib/jwt/jwk/hmac.rb#57 + def key_digest; end + + # source://jwt//lib/jwt/jwk/hmac.rb#26 + def keypair; end + + # source://jwt//lib/jwt/jwk/hmac.rb#53 + def members; end + + # @return [Boolean] + # + # source://jwt//lib/jwt/jwk/hmac.rb#30 + def private?; end + + # source://jwt//lib/jwt/jwk/hmac.rb#34 + def public_key; end + + # source://jwt//lib/jwt/jwk/hmac.rb#42 + def signing_key; end + + # source://jwt//lib/jwt/jwk/hmac.rb#38 + def verify_key; end + + private + + # @raise [ArgumentError] + # + # source://jwt//lib/jwt/jwk/hmac.rb#90 + def check_jwk(keypair, params); end + + # source://jwt//lib/jwt/jwk/hmac.rb#77 + def extract_key_params(key); end + + # source://jwt//lib/jwt/jwk/hmac.rb#73 + def secret; end + + class << self + # source://jwt//lib/jwt/jwk/hmac.rb#97 + def import(jwk_data); end + end +end + +# source://jwt//lib/jwt/jwk/hmac.rb#10 +JWT::JWK::HMAC::HMAC_KEY_ELEMENTS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/jwk/hmac.rb#9 +JWT::JWK::HMAC::HMAC_PRIVATE_KEY_ELEMENTS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/jwk/hmac.rb#8 +JWT::JWK::HMAC::HMAC_PUBLIC_KEY_ELEMENTS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/jwk/hmac.rb#6 +JWT::JWK::HMAC::KTY = T.let(T.unsafe(nil), String) + +# source://jwt//lib/jwt/jwk/hmac.rb#7 +JWT::JWK::HMAC::KTYS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/jwk/key_base.rb#5 +class JWT::JWK::KeyBase + # @return [KeyBase] a new instance of KeyBase + # + # source://jwt//lib/jwt/jwk/key_base.rb#11 + def initialize(options, params = T.unsafe(nil)); end + + # source://jwt//lib/jwt/jwk/key_base.rb#46 + def <=>(other); end + + # source://jwt//lib/jwt/jwk/key_base.rb#40 + def ==(other); end + + # source://jwt//lib/jwt/jwk/key_base.rb#32 + def [](key); end + + # source://jwt//lib/jwt/jwk/key_base.rb#36 + def []=(key, value); end + + # source://jwt//lib/jwt/jwk/key_base.rb#40 + def eql?(other); end + + # source://jwt//lib/jwt/jwk/key_base.rb#28 + def hash; end + + # source://jwt//lib/jwt/jwk/key_base.rb#24 + def kid; end + + private + + # Returns the value of attribute parameters. + # + # source://jwt//lib/jwt/jwk/key_base.rb#54 + def parameters; end + + class << self + # @private + # + # source://jwt//lib/jwt/jwk/key_base.rb#6 + def inherited(klass); end + end +end + +# source://jwt//lib/jwt/jwk/key_finder.rb#5 +class JWT::JWK::KeyFinder + # @return [KeyFinder] a new instance of KeyFinder + # + # source://jwt//lib/jwt/jwk/key_finder.rb#6 + def initialize(options); end + + # @raise [::JWT::DecodeError] + # + # source://jwt//lib/jwt/jwk/key_finder.rb#17 + def key_for(kid); end + + private + + # source://jwt//lib/jwt/jwk/key_finder.rb#31 + def resolve_key(kid); end +end + +# source://jwt//lib/jwt/jwk/kid_as_key_digest.rb#5 +class JWT::JWK::KidAsKeyDigest + # @return [KidAsKeyDigest] a new instance of KidAsKeyDigest + # + # source://jwt//lib/jwt/jwk/kid_as_key_digest.rb#6 + def initialize(jwk); end + + # source://jwt//lib/jwt/jwk/kid_as_key_digest.rb#10 + def generate; end +end + +# source://jwt//lib/jwt/jwk/rsa.rb#5 +class JWT::JWK::RSA < ::JWT::JWK::KeyBase + # @return [RSA] a new instance of RSA + # + # source://jwt//lib/jwt/jwk/rsa.rb#16 + def initialize(key, params = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://jwt//lib/jwt/jwk/rsa.rb#66 + def []=(key, value); end + + # source://jwt//lib/jwt/jwk/rsa.rb#50 + def export(options = T.unsafe(nil)); end + + # source://jwt//lib/jwt/jwk/rsa.rb#60 + def key_digest; end + + # source://jwt//lib/jwt/jwk/rsa.rb#30 + def keypair; end + + # source://jwt//lib/jwt/jwk/rsa.rb#56 + def members; end + + # @return [Boolean] + # + # source://jwt//lib/jwt/jwk/rsa.rb#34 + def private?; end + + # source://jwt//lib/jwt/jwk/rsa.rb#38 + def public_key; end + + # source://jwt//lib/jwt/jwk/rsa.rb#42 + def signing_key; end + + # source://jwt//lib/jwt/jwk/rsa.rb#46 + def verify_key; end + + private + + # @raise [ArgumentError] + # + # source://jwt//lib/jwt/jwk/rsa.rb#94 + def check_jwk_params!(key_params, params); end + + # source://jwt//lib/jwt/jwk/rsa.rb#126 + def decode_open_ssl_bn(jwk_data); end + + # source://jwt//lib/jwt/jwk/rsa.rb#120 + def encode_open_ssl_bn(key_part); end + + # source://jwt//lib/jwt/jwk/rsa.rb#80 + def extract_key_params(key); end + + # source://jwt//lib/jwt/jwk/rsa.rb#114 + def jwk_attributes(*attributes); end + + # source://jwt//lib/jwt/jwk/rsa.rb#100 + def parse_rsa_key(key); end + + # source://jwt//lib/jwt/jwk/rsa.rb#76 + def rsa_key; end + + class << self + # source://jwt//lib/jwt/jwk/rsa.rb#141 + def create_rsa_key(rsa_parameters); end + + # source://jwt//lib/jwt/jwk/rsa.rb#169 + def create_rsa_key_using_accessors(rsa_parameters); end + + # source://jwt//lib/jwt/jwk/rsa.rb#141 + def create_rsa_key_using_der(rsa_parameters); end + + # source://jwt//lib/jwt/jwk/rsa.rb#159 + def create_rsa_key_using_sets(rsa_parameters); end + + # source://jwt//lib/jwt/jwk/rsa.rb#135 + def decode_open_ssl_bn(jwk_data); end + + # source://jwt//lib/jwt/jwk/rsa.rb#131 + def import(jwk_data); end + + # @raise [JWT::JWKError] + # + # source://jwt//lib/jwt/jwk/rsa.rb#184 + def validate_rsa_parameters!(rsa_parameters); end + end +end + +# source://jwt//lib/jwt/jwk/rsa.rb#6 +JWT::JWK::RSA::BINARY = T.let(T.unsafe(nil), Integer) + +# source://jwt//lib/jwt/jwk/rsa.rb#7 +JWT::JWK::RSA::KTY = T.let(T.unsafe(nil), String) + +# source://jwt//lib/jwt/jwk/rsa.rb#8 +JWT::JWK::RSA::KTYS = T.let(T.unsafe(nil), Array) + +# https://www.rfc-editor.org/rfc/rfc3447#appendix-A.1.2 +# +# source://jwt//lib/jwt/jwk/rsa.rb#14 +JWT::JWK::RSA::RSA_ASN1_SEQUENCE = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/jwk/rsa.rb#11 +JWT::JWK::RSA::RSA_KEY_ELEMENTS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/jwk/rsa.rb#13 +JWT::JWK::RSA::RSA_OPT_PARAMS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/jwk/rsa.rb#10 +JWT::JWK::RSA::RSA_PRIVATE_KEY_ELEMENTS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/jwk/rsa.rb#9 +JWT::JWK::RSA::RSA_PUBLIC_KEY_ELEMENTS = T.let(T.unsafe(nil), Array) + +# source://jwt//lib/jwt/jwk/set.rb#7 +class JWT::JWK::Set + include ::Enumerable + extend ::Forwardable + + # @return [Set] a new instance of Set + # + # source://jwt//lib/jwt/jwk/set.rb#13 + def initialize(jwks = T.unsafe(nil), options = T.unsafe(nil)); end + + # source://jwt//lib/jwt/jwk/set.rb#58 + def +(enum); end + + # source://jwt//lib/jwt/jwk/set.rb#62 + def <<(key); end + + # source://jwt//lib/jwt/jwk/set.rb#67 + def ==(other); end + + # source://jwt//lib/jwt/jwk/set.rb#62 + def add(key); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def delete(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def dig(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def each(*args, **_arg1, &block); end + + # source://jwt//lib/jwt/jwk/set.rb#67 + def eql?(other); end + + # source://jwt//lib/jwt/jwk/set.rb#31 + def export(options = T.unsafe(nil)); end + + # source://jwt//lib/jwt/jwk/set.rb#37 + def filter!(&block); end + + # Returns the value of attribute keys. + # + # source://jwt//lib/jwt/jwk/set.rb#11 + def keys; end + + # source://forwardable/1.3.3/forwardable.rb#231 + def length(*args, **_arg1, &block); end + + # source://jwt//lib/jwt/jwk/set.rb#53 + def merge(enum); end + + # source://jwt//lib/jwt/jwk/set.rb#43 + def reject!(&block); end + + # source://jwt//lib/jwt/jwk/set.rb#37 + def select!(&block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def size(*args, **_arg1, &block); end + + # source://jwt//lib/jwt/jwk/set.rb#58 + def union(enum); end + + # source://jwt//lib/jwt/jwk/set.rb#49 + def uniq!(&block); end + + # For symbolic manipulation + # + # source://jwt//lib/jwt/jwk/set.rb#58 + def |(enum); end +end + +# https://tools.ietf.org/html/rfc7638 +# +# source://jwt//lib/jwt/jwk/thumbprint.rb#6 +class JWT::JWK::Thumbprint + # @return [Thumbprint] a new instance of Thumbprint + # + # source://jwt//lib/jwt/jwk/thumbprint.rb#9 + def initialize(jwk); end + + # source://jwt//lib/jwt/jwk/thumbprint.rb#13 + def generate; end + + # Returns the value of attribute jwk. + # + # source://jwt//lib/jwt/jwk/thumbprint.rb#7 + def jwk; end + + # source://jwt//lib/jwt/jwk/thumbprint.rb#13 + def to_s; end +end + +# source://jwt//lib/jwt/error.rb#22 +class JWT::JWKError < ::JWT::DecodeError; end + +# source://jwt//lib/jwt/error.rb#19 +class JWT::MissingRequiredClaim < ::JWT::DecodeError; end + +# source://jwt//lib/jwt/error.rb#6 +class JWT::RequiredDependencyError < ::StandardError; end + +# source://jwt//lib/jwt/error.rb#13 +class JWT::UnsupportedEcdsaCurve < ::JWT::IncorrectAlgorithm; end + +# Moments version builder module +# +# source://jwt//lib/jwt/version.rb#10 +module JWT::VERSION; end + +# major version +# +# source://jwt//lib/jwt/version.rb#12 +JWT::VERSION::MAJOR = T.let(T.unsafe(nil), Integer) + +# minor version +# +# source://jwt//lib/jwt/version.rb#14 +JWT::VERSION::MINOR = T.let(T.unsafe(nil), Integer) + +# alpha, beta, etc. tag +# +# source://jwt//lib/jwt/version.rb#18 +JWT::VERSION::PRE = T.let(T.unsafe(nil), T.untyped) + +# Build version string +# +# source://jwt//lib/jwt/version.rb#21 +JWT::VERSION::STRING = T.let(T.unsafe(nil), String) + +# tiny version +# +# source://jwt//lib/jwt/version.rb#16 +JWT::VERSION::TINY = T.let(T.unsafe(nil), Integer) + +# source://jwt//lib/jwt/error.rb#8 +class JWT::VerificationError < ::JWT::DecodeError; end + +# If the x5c header certificate chain can be validated by trusted root +# certificates, and none of the certificates are revoked, returns the public +# key from the first certificate. +# See https://tools.ietf.org/html/rfc7515#section-4.1.6 +# +# source://jwt//lib/jwt/x5c_key_finder.rb#8 +class JWT::X5cKeyFinder + # @raise [ArgumentError] + # @return [X5cKeyFinder] a new instance of X5cKeyFinder + # + # source://jwt//lib/jwt/x5c_key_finder.rb#9 + def initialize(root_certificates, crls = T.unsafe(nil)); end + + # source://jwt//lib/jwt/x5c_key_finder.rb#15 + def from(x5c_header_or_certificates); end + + private + + # source://jwt//lib/jwt/x5c_key_finder.rb#33 + def build_store(root_certificates, crls); end + + # source://jwt//lib/jwt/x5c_key_finder.rb#42 + def parse_certificates(x5c_header_or_certificates); end +end diff --git a/sorbet/rbi/gems/octokit@9.1.0.rbi b/sorbet/rbi/gems/octokit@9.1.0.rbi new file mode 100644 index 0000000..2fa0a50 --- /dev/null +++ b/sorbet/rbi/gems/octokit@9.1.0.rbi @@ -0,0 +1,11555 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `octokit` gem. +# Please instead update this file by running `bin/tapioca gem octokit`. + + +# Ruby toolkit for the GitHub API +# +# source://octokit//lib/octokit/middleware/follow_redirects.rb#11 +module Octokit + extend ::Octokit::Configurable + + class << self + # API client based on configured options {Configurable} + # + # @return [Octokit::Client] API wrapper + # + # source://octokit//lib/octokit.rb#17 + def client; end + + # EnterpriseAdminClient client based on configured options {Configurable} + # + # @return [Octokit::EnterpriseAdminClient] API wrapper + # + # source://octokit//lib/octokit.rb#26 + def enterprise_admin_client; end + + # EnterpriseManagementConsoleClient client based on configured options {Configurable} + # + # @return [Octokit::EnterpriseManagementConsoleClient] API wrapper + # + # source://octokit//lib/octokit.rb#37 + def enterprise_management_console_client; end + + # ManageGHESClient client based on configured options {Configurable} + # + # @return [Octokit::ManageGHESClient] API wrapper + # + # source://octokit//lib/octokit.rb#48 + def manage_ghes_client; end + + private + + # source://octokit//lib/octokit.rb#65 + def method_missing(method_name, *args, &block); end + + # @return [Boolean] + # + # source://octokit//lib/octokit.rb#58 + def respond_to_missing?(method_name, include_private = T.unsafe(nil)); end + end +end + +# Raised when GitHub returns a 403 HTTP status code +# and body matches 'abuse' +# +# source://octokit//lib/octokit/error.rb#281 +class Octokit::AbuseDetected < ::Octokit::Forbidden; end + +# Raised when GitHub returns a 403 HTTP status code +# and body matches 'account was suspended' +# +# source://octokit//lib/octokit/error.rb#293 +class Octokit::AccountSuspended < ::Octokit::Forbidden; end + +# Raised when a method requires an application client_id +# and secret but none is provided +# +# source://octokit//lib/octokit/error.rb#363 +class Octokit::ApplicationCredentialsRequired < ::StandardError; end + +# Extracts options from method arguments +# +# @private +# +# source://octokit//lib/octokit/arguments.rb#6 +class Octokit::Arguments < ::Array + # @return [Arguments] a new instance of Arguments + # + # source://octokit//lib/octokit/arguments.rb#9 + def initialize(args); end + + # Returns the value of attribute options. + # + # source://octokit//lib/octokit/arguments.rb#7 + def options; end +end + +# Authentication methods for {Octokit::Client} +# +# source://octokit//lib/octokit/authentication.rb#5 +module Octokit::Authentication + # Indicates if the client has OAuth Application + # client_id and secret credentials to make anonymous + # requests at a higher rate limit + # + # @return [Boolean] + # @see https://developer.github.com/v3/#unauthenticated-rate-limited-requests + # + # source://octokit//lib/octokit/authentication.rb#55 + def application_authenticated?; end + + # Indicates if the client was supplied Basic Auth + # username and password + # + # @return [Boolean] + # @see https://developer.github.com/v3/#authentication + # + # source://octokit//lib/octokit/authentication.rb#19 + def basic_authenticated?; end + + # Indicates if the client was supplied a bearer token + # + # @return [Boolean] + # @see https://developer.github.com/early-access/integrations/authentication/#as-an-integration + # + # source://octokit//lib/octokit/authentication.rb#36 + def bearer_authenticated?; end + + # Indicates if the client was supplied an OAuth + # access token + # + # @return [Boolean] + # @see https://developer.github.com/v3/#authentication + # + # source://octokit//lib/octokit/authentication.rb#28 + def token_authenticated?; end + + # Indicates if the client was supplied an OAuth + # access token or Basic Auth username and password + # + # @return [Boolean] + # @see https://developer.github.com/v3/#authentication + # + # source://octokit//lib/octokit/authentication.rb#45 + def user_authenticated?; end + + private + + # source://octokit//lib/octokit/authentication.rb#61 + def login_from_netrc; end +end + +# In Faraday 2.x, the authorization middleware uses new interface +# +# source://octokit//lib/octokit/authentication.rb#7 +Octokit::Authentication::FARADAY_BASIC_AUTH_KEYS = T.let(T.unsafe(nil), Array) + +# Raised when GitHub returns a 502 HTTP status code +# +# source://octokit//lib/octokit/error.rb#353 +class Octokit::BadGateway < ::Octokit::ServerError; end + +# Raised when GitHub returns a 400 HTTP status code +# +# source://octokit//lib/octokit/error.rb#232 +class Octokit::BadRequest < ::Octokit::ClientError; end + +# Raised when GitHub returns a 403 HTTP status code +# and body matches 'billing issue' +# +# source://octokit//lib/octokit/error.rb#297 +class Octokit::BillingIssue < ::Octokit::Forbidden; end + +# Raised when GitHub returns a 404 HTTP status code +# and body matches 'Branch not protected' +# +# source://octokit//lib/octokit/error.rb#312 +class Octokit::BranchNotProtected < ::Octokit::ClientError; end + +# Client for the GitHub API +# +# @see https://developer.github.com +# +# source://octokit//lib/octokit/client/actions_artifacts.rb#4 +class Octokit::Client + include ::Octokit::Authentication + include ::Octokit::Configurable + include ::Octokit::Connection + include ::Octokit::Warnable + include ::Octokit::Client::ActionsArtifacts + include ::Octokit::Client::ActionsSecrets + include ::Octokit::Client::Checks + include ::Octokit::Client::CodeScanning + include ::Octokit::Client::CodespacesSecrets + include ::Octokit::Client::Commits + include ::Octokit::Client::CommitComments + include ::Octokit::Client::CommitPulls + include ::Octokit::Client::CommitBranches + include ::Octokit::Client::CommunityProfile + include ::Octokit::Client::Contents + include ::Octokit::Client::DependabotSecrets + include ::Octokit::Client::Deployments + include ::Octokit::Client::Downloads + include ::Octokit::Client::Environments + include ::Octokit::Client::Emojis + include ::Octokit::Client::Events + include ::Octokit::Client::Feeds + include ::Octokit::Client::Gists + include ::Octokit::Client::Gitignore + include ::Octokit::Client::Hooks + include ::Octokit::Client::ActionsWorkflows + include ::Octokit::Client::ActionsWorkflowJobs + include ::Octokit::Client::ActionsWorkflowRuns + include ::Octokit::Client::Apps + include ::Octokit::Client::Issues + include ::Octokit::Client::Labels + include ::Octokit::Client::LegacySearch + include ::Octokit::Client::Licenses + include ::Octokit::Client::Meta + include ::Octokit::Client::Markdown + include ::Octokit::Client::Marketplace + include ::Octokit::Client::Milestones + include ::Octokit::Client::Notifications + include ::Octokit::Client::OauthApplications + include ::Octokit::Client::Objects + include ::Octokit::Client::Organizations + include ::Octokit::Client::Pages + include ::Octokit::Client::Projects + include ::Octokit::Client::PullRequests + include ::Octokit::Client::RateLimit + include ::Octokit::Client::Reactions + include ::Octokit::Client::Refs + include ::Octokit::Client::Releases + include ::Octokit::Client::Repositories + include ::Octokit::Client::RepositoryInvitations + include ::Octokit::Client::Reviews + include ::Octokit::Client::Say + include ::Octokit::Client::Search + include ::Octokit::Client::ServiceStatus + include ::Octokit::Client::SourceImport + include ::Octokit::Client::Stats + include ::Octokit::Client::Statuses + include ::Octokit::Client::Tokens + include ::Octokit::Client::Traffic + include ::Octokit::Client::Users + + # @return [Client] a new instance of Client + # + # source://octokit//lib/octokit/client.rb#141 + def initialize(options = T.unsafe(nil)); end + + # Set OAuth access token for authentication + # + # @param value [String] 40 character GitHub OAuth access token + # + # source://octokit//lib/octokit/client.rb#226 + def access_token=(value); end + + # Duplicate client using client_id and client_secret as + # Basic Authentication credentials. + # + # @example + # Octokit.client_id = "foo" + # Octokit.client_secret = "bar" + # + # # GET https://api.github.com/?client_id=foo&client_secret=bar + # Octokit.get "/" + # + # Octokit.client.as_app do |client| + # # GET https://foo:bar@api.github.com/ + # client.get "/" + # end + # @yield [app_client] + # + # source://octokit//lib/octokit/client.rb#194 + def as_app(key = T.unsafe(nil), secret = T.unsafe(nil)); end + + # Set Bearer Token for authentication + # + # @param value [String] JWT + # + # source://octokit//lib/octokit/client.rb#234 + def bearer_token=(value); end + + # Set OAuth app client_id + # + # @param value [String] 20 character GitHub OAuth app client_id + # + # source://octokit//lib/octokit/client.rb#242 + def client_id=(value); end + + # Set OAuth app client_secret + # + # @param value [String] 40 character GitHub OAuth app client_secret + # + # source://octokit//lib/octokit/client.rb#250 + def client_secret=(value); end + + # source://octokit//lib/octokit/client.rb#255 + def client_without_redirects(options = T.unsafe(nil)); end + + # Text representation of the client, masking tokens and passwords + # + # @return [String] + # + # source://octokit//lib/octokit/client.rb#161 + def inspect; end + + # Set username for authentication + # + # @param value [String] GitHub username + # + # source://octokit//lib/octokit/client.rb#210 + def login=(value); end + + # Set password for authentication + # + # @param value [String] GitHub password + # + # source://octokit//lib/octokit/client.rb#218 + def password=(value); end + + private + + # convenience method for constructing a user specific path, if the user is logged in + # + # source://octokit//lib/octokit/client/users.rb#454 + def user_path(user, path); end +end + +# Methods for the Actions Artifacts API +# +# @see https://developer.github.com/v3/actions/artifacts +# +# source://octokit//lib/octokit/client/actions_artifacts.rb#8 +module Octokit::Client::ActionsArtifacts + # Get an artifact + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer] Id of an artifact + # @return [Sawyer::Resource] Artifact information + # @see https://docs.github.com/en/rest/actions/artifacts#get-an-artifact + # + # source://octokit//lib/octokit/client/actions_artifacts.rb#41 + def artifact(repo, id, options = T.unsafe(nil)); end + + # Get a download URL for an artifact + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer] Id of an artifact + # @return [String] URL to the .zip archive of the artifact + # @see https://docs.github.com/en/rest/actions/artifacts#download-an-artifact + # + # source://octokit//lib/octokit/client/actions_artifacts.rb#52 + def artifact_download_url(repo, id, options = T.unsafe(nil)); end + + # Delete an artifact + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer] Id of an artifact + # @return [Boolean] Return true if the artifact was successfully deleted + # @see https://docs.github.com/en/rest/actions/artifacts#delete-an-artifact + # + # source://octokit//lib/octokit/client/actions_artifacts.rb#66 + def delete_artifact(repo, id, options = T.unsafe(nil)); end + + # List all artifacts for a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Sawyer::Resource] the total count and an array of artifacts + # @see https://developer.github.com/v3/actions/artifacts#list-artifacts-for-a-repository + # + # source://octokit//lib/octokit/client/actions_artifacts.rb#15 + def repository_artifacts(repo, options = T.unsafe(nil)); end + + # List all artifacts for a workflow run + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param workflow_run_id [Integer] Id of a workflow run + # @return [Sawyer::Resource] the total count and an array of artifacts + # @see https://docs.github.com/en/rest/actions/artifacts#list-workflow-run-artifacts + # + # source://octokit//lib/octokit/client/actions_artifacts.rb#28 + def workflow_run_artifacts(repo, workflow_run_id, options = T.unsafe(nil)); end +end + +# Methods for the Actions Secrets API +# +# @see https://developer.github.com/v3/actions/secrets/ +# +# source://octokit//lib/octokit/client/actions_secrets.rb#8 +module Octokit::Client::ActionsSecrets + # Create or update an environment secret + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param environment [String] Name of environment + # @param name [String] Name of secret + # @param options [Hash] encrypted_value and key_id + # @see https://docs.github.com/en/rest/actions/secrets#create-or-update-an-environment-secret + # + # source://octokit//lib/octokit/client/actions_secrets.rb#147 + def create_or_update_actions_environment_secret(repo, environment, name, options); end + + # Create or update secrets + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param name [String] Name of secret + # @param options [Hash] encrypted_value and key_id + # @see https://developer.github.com/v3/actions/secrets/#create-or-update-a-secret-for-a-repository + # + # source://octokit//lib/octokit/client/actions_secrets.rb#75 + def create_or_update_actions_secret(repo, name, options); end + + # Create or update org secrets + # + # @param org [String] A GitHub organization + # @param name [String] Name of secret + # @param options [Hash] encrypted_value and key_id + # @see https://developer.github.com/v3/actions/secrets/#create-or-update-a-secret + # + # source://octokit//lib/octokit/client/actions_secrets.rb#85 + def create_or_update_org_actions_secret(org, name, options); end + + # Delete environment secret + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param environment [String] Name of environment + # @param name [String] Name of secret + # @see https://docs.github.com/en/rest/actions/secrets#delete-an-environment-secret + # + # source://octokit//lib/octokit/client/actions_secrets.rb#156 + def delete_actions_environment_secret(repo, environment, name); end + + # Delete a secret + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param name [String] Name of secret + # @see https://developer.github.com/v3/actions/secrets/#delete-a-secret-from-a-repository + # + # source://octokit//lib/octokit/client/actions_secrets.rb#94 + def delete_actions_secret(repo, name); end + + # Delete an org secret + # + # @param org [String] A GitHub organization + # @param name [String] Name of secret + # @see https://developer.github.com/v3/actions/secrets/#delete-a-secret + # + # source://octokit//lib/octokit/client/actions_secrets.rb#103 + def delete_org_actions_secret(org, name); end + + # Get environment public key for secrets encryption + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param environment [String] Name of environment + # @return [Hash] key_id and key + # @see https://docs.github.com/en/rest/actions/secrets#get-an-environment-public-key + # + # source://octokit//lib/octokit/client/actions_secrets.rb#113 + def get_actions_environment_public_key(repo, environment); end + + # Get an environment secret + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param environment [String] Name of environment + # @param name [String] Name of secret + # @return [Hash] name, created_at and updated_at + # @see https://docs.github.com/en/rest/actions/secrets#get-an-environment-secret + # + # source://octokit//lib/octokit/client/actions_secrets.rb#136 + def get_actions_environment_secret(repo, environment, name); end + + # Get public key for secrets encryption + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Hash] key_id and key + # @see https://developer.github.com/v3/actions/secrets/#get-your-public-key + # + # source://octokit//lib/octokit/client/actions_secrets.rb#14 + def get_actions_public_key(repo); end + + # Get a secret + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param name [String] Name of secret + # @return [Hash] name, created_at and updated_at + # @see https://developer.github.com/v3/actions/secrets/#get-a-secret + # + # source://octokit//lib/octokit/client/actions_secrets.rb#55 + def get_actions_secret(repo, name); end + + # Get public key for secrets encryption + # + # @param org [String] A GitHub organization + # @return [Hash] key_id and key + # @see https://developer.github.com/v3/actions/secrets/#get-your-public-key + # + # source://octokit//lib/octokit/client/actions_secrets.rb#23 + def get_org_actions_public_key(org); end + + # Get an org secret + # + # @param org [String] A GitHub organization + # @param name [String] Name of secret + # @return [Hash] name, created_at and updated_at + # @see https://developer.github.com/v3/actions/secrets/#get-a-secret + # + # source://octokit//lib/octokit/client/actions_secrets.rb#65 + def get_org_actions_secret(org, name); end + + # List environment secrets + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param environment [String] Name of environment + # @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at) + # @see https://developer.github.com/v3/actions/secrets/#list-environment-secrets + # + # source://octokit//lib/octokit/client/actions_secrets.rb#123 + def list_actions_environment_secrets(repo, environment); end + + # List secrets + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at) + # @see https://developer.github.com/v3/actions/secrets/#list-secrets-for-a-repository + # + # source://octokit//lib/octokit/client/actions_secrets.rb#32 + def list_actions_secrets(repo); end + + # List org secrets + # + # @param org [String] A GitHub organization + # @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at) + # @see https://developer.github.com/v3/actions/secrets/#list-organization-secrets + # + # source://octokit//lib/octokit/client/actions_secrets.rb#43 + def list_org_actions_secrets(org); end +end + +# Methods for the Actions Workflows jobs API +# +# @see https://docs.github.com/rest/actions/workflow-jobs +# +# source://octokit//lib/octokit/client/actions_workflow_jobs.rb#8 +module Octokit::Client::ActionsWorkflowJobs + # List jobs for a workflow run attempt + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param run_id [Integer, String] Id of the workflow run + # @param attempt_number [Integer, String] Attempt number of the workflow run + # @return [Sawyer::Resource] Jobs information + # @see https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt + # + # source://octokit//lib/octokit/client/actions_workflow_jobs.rb#42 + def list_workflow_run_attempt_jobs(repo, run_id, attempt_number, options = T.unsafe(nil)); end + + # List jobs for a workflow run + # + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param run_id [Integer, String] Id of the workflow run + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Jobs information + # @see https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run + # + # source://octokit//lib/octokit/client/actions_workflow_jobs.rb#57 + def list_workflow_run_jobs(repo, run_id, options = T.unsafe(nil)); end + + # List jobs for a workflow run attempt + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param run_id [Integer, String] Id of the workflow run + # @param attempt_number [Integer, String] Attempt number of the workflow run + # @return [Sawyer::Resource] Jobs information + # @see https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt + # + # source://octokit//lib/octokit/client/actions_workflow_jobs.rb#42 + def workflow_run_attempt_jobs(repo, run_id, attempt_number, options = T.unsafe(nil)); end + + # Get a job for a workflow run + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param job_id [Integer, String] Id of the job + # @return [Sawyer::Resource] Job information + # @see https://docs.github.com/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run + # + # source://octokit//lib/octokit/client/actions_workflow_jobs.rb#16 + def workflow_run_job(repo, job_id, options = T.unsafe(nil)); end + + # Download job logs for a workflow run + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param job_id [Integer, String] Id of the job + # @return [String] URL to the archived log files of the job + # @see https://docs.github.com/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run + # + # source://octokit//lib/octokit/client/actions_workflow_jobs.rb#27 + def workflow_run_job_logs(repo, job_id, options = T.unsafe(nil)); end + + # List jobs for a workflow run + # + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param run_id [Integer, String] Id of the workflow run + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Jobs information + # @see https://docs.github.com/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run + # + # source://octokit//lib/octokit/client/actions_workflow_jobs.rb#57 + def workflow_run_jobs(repo, run_id, options = T.unsafe(nil)); end +end + +# Methods for the Actions Workflows runs API +# +# @see https://docs.github.com/rest/actions/workflow-runs +# +# source://octokit//lib/octokit/client/actions_workflow_runs.rb#8 +module Octokit::Client::ActionsWorkflowRuns + # Cancels a workflow run + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer] Id of a workflow run + # @return [Boolean] Returns true if the cancellation was accepted + # @see https://developer.github.com/v3/actions/workflow-runs/#cancel-a-workflow-run + # + # source://octokit//lib/octokit/client/actions_workflow_runs.rb#73 + def cancel_workflow_run(repo, id, options = T.unsafe(nil)); end + + # Deletes a workflow run + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer] Id of a workflow run + # @return [Boolean] Returns true if the run is deleted + # @see https://docs.github.com/en/rest/reference/actions#delete-a-workflow-run + # + # source://octokit//lib/octokit/client/actions_workflow_runs.rb#84 + def delete_workflow_run(repo, id, options = T.unsafe(nil)); end + + # Delete all log files of a workflow run + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer] Id of a workflow run + # @return [Boolean] Returns true if the logs are deleted + # @see https://developer.github.com/v3/actions/workflow-runs/#delete-workflow-run-logs + # + # source://octokit//lib/octokit/client/actions_workflow_runs.rb#109 + def delete_workflow_run_logs(repo, id, options = T.unsafe(nil)); end + + # List all workflow runs for a repository + # + # @option options + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] the total count and an array of workflows + # @see https://developer.github.com/v3/actions/workflow-runs/#list-repository-workflow-runs + # + # source://octokit//lib/octokit/client/actions_workflow_runs.rb#37 + def list_repository_workflow_runs(repo, options = T.unsafe(nil)); end + + # List all runs for a repository workflow + # + # @option options + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param workflow [Integer, String] Id or file name of the workflow + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] the total count and an array of workflows + # @see https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs + # + # source://octokit//lib/octokit/client/actions_workflow_runs.rb#20 + def list_workflow_runs(repo, workflow, options = T.unsafe(nil)); end + + # List all workflow runs for a repository + # + # @option options + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] the total count and an array of workflows + # @see https://developer.github.com/v3/actions/workflow-runs/#list-repository-workflow-runs + # + # source://octokit//lib/octokit/client/actions_workflow_runs.rb#37 + def repository_workflow_runs(repo, options = T.unsafe(nil)); end + + # Re-runs a workflow run + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer] Id of a workflow run + # @return [Boolean] Returns true if the re-run request was accepted + # @see https://developer.github.com/v3/actions/workflow-runs/#re-run-a-workflow + # + # source://octokit//lib/octokit/client/actions_workflow_runs.rb#62 + def rerun_workflow_run(repo, id, options = T.unsafe(nil)); end + + # Get a workflow run + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer] Id of a workflow run + # @return [Sawyer::Resource] Run information + # @see https://developer.github.com/v3/actions/workflow-runs/#get-a-workflow-run + # + # source://octokit//lib/octokit/client/actions_workflow_runs.rb#51 + def workflow_run(repo, id, options = T.unsafe(nil)); end + + # Get a download url for archived log files of a workflow run + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer] Id of a workflow run + # @return [String] URL to the archived log files of the run + # @see https://developer.github.com/v3/actions/workflow-runs/#download-workflow-run-logs + # + # source://octokit//lib/octokit/client/actions_workflow_runs.rb#95 + def workflow_run_logs(repo, id, options = T.unsafe(nil)); end + + # Get workflow run usage + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer] Id of a workflow run + # @return [Sawyer::Resource] Run usage + # @see https://developer.github.com/v3/actions/workflow-runs/#get-workflow-run-usage + # + # source://octokit//lib/octokit/client/actions_workflow_runs.rb#120 + def workflow_run_usage(repo, id, options = T.unsafe(nil)); end + + # List all runs for a repository workflow + # + # @option options + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param workflow [Integer, String] Id or file name of the workflow + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] the total count and an array of workflows + # @see https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs + # + # source://octokit//lib/octokit/client/actions_workflow_runs.rb#20 + def workflow_runs(repo, workflow, options = T.unsafe(nil)); end +end + +# Methods for the Actions Workflows API +# +# @see https://developer.github.com/v3/actions/workflows +# +# source://octokit//lib/octokit/client/actions_workflows.rb#8 +module Octokit::Client::ActionsWorkflows + # Get the workflows in a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Sawyer::Resource] the total count and an array of workflows + # @see https://developer.github.com/v3/actions/workflows/#list-repository-workflows + # + # source://octokit//lib/octokit/client/actions_workflows.rb#15 + def list_workflows(repo, options = T.unsafe(nil)); end + + # Get single workflow in a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer, String] Id or file name of the workflow + # @return [Sawyer::Resource] A single workflow + # @see https://developer.github.com/v3/actions/workflows/#get-a-workflow + # + # source://octokit//lib/octokit/client/actions_workflows.rb#29 + def workflow(repo, id, options = T.unsafe(nil)); end + + # Disable a workflow + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer, String] Id or file name of the workflow + # @return [Boolean] True if workflow was disabled, false otherwise + # @see https://docs.github.com/en/rest/actions/workflows#disable-a-workflow + # + # source://octokit//lib/octokit/client/actions_workflows.rb#63 + def workflow_disable(repo, id, options = T.unsafe(nil)); end + + # Create a workflow dispatch event + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer, String] Id or file name of the workflow + # @param ref [String] A SHA, branch name, or tag name + # @return [Boolean] True if event was dispatched, false otherwise + # @see https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event + # + # source://octokit//lib/octokit/client/actions_workflows.rb#41 + def workflow_dispatch(repo, id, ref, options = T.unsafe(nil)); end + + # Enable a workflow + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer, String] Id or file name of the workflow + # @return [Boolean] True if workflow was enabled, false otherwise + # @see https://docs.github.com/en/rest/actions/workflows#enable-a-workflow + # + # source://octokit//lib/octokit/client/actions_workflows.rb#52 + def workflow_enable(repo, id, options = T.unsafe(nil)); end + + # Get the workflows in a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Sawyer::Resource] the total count and an array of workflows + # @see https://developer.github.com/v3/actions/workflows/#list-repository-workflows + # + # source://octokit//lib/octokit/client/actions_workflows.rb#15 + def workflows(repo, options = T.unsafe(nil)); end +end + +# Methods for the Apps API +# +# source://octokit//lib/octokit/client/apps.rb#6 +module Octokit::Client::Apps + # Add a single repository to an installation + # + # @param installation [Integer] The id of a GitHub App Installation + # @param repo [Integer] The id of the GitHub repository + # @param options [Hash] A customizable set of options + # @return [Boolean] Success + # @see https://developer.github.com/v3/apps/installations/#add-repository-to-installation + # + # source://octokit//lib/octokit/client/apps.rb#156 + def add_repo_to_installation(installation, repo, options = T.unsafe(nil)); end + + # Add a single repository to an installation + # + # @param installation [Integer] The id of a GitHub App Installation + # @param repo [Integer] The id of the GitHub repository + # @param options [Hash] A customizable set of options + # @return [Boolean] Success + # @see https://developer.github.com/v3/apps/installations/#add-repository-to-installation + # + # source://octokit//lib/octokit/client/apps.rb#156 + def add_repository_to_app_installation(installation, repo, options = T.unsafe(nil)); end + + # source://octokit//lib/octokit/client/apps.rb#161 + def add_repository_to_integration_installation(installation, repo, options = T.unsafe(nil)); end + + # Get the authenticated App + # + # @param options [Hash] A customizable set of options + # @return [Sawyer::Resource] App information + # @see https://developer.github.com/v3/apps/#get-the-authenticated-app + # + # source://octokit//lib/octokit/client/apps.rb#14 + def app(options = T.unsafe(nil)); end + + # Returns a delivery for the webhook configured for a GitHub App. + # + # @param delivery_id [String] The id of a GitHub App Hook Delivery + # @param options [Hash] A customizable set of options + # @return [] The webhook delivery + # @see https://docs.github.com/en/rest/apps/webhooks#get-a-delivery-for-an-app-webhook + # + # source://octokit//lib/octokit/client/apps.rb#242 + def app_hook_delivery(delivery_id, options = T.unsafe(nil)); end + + # Create a new installation token + # + # @param installation [Integer] The id of a GitHub App Installation + # @param options [Hash] A customizable set of options + # @return [] An installation token + # @see https://developer.github.com/v3/apps/#create-a-new-installation-token + # + # source://octokit//lib/octokit/client/apps.rb#72 + def create_app_installation_access_token(installation, options = T.unsafe(nil)); end + + # Create a new installation token + # + # @param installation [Integer] The id of a GitHub App Installation + # @param options [Hash] A customizable set of options + # @return [] An installation token + # @see https://developer.github.com/v3/apps/#create-a-new-installation-token + # + # source://octokit//lib/octokit/client/apps.rb#72 + def create_installation_access_token(installation, options = T.unsafe(nil)); end + + # source://octokit//lib/octokit/client/apps.rb#77 + def create_integration_installation_access_token(installation, options = T.unsafe(nil)); end + + # Delete an installation and uninstall a GitHub App + # + # @param installation [Integer] The id of a GitHub App Installation + # @param options [Hash] A customizable set of options + # @return [Boolean] Success + # @see https://developer.github.com/v3/apps/#delete-an-installation + # + # source://octokit//lib/octokit/client/apps.rb#217 + def delete_installation(installation, options = T.unsafe(nil)); end + + # Redeliver a delivery for the webhook configured for a GitHub App. + # + # @param delivery_id [Integer] The id of a GitHub App Hook Delivery + # @param options [Hash] A customizable set of options + # @return [Boolean] Success + # @see https://developer.github.com/v3/apps/#redeliver-a-delivery-for-an-app-webhook + # + # source://octokit//lib/octokit/client/apps.rb#254 + def deliver_app_hook(delivery_id, options = T.unsafe(nil)); end + + # Find all installations that belong to an App + # + # @param options [Hash] A customizable set of options + # @return [Array] the total_count and an array of installations + # @see https://developer.github.com/v3/apps/#list-installations + # + # source://octokit//lib/octokit/client/apps.rb#25 + def find_app_installations(options = T.unsafe(nil)); end + + # List repositories accessible to the user for an installation + # + # @param installation [Integer] The id of a GitHub App Installation + # @param options [Hash] A customizable set of options + # @return [Sawyer::Resource] the total_count and an array of repositories + # @see https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-for-an-installation + # + # source://octokit//lib/octokit/client/apps.rb#203 + def find_installation_repositories_for_user(installation, options = T.unsafe(nil)); end + + # Find all installations that belong to an App + # + # @param options [Hash] A customizable set of options + # @return [Array] the total_count and an array of installations + # @see https://developer.github.com/v3/apps/#list-installations + # + # source://octokit//lib/octokit/client/apps.rb#25 + def find_installations(options = T.unsafe(nil)); end + + # source://octokit//lib/octokit/client/apps.rb#30 + def find_integration_installations(options = T.unsafe(nil)); end + + # Enables an app to find the organization's installation information. + # + # @param organization [String] Organization GitHub login + # @param options [Hash] A customizable set of options + # @return [Sawyer::Resource] Installation information + # @see https://developer.github.com/v3/apps/#get-an-organization-installation + # + # source://octokit//lib/octokit/client/apps.rb#95 + def find_organization_installation(organization, options = T.unsafe(nil)); end + + # Enables an app to find the repository's installation information. + # + # @param repo [String] A GitHub repository + # @param options [Hash] A customizable set of options + # @return [Sawyer::Resource] Installation information + # @see https://developer.github.com/v3/apps/#get-a-repository-installation + # + # source://octokit//lib/octokit/client/apps.rb#107 + def find_repository_installation(repo, options = T.unsafe(nil)); end + + # Enables an app to find the user's installation information. + # + # @param user [String] GitHub user login + # @param options [Hash] A customizable set of options + # @return [Sawyer::Resource] Installation information + # @see https://developer.github.com/v3/apps/#get-a-user-installation + # + # source://octokit//lib/octokit/client/apps.rb#119 + def find_user_installation(user, options = T.unsafe(nil)); end + + # Find all installations that are accessible to the authenticated user + # + # @param options [Hash] A customizable set of options + # @return [Sawyer::Resource] the total_count and an array of installations + # @see https://developer.github.com/v3/apps/installations/#list-installations-for-a-user + # + # source://octokit//lib/octokit/client/apps.rb#47 + def find_user_installations(options = T.unsafe(nil)); end + + # Get a single installation + # + # @param id [Integer] Installation id + # @return [Sawyer::Resource] Installation information + # @see https://developer.github.com/v3/apps/#get-an-installation + # + # source://octokit//lib/octokit/client/apps.rb#60 + def installation(id, options = T.unsafe(nil)); end + + # Returns a list of webhook deliveries for the webhook configured for a GitHub App. + # + # @param options [Hash] A customizable set of options + # @return [Array] an array of hook deliveries + # @see https://docs.github.com/en/rest/apps/webhooks#list-deliveries-for-an-app-webhook + # + # source://octokit//lib/octokit/client/apps.rb#228 + def list_app_hook_deliveries(options = T.unsafe(nil)); end + + # List repositories that are accessible to the authenticated installation + # + # @param options [Hash] A customizable set of options + # @return [Sawyer::Resource] the total_count and an array of repositories + # @see https://developer.github.com/v3/apps/installations/#list-repositories + # + # source://octokit//lib/octokit/client/apps.rb#130 + def list_app_installation_repositories(options = T.unsafe(nil)); end + + # List repositories that are accessible to the authenticated installation + # + # @param options [Hash] A customizable set of options + # @return [Sawyer::Resource] the total_count and an array of repositories + # @see https://developer.github.com/v3/apps/installations/#list-repositories + # + # source://octokit//lib/octokit/client/apps.rb#130 + def list_installation_repos(options = T.unsafe(nil)); end + + # source://octokit//lib/octokit/client/apps.rb#137 + def list_integration_installation_repositories(options = T.unsafe(nil)); end + + # Remove a single repository to an installation + # + # @param installation [Integer] The id of a GitHub App Installation + # @param repo [Integer] The id of the GitHub repository + # @param options [Hash] A customizable set of options + # @return [Boolean] Success + # @see https://developer.github.com/v3/apps/installations/#remove-repository-from-installation + # + # source://octokit//lib/octokit/client/apps.rb#180 + def remove_repo_from_installation(installation, repo, options = T.unsafe(nil)); end + + # Remove a single repository to an installation + # + # @param installation [Integer] The id of a GitHub App Installation + # @param repo [Integer] The id of the GitHub repository + # @param options [Hash] A customizable set of options + # @return [Boolean] Success + # @see https://developer.github.com/v3/apps/installations/#remove-repository-from-installation + # + # source://octokit//lib/octokit/client/apps.rb#180 + def remove_repository_from_app_installation(installation, repo, options = T.unsafe(nil)); end + + # source://octokit//lib/octokit/client/apps.rb#185 + def remove_repository_from_integration_installation(installation, repo, options = T.unsafe(nil)); end +end + +# Header keys that can be passed in options hash to {#get},{#head} +# +# source://octokit//lib/octokit/client.rb#139 +Octokit::Client::CONVENIENCE_HEADERS = T.let(T.unsafe(nil), Set) + +# Methods for the Checks API +# +# @see https://developer.github.com/v3/checks/ +# +# source://octokit//lib/octokit/client/checks.rb#8 +module Octokit::Client::Checks + # Get a single check run + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The ID of the check run + # @return [Sawyer::Resource] A hash representing the check run + # @see https://developer.github.com/v3/checks/runs/#get-a-single-check-run + # + # source://octokit//lib/octokit/client/checks.rb#100 + def check_run(repo, id, options = T.unsafe(nil)); end + + # List annotations for a check run + # + # @example List annotations for a check run + # annotations = @client.check_run_annotations("octocat/Hello-World", 51295429) + # annotations.count # => 1 + # annotations[0].path # => "README.md" + # annotations[0].message # => "Looks good!" + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The ID of the check run + # @return [Array] An array of hashes representing check run annotations + # @see https://developer.github.com/v3/checks/runs/#list-annotations-for-a-check-run + # + # source://octokit//lib/octokit/client/checks.rb#115 + def check_run_annotations(repo, id, options = T.unsafe(nil)); end + + # List check runs in a check suite + # + # @example List check runs in a check suite + # result = @client.check_runs_for_check_suite("octocat/Hello-World", 50440400, status: "in_progress") + # result.total_count # => 1 + # result.check_runs.count # => 1 + # result.check_runs[0].check_suite.id # => 50440400 + # result.check_runs[0].status # => "in_progress" + # @option options + # @option options + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The ID of the check suite + # @param options [Hash] A set of optional filters + # @return [Sawyer::Resource] A hash representing a collection of check runs + # @see https://developer.github.com/v3/checks/runs/#list-check-runs-in-a-check-suite + # + # source://octokit//lib/octokit/client/checks.rb#86 + def check_runs_for_check_suite(repo, id, options = T.unsafe(nil)); end + + # List check runs for a specific ref + # + # @example List check runs for a specific ref + # result = @client.check_runs_for_ref("octocat/Hello-World", "7638417db6d59f3c431d3e1f261cc637155684cd", status: "in_progress") + # result.total_count # => 1 + # result.check_runs.count # => 1 + # result.check_runs[0].id # => 51295429 + # result.check_runs[0].status # => "in_progress" + # @option options + # @option options + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param ref [String] A SHA, branch name, or tag name + # @param options [Hash] A set of optional filters + # @return [Sawyer::Resource] A hash representing a collection of check runs + # @see https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-specific-ref + # + # source://octokit//lib/octokit/client/checks.rb#62 + def check_runs_for_ref(repo, ref, options = T.unsafe(nil)); end + + # Get a single check suite + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The ID of the check suite + # @return [Sawyer::Resource] A hash representing the check suite + # @see https://developer.github.com/v3/checks/suites/#get-a-single-check-suite + # + # source://octokit//lib/octokit/client/checks.rb#129 + def check_suite(repo, id, options = T.unsafe(nil)); end + + # List check suites for a specific ref + # + # @example List check suites for a specific ref + # result = @client.check_suites_for_ref("octocat/Hello-World", "7638417db6d59f3c431d3e1f261cc637155684cd", app_id: 76765) + # result.total_count # => 1 + # result.check_suites.count # => 1 + # result.check_suites[0].id # => 50440400 + # result.check_suites[0].app.id # => 76765 + # @option options + # @option options + # @param ref [String] A SHA, branch name, or tag name + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param options [Hash] A set of optional filters + # @return [Sawyer::Resource] A hash representing a collection of check suites + # @see https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-specific-ref + # + # source://octokit//lib/octokit/client/checks.rb#148 + def check_suites_for_ref(repo, ref, options = T.unsafe(nil)); end + + # Create a check run + # + # @example Create a check run + # check_run = @client.create_check_run("octocat/Hello-World", "my-check", "7638417db6d59f3c431d3e1f261cc637155684cd") + # check_run.name # => "my-check" + # check_run.head_sha # => "7638417db6d59f3c431d3e1f261cc637155684cd" + # check_run.status # => "queued" + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param name [String] The name of the check + # @param head_sha [String] The SHA of the commit to check + # @return [Sawyer::Resource] A hash representing the new check run + # @see https://developer.github.com/v3/checks/runs/#create-a-check-run + # + # source://octokit//lib/octokit/client/checks.rb#25 + def create_check_run(repo, name, head_sha, options = T.unsafe(nil)); end + + # Create a check suite + # + # @example Create a check suite + # check_suite = @client.create_check_suite("octocat/Hello-World", "7638417db6d59f3c431d3e1f261cc637155684cd") + # check_suite.head_sha # => "7638417db6d59f3c431d3e1f261cc637155684cd" + # check_suite.status # => "queued" + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param head_sha [String] The SHA of the commit to check + # @return [Sawyer::Resource] A hash representing the new check suite + # @see https://developer.github.com/v3/checks/suites/#create-a-check-suite + # + # source://octokit//lib/octokit/client/checks.rb#182 + def create_check_suite(repo, head_sha, options = T.unsafe(nil)); end + + # List check runs in a check suite + # + # @example List check runs in a check suite + # result = @client.check_runs_for_check_suite("octocat/Hello-World", 50440400, status: "in_progress") + # result.total_count # => 1 + # result.check_runs.count # => 1 + # result.check_runs[0].check_suite.id # => 50440400 + # result.check_runs[0].status # => "in_progress" + # @option options + # @option options + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The ID of the check suite + # @param options [Hash] A set of optional filters + # @return [Sawyer::Resource] A hash representing a collection of check runs + # @see https://developer.github.com/v3/checks/runs/#list-check-runs-in-a-check-suite + # + # source://octokit//lib/octokit/client/checks.rb#86 + def list_check_runs_for_check_suite(repo, id, options = T.unsafe(nil)); end + + # List check runs for a specific ref + # + # @example List check runs for a specific ref + # result = @client.check_runs_for_ref("octocat/Hello-World", "7638417db6d59f3c431d3e1f261cc637155684cd", status: "in_progress") + # result.total_count # => 1 + # result.check_runs.count # => 1 + # result.check_runs[0].id # => 51295429 + # result.check_runs[0].status # => "in_progress" + # @option options + # @option options + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param ref [String] A SHA, branch name, or tag name + # @param options [Hash] A set of optional filters + # @return [Sawyer::Resource] A hash representing a collection of check runs + # @see https://developer.github.com/v3/checks/runs/#list-check-runs-for-a-specific-ref + # + # source://octokit//lib/octokit/client/checks.rb#62 + def list_check_runs_for_ref(repo, ref, options = T.unsafe(nil)); end + + # List check suites for a specific ref + # + # @example List check suites for a specific ref + # result = @client.check_suites_for_ref("octocat/Hello-World", "7638417db6d59f3c431d3e1f261cc637155684cd", app_id: 76765) + # result.total_count # => 1 + # result.check_suites.count # => 1 + # result.check_suites[0].id # => 50440400 + # result.check_suites[0].app.id # => 76765 + # @option options + # @option options + # @param ref [String] A SHA, branch name, or tag name + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param options [Hash] A set of optional filters + # @return [Sawyer::Resource] A hash representing a collection of check suites + # @see https://developer.github.com/v3/checks/suites/#list-check-suites-for-a-specific-ref + # + # source://octokit//lib/octokit/client/checks.rb#148 + def list_check_suites_for_ref(repo, ref, options = T.unsafe(nil)); end + + # Rerequest check suite + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The ID of the check suite + # @return [Boolean] True if successful, raises an error otherwise + # @see https://developer.github.com/v3/checks/suites/#rerequest-check-suite + # + # source://octokit//lib/octokit/client/checks.rb#194 + def rerequest_check_suite(repo, id, options = T.unsafe(nil)); end + + # Set preferences for check suites on a repository + # + # @example Set preferences for check suites on a repository + # result = @client.set_check_suite_preferences("octocat/Hello-World", auto_trigger_checks: [{ app_id: 76765, setting: false }]) + # result.preferences.auto_trigger_checks.count # => 1 + # result.preferences.auto_trigger_checks[0].app_id # => 76765 + # result.preferences.auto_trigger_checks[0].setting # => false + # result.repository.full_name # => "octocat/Hello-World" + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param options [Hash] Preferences to set + # @return [Sawyer::Resource] A hash representing the repository's check suite preferences + # @see https://developer.github.com/v3/checks/suites/#set-preferences-for-check-suites-on-a-repository + # + # source://octokit//lib/octokit/client/checks.rb#168 + def set_check_suite_preferences(repo, options = T.unsafe(nil)); end + + # Update a check run + # + # @example Update a check run + # check_run = @client.update_check_run("octocat/Hello-World", 51295429, status: "in_progress") + # check_run.id # => 51295429 + # check_run.status # => "in_progress" + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The ID of the check run + # @return [Sawyer::Resource] A hash representing the updated check run + # @see https://developer.github.com/v3/checks/runs/#update-a-check-run + # + # source://octokit//lib/octokit/client/checks.rb#42 + def update_check_run(repo, id, options = T.unsafe(nil)); end +end + +# Methods for the code scanning alerts API +# +# @see https://docs.github.com/rest/code-scanning +# +# source://octokit//lib/octokit/client/code_scanning.rb#11 +module Octokit::Client::CodeScanning + # Delete a specified code scanning analysis from a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param analysis_id [Integer] ID of the code scanning analysis + # @return [Sawyer::Resource] Next Code Scanning Analysis Information + # @see https://docs.github.com/en/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository + # + # source://octokit//lib/octokit/client/code_scanning.rb#67 + def delete_code_scanning_analysis(repo, analysis_id, options = T.unsafe(nil)); end + + # Gets a single code scanning alert + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param alert_number [Integer] The number that identifies an alert + # @return [Sawyer::Resource] Code Scanning Alert + # @see https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-alert + # + # source://octokit//lib/octokit/client/code_scanning.rb#126 + def get_code_scanning_alert(repo, alert_number, options = T.unsafe(nil)); end + + # Get a code scanning analysis for a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param analysis_id [Integer] ID of the code scanning analysis + # @return [Sawyer::Resource] Code Scanning Analysis + # @see https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository + # + # source://octokit//lib/octokit/client/code_scanning.rb#78 + def get_code_scanning_analysis(repo, analysis_id, options = T.unsafe(nil)); end + + # Get Code Scanning Default Configuration + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Sawyer::Resource] CodeQl Default Setup Configuration Information + # @see https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration + # + # source://octokit//lib/octokit/client/code_scanning.rb#35 + def get_code_scanning_default_config(repo, options = T.unsafe(nil)); end + + # Gets a CodeQL database for a language in a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param language [String] + # @return [Sawyer::Resource] CodeQl Default Setup Configuration Information + # @see https://docs.github.com/en/rest/code-scanning/code-scanning#get-a-codeql-database-for-a-repository + # + # source://octokit//lib/octokit/client/code_scanning.rb#46 + def get_codeql_database_for_repo(repo, language, options = T.unsafe(nil)); end + + # Gets information about a SARIF upload + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param sarif_id [String] The SARIF ID obtained after uploading + # @return [Sawyer::Resource] SARIF upload information + # @see https://docs.github.com/rest/code-scanning#get-information-about-a-sarif-upload + # + # source://octokit//lib/octokit/client/code_scanning.rb#174 + def get_sarif_upload_information(repo, sarif_id, options = T.unsafe(nil)); end + + # List code scanning alerts for an organization + # + # @param org [String] A GitHub organization + # @return [Array] Code Scanning Alert information + # @see https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization + # + # source://octokit//lib/octokit/client/code_scanning.rb#146 + def list_code_scanning_alerts_for_org(org, options = T.unsafe(nil)); end + + # List code scanning alerts for a repository + # + # @param org [String] A GitHub organization + # @return [Array] Code Scanning Alert information + # @see https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository + # + # source://octokit//lib/octokit/client/code_scanning.rb#136 + def list_code_scanning_alerts_for_repo(repo, options = T.unsafe(nil)); end + + # List code scanning analyses for a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] List of Code Scanning Analyses + # @see https://docs.github.com/en/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository + # + # source://octokit//lib/octokit/client/code_scanning.rb#88 + def list_code_scanning_analysis(repo, options = T.unsafe(nil)); end + + # Lists the CodeQL databases that are available in a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] List of CodeQL Databases + # @see https://docs.github.com/en/rest/code-scanning/code-scanning#list-codeql-databases-for-a-repository + # + # source://octokit//lib/octokit/client/code_scanning.rb#56 + def list_codeql_database_for_repo(repo, options = T.unsafe(nil)); end + + # List instances of a code scanning alert + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param alert_number [Integer] The number that identifies an alert + # @return [Array] List of Code Scanning Alerts + # @see https://docs.github.com/en/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert + # + # source://octokit//lib/octokit/client/code_scanning.rb#99 + def list_instances_of_code_scanning_alert(repo, alert_number, options = T.unsafe(nil)); end + + # Update a code scanning alert + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param alert_number [Integer] The number that identifies an alert + # @param state [String] The reason for dismissing or closing the alert. Required when the state is dismissed + # @return [Sawyer::Resource] Code Scanning Alert information + # @see https://docs.github.com/en/rest/code-scanning/code-scanning#update-a-code-scanning-alert + # + # source://octokit//lib/octokit/client/code_scanning.rb#111 + def update_code_scanning_alert(repo, alert_number, state, reason, comment = T.unsafe(nil), options = T.unsafe(nil)); end + + # Updates a code scanning default setup configuration + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param state [String] The desired state of code scanning default setup + # @param query_suite [String] CodeQL query suite to be used + # @param languages [Array] List of CodeQL languages to be analyzed + # @return [Sawyer::Resource] Action Run information + # @see https://docs.github.com/en/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration + # + # source://octokit//lib/octokit/client/code_scanning.rb#21 + def update_code_scanning_default_config(repo, state, query_suite = T.unsafe(nil), languages = T.unsafe(nil), options = T.unsafe(nil)); end + + # Uploads SARIF data containing the results of a code scanning analysis + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param file [String] Path to the SARIF file to upload + # @param sha [String] The SHA of the commit to which the analysis you are uploading relates + # @param ref [String] The full Git reference, formatted as `refs/heads/`, `refs/pull//merge`, or `refs/pull//head` + # @return [Sawyer::Resource] SARIF upload information + # @see https://docs.github.com/rest/code-scanning#upload-an-analysis-as-sarif-data + # + # source://octokit//lib/octokit/client/code_scanning.rb#159 + def upload_sarif_data(repo, file, sha, ref, options = T.unsafe(nil)); end + + private + + # source://octokit//lib/octokit/client/code_scanning.rb#180 + def compress_sarif_data(file); end +end + +# Methods for the Codespaces Secrets API +# +# @see https://docs.github.com/en/rest/codespaces/ +# +# source://octokit//lib/octokit/client/codespaces_secrets.rb#8 +module Octokit::Client::CodespacesSecrets + # Create or update secrets + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param name [String] Name of secret + # @param options [Hash] encrypted_value and key_id + # @see https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret + # + # source://octokit//lib/octokit/client/codespaces_secrets.rb#75 + def create_or_update_codespaces_secret(repo, name, options); end + + # Create or update org secrets + # + # @param org [String] A GitHub organization + # @param name [String] Name of secret + # @param options [Hash] encrypted_value and key_id + # @see https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret + # + # source://octokit//lib/octokit/client/codespaces_secrets.rb#85 + def create_or_update_org_codespaces_secret(org, name, options); end + + # Delete a secret + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param name [String] Name of secret + # @see https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#delete-a-repository-secret + # + # source://octokit//lib/octokit/client/codespaces_secrets.rb#94 + def delete_codespaces_secret(repo, name); end + + # Delete an org secret + # + # @param org [String] A GitHub organization + # @param name [String] Name of secret + # @see https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#delete-an-organization-secret + # + # source://octokit//lib/octokit/client/codespaces_secrets.rb#103 + def delete_org_codespaces_secret(org, name); end + + # Get public key for secrets encryption + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Hash] key_id and key + # @see https://docs.github.com/en/rest/codespaces/repository-secrets#get-a-repository-public-key + # + # source://octokit//lib/octokit/client/codespaces_secrets.rb#14 + def get_codespaces_public_key(repo); end + + # Get a secret + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param name [String] Name of secret + # @return [Hash] name, created_at, updated_at, and visibility + # @see https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#get-a-repository-secret + # + # source://octokit//lib/octokit/client/codespaces_secrets.rb#55 + def get_codespaces_secret(repo, name); end + + # Get public key for secrets encryption + # + # @param org [String] A GitHub organization + # @return [Hash] key_id and key + # @see https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-public-key + # + # source://octokit//lib/octokit/client/codespaces_secrets.rb#23 + def get_org_codespaces_public_key(org); end + + # Get an org secret + # + # @param org [String] A GitHub organization + # @param name [String] Name of secret + # @return [Hash] name, created_at, updated_at, and visibility + # @see https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#get-an-organization-secret + # + # source://octokit//lib/octokit/client/codespaces_secrets.rb#65 + def get_org_codespaces_secret(org, name); end + + # List secrets + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at) + # @see https://docs.github.com/en/rest/codespaces/repository-secrets?apiVersion=2022-11-28#list-repository-secrets + # + # source://octokit//lib/octokit/client/codespaces_secrets.rb#32 + def list_codespaces_secrets(repo); end + + # List org secrets + # + # @param org [String] A GitHub organization + # @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at) + # @see https://docs.github.com/en/rest/codespaces/organization-secrets?apiVersion=2022-11-28#list-organization-secrets + # + # source://octokit//lib/octokit/client/codespaces_secrets.rb#43 + def list_org_codespaces_secrets(org); end +end + +# Methods for the Branches for HEAD API +# +# @see https://developer.github.com/v3/repos/commits/ +# +# source://octokit//lib/octokit/client/commit_branches.rb#8 +module Octokit::Client::CommitBranches + # List branches for a single HEAD commit + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param sha [String] The SHA of the commit whose branches will be fetched + # @return [Array] List of branches + # @see https://developer.github.com/v3/repos/commits/#list-branches-for-head-commit + # + # source://octokit//lib/octokit/client/commit_branches.rb#15 + def commit_branches(repo, sha, options = T.unsafe(nil)); end +end + +# Methods for the Commit Comments API +# +# @see https://developer.github.com/v3/repos/comments/ +# +# source://octokit//lib/octokit/client/commit_comments.rb#8 +module Octokit::Client::CommitComments + # Get a single commit comment + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [String] The ID of the comment to fetch + # @return [Sawyer::Resource] Commit comment + # @see https://developer.github.com/v3/repos/comments/#get-a-single-commit-comment + # + # source://octokit//lib/octokit/client/commit_comments.rb#34 + def commit_comment(repo, id, options = T.unsafe(nil)); end + + # List comments for a single commit + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param sha [String] The SHA of the commit whose comments will be fetched + # @return [Array] List of commit comments + # @see https://developer.github.com/v3/repos/comments/#list-comments-for-a-single-commit + # + # source://octokit//lib/octokit/client/commit_comments.rb#24 + def commit_comments(repo, sha, options = T.unsafe(nil)); end + + # Create a commit comment + # + # @example Create a commit comment + # comment = Octokit.create_commit_comment("octocat/Hello-World", "827efc6d56897b048c772eb4087f854f46256132", "My comment message", "README.md", 10, 1) + # comment.commit_id # => "827efc6d56897b048c772eb4087f854f46256132" + # comment.id # => 54321 + # comment.body # => "My comment message" + # comment.path # => "README.md" + # comment.line # => 10 + # comment.position # => 1 + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param sha [String] Sha of the commit to comment on + # @param body [String] Message + # @param line [Integer] Line number in the file to comment on + # @param position [Integer] Line index in the diff to comment on + # @param path [String] Relative path of file to comment on + # @return [Sawyer::Resource] Commit comment + # @see https://developer.github.com/v3/repos/comments/#create-a-commit-comment + # + # source://octokit//lib/octokit/client/commit_comments.rb#56 + def create_commit_comment(repo, sha, body, path = T.unsafe(nil), line = T.unsafe(nil), position = T.unsafe(nil), options = T.unsafe(nil)); end + + # Delete a commit comment + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [String] The ID of the comment to delete + # @return [Boolean] Success + # @see https://developer.github.com/v3/repos/comments/#delete-a-commit-comment + # + # source://octokit//lib/octokit/client/commit_comments.rb#90 + def delete_commit_comment(repo, id, options = T.unsafe(nil)); end + + # List all commit comments + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Array] List of commit comments + # @see https://developer.github.com/v3/repos/comments/#list-commit-comments-for-a-repository + # + # source://octokit//lib/octokit/client/commit_comments.rb#14 + def list_commit_comments(repo, options = T.unsafe(nil)); end + + # Update a commit comment + # + # @example Update a commit comment + # comment = Octokit.update_commit_comment("octocat/Hello-World", "860296", "Updated commit comment") + # comment.id # => 860296 + # comment.body # => "Updated commit comment" + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [String] The ID of the comment to update + # @param body [String] Message + # @return [Sawyer::Resource] Updated commit comment + # @see https://developer.github.com/v3/repos/comments/#update-a-commit-comment + # + # source://octokit//lib/octokit/client/commit_comments.rb#77 + def update_commit_comment(repo, id, body, options = T.unsafe(nil)); end +end + +# Methods for the Commit Pulls API +# +# @see https://developer.github.com/v3/repos/comments/ +# +# source://octokit//lib/octokit/client/commit_pulls.rb#8 +module Octokit::Client::CommitPulls + # List pulls for a single commit + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param sha [String] The SHA of the commit whose pulls will be fetched + # @return [Array] List of commit pulls + # @see https://developer.github.com/v3/repos/commits/#list-pull-requests-associated-with-commit + # + # source://octokit//lib/octokit/client/commit_pulls.rb#15 + def commit_pulls(repo, sha, options = T.unsafe(nil)); end +end + +# Methods for the Commits API +# +# @see https://developer.github.com/v3/repos/commits/ +# +# source://octokit//lib/octokit/client/commits.rb#10 +module Octokit::Client::Commits + # Get a single commit + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param sha [String] The SHA of the commit to fetch + # @return [Sawyer::Resource] A hash representing the commit + # @see https://developer.github.com/v3/repos/commits/#get-a-single-commit + # + # source://octokit//lib/octokit/client/commits.rb#143 + def commit(repo, sha, options = T.unsafe(nil)); end + + # List commits + # + # @overload commits + # @overload commits + # @return [Array] An array of hashes representing commits + # @see https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository + # + # source://octokit//lib/octokit/client/commits.rb#23 + def commits(*args); end + + # Get commits before a specified date + # + # @example + # Octokit.commits_before('octokit/octokit.rb', '2012-10-01') + # @overload commits_before + # @overload commits_before + # @return [Array] An array of hashes representing commits + # @see https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository + # + # source://octokit//lib/octokit/client/commits.rb#71 + def commits_before(*args); end + + # Get commits made between two nominated dates + # + # @example + # Octokit.commits_between('octokit/octokit.rb', '2012-10-01', '2012-11-01') + # @overload commits_between + # @overload commits_between + # @return [Array] An array of hashes representing commits + # @see https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository + # + # source://octokit//lib/octokit/client/commits.rb#122 + def commits_between(*args); end + + # Get commits on a specified date + # + # @example + # Octokit.commits_on('octokit/octokit.rb', '2012-10-01') + # @overload commits_on + # @overload commits_on + # @return [Array] An array of hashes representing commits + # @see https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository + # + # source://octokit//lib/octokit/client/commits.rb#95 + def commits_on(*args); end + + # Get commits after a specified date + # + # @example + # Octokit.commits_since('octokit/octokit.rb', '2012-10-01') + # @overload commits_since + # @overload commits_since + # @return [Array] An array of hashes representing commits + # @see https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository + # + # source://octokit//lib/octokit/client/commits.rb#47 + def commits_since(*args); end + + # Compare two commits + # + # When using auto_pagination, commits from all pages will be concatenated + # into the commits attribute of the first page's response. + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param start [String] The sha of the starting commit + # @param endd [String] The sha of the ending commit + # @return [Sawyer::Resource] A hash representing the comparison + # @see https://developer.github.com/v3/repos/commits/#compare-two-commits + # + # source://octokit//lib/octokit/client/commits.rb#192 + def compare(repo, start, endd, options = T.unsafe(nil)); end + + # Create a commit + # + # Optionally pass author and committer hashes in options + # if you'd like manual control over those parameters. If absent, details will be + # inferred from the authenticated user. See GitHub's documentation + # for details about how to format committer identities. + # + # @example Create a commit + # commit = Octokit.create_commit("octocat/Hello-World", "My commit message", "827efc6d56897b048c772eb4087f854f46256132", "7d1b31e74ee336d15cbd21741bc88a537ed063a0") + # commit.sha # => "7638417db6d59f3c431d3e1f261cc637155684cd" + # commit.tree.sha # => "827efc6d56897b048c772eb4087f854f46256132" + # commit.message # => "My commit message" + # commit.committer # => { "name" => "Wynn Netherland", "email" => "wynn@github.com", ... } + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param message [String] The commit message + # @param tree [String] The SHA of the tree object the new commit will point to + # @param parents [String, Array] One SHA (for a normal commit) or an array of SHAs (for a merge) of the new commit's parent commits. If ommitted or empty, a root commit will be created + # @return [Sawyer::Resource] A hash representing the new commit + # @see https://developer.github.com/v3/git/commits/#create-a-commit + # + # source://octokit//lib/octokit/client/commits.rb#176 + def create_commit(repo, message, tree, parents = T.unsafe(nil), options = T.unsafe(nil)); end + + # Get a detailed git commit + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param sha [String] The SHA of the commit to fetch + # @return [Sawyer::Resource] A hash representing the commit + # @see https://developer.github.com/v3/git/commits/#get-a-commit + # + # source://octokit//lib/octokit/client/commits.rb#153 + def git_commit(repo, sha, options = T.unsafe(nil)); end + + # List commits + # + # @overload commits + # @overload commits + # @return [Array] An array of hashes representing commits + # @see https://developer.github.com/v3/repos/commits/#list-commits-on-a-repository + # + # source://octokit//lib/octokit/client/commits.rb#23 + def list_commits(*args); end + + # Merge a branch or sha + # + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param base [String] The name of the base branch to merge into + # @param head [String] The branch or SHA1 to merge + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] A hash representing the comparison + # @see https://developer.github.com/v3/repos/merging/#perform-a-merge + # + # source://octokit//lib/octokit/client/commits.rb#206 + def merge(repo, base, head, options = T.unsafe(nil)); end + + protected + + # source://octokit//lib/octokit/client/commits.rb#216 + def iso8601(date); end + + # Parses the given string representation of a date, throwing a meaningful exception + # (containing the date that failed to parse) in case of failure. + # + # @param date [String] String representation of a date + # @return [DateTime] + # + # source://octokit//lib/octokit/client/commits.rb#229 + def parse_date(date); end +end + +# Methods for the Community Profile API +# +# @see https://developer.github.com/v3/repos/community/ +# +# source://octokit//lib/octokit/client/community_profile.rb#8 +module Octokit::Client::CommunityProfile + # Get community profile metrics for a repository + # + # @example Get community profile metrics for octokit/octokit.rb + # @client.community_profile('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Sawyer::Resource] Community profile metrics + # @see https://developer.github.com/v3/repos/community/#retrieve-community-profile-metrics + # + # source://octokit//lib/octokit/client/community_profile.rb#16 + def community_profile(repo, options = T.unsafe(nil)); end +end + +# Methods for the Repo Contents API +# +# @see https://developer.github.com/v3/repos/contents/ +# +# source://octokit//lib/octokit/client/contents.rb#8 +module Octokit::Client::Contents + # Add content to a repository + # + # @example Add content at lib/octokit.rb + # Octokit.create_contents("octokit/octokit.rb", + # "lib/octokit.rb", + # "Adding content", + # "File content", + # :branch => "my-new-feature") + # @overload create_contents + # @raise [ArgumentError] + # @return [Sawyer::Resource] The contents and commit info for the addition + # @see https://developer.github.com/v3/repos/contents/#create-a-file + # + # source://octokit//lib/octokit/client/contents.rb#59 + def add_content(*args); end + + # Add content to a repository + # + # @example Add content at lib/octokit.rb + # Octokit.create_contents("octokit/octokit.rb", + # "lib/octokit.rb", + # "Adding content", + # "File content", + # :branch => "my-new-feature") + # @overload create_contents + # @raise [ArgumentError] + # @return [Sawyer::Resource] The contents and commit info for the addition + # @see https://developer.github.com/v3/repos/contents/#create-a-file + # + # source://octokit//lib/octokit/client/contents.rb#59 + def add_contents(*args); end + + # This method will provide a URL to download a tarball or zipball archive for a repository. + # + # @example Get archive link for octokit/octokit.rb + # Octokit.archive_link("octokit/octokit.rb") + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository. + # @param options [Hash] a customizable set of options + # @return [String] Location of the download + # @see https://developer.github.com/v3/repos/contents/#get-archive-link + # + # source://octokit//lib/octokit/client/contents.rb#155 + def archive_link(repo, options = T.unsafe(nil)); end + + # Receive a listing of a repository folder or the contents of a file + # + # @example List the contents of lib/octokit.rb + # Octokit.contents("octokit/octokit.rb", :path => 'lib/octokit.rb') + # @example Lists the contents of lib /octokit.rb on a particular branch + # Octokit.contents("octokit/octokit.rb", :path => 'lib/octokit.rb', :query => {:ref => 'some-other-branch'}) + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] The contents of a file or list of the files in the folder + # @see https://developer.github.com/v3/repos/contents/#get-contents + # + # source://octokit//lib/octokit/client/contents.rb#34 + def content(repo, options = T.unsafe(nil)); end + + # Receive a listing of a repository folder or the contents of a file + # + # @example List the contents of lib/octokit.rb + # Octokit.contents("octokit/octokit.rb", :path => 'lib/octokit.rb') + # @example Lists the contents of lib /octokit.rb on a particular branch + # Octokit.contents("octokit/octokit.rb", :path => 'lib/octokit.rb', :query => {:ref => 'some-other-branch'}) + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] The contents of a file or list of the files in the folder + # @see https://developer.github.com/v3/repos/contents/#get-contents + # + # source://octokit//lib/octokit/client/contents.rb#34 + def contents(repo, options = T.unsafe(nil)); end + + # Add content to a repository + # + # @example Add content at lib/octokit.rb + # Octokit.create_contents("octokit/octokit.rb", + # "lib/octokit.rb", + # "Adding content", + # "File content", + # :branch => "my-new-feature") + # @overload create_contents + # @raise [ArgumentError] + # @return [Sawyer::Resource] The contents and commit info for the addition + # @see https://developer.github.com/v3/repos/contents/#create-a-file + # + # source://octokit//lib/octokit/client/contents.rb#59 + def create_content(*args); end + + # Add content to a repository + # + # @example Add content at lib/octokit.rb + # Octokit.create_contents("octokit/octokit.rb", + # "lib/octokit.rb", + # "Adding content", + # "File content", + # :branch => "my-new-feature") + # @overload create_contents + # @raise [ArgumentError] + # @return [Sawyer::Resource] The contents and commit info for the addition + # @see https://developer.github.com/v3/repos/contents/#create-a-file + # + # source://octokit//lib/octokit/client/contents.rb#59 + def create_contents(*args); end + + # Delete content in a repository + # + # @example Delete content at lib/octokit.rb + # Octokit.delete_contents("octokit/octokit.rb", + # "lib/octokit.rb", + # "Deleting content", + # "7eb95f97e1a0636015df3837478d3f15184a5f49", + # :branch => "my-new-feature") + # @option options + # @param path [String] A path for the content to delete + # @param sha [String] The _blob sha_ of the content to delete + # @param options [Hash] a customizable set of options + # @param message [String] A commit message for deleting the content + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Sawyer::Resource] The commit info for the delete + # @see https://developer.github.com/v3/repos/contents/#delete-a-file + # + # source://octokit//lib/octokit/client/contents.rb#136 + def delete_content(repo, path, message, sha, options = T.unsafe(nil)); end + + # Delete content in a repository + # + # @example Delete content at lib/octokit.rb + # Octokit.delete_contents("octokit/octokit.rb", + # "lib/octokit.rb", + # "Deleting content", + # "7eb95f97e1a0636015df3837478d3f15184a5f49", + # :branch => "my-new-feature") + # @option options + # @param path [String] A path for the content to delete + # @param sha [String] The _blob sha_ of the content to delete + # @param options [Hash] a customizable set of options + # @param message [String] A commit message for deleting the content + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Sawyer::Resource] The commit info for the delete + # @see https://developer.github.com/v3/repos/contents/#delete-a-file + # + # source://octokit//lib/octokit/client/contents.rb#136 + def delete_contents(repo, path, message, sha, options = T.unsafe(nil)); end + + # Receive the default Readme for a repository + # + # @example Get the readme file for a repo + # Octokit.readme("octokit/octokit.rb") + # @example Get the readme file for a particular branch of the repo + # Octokit.readme("octokit/octokit.rb", :query => {:ref => 'some-other-branch'}) + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] The detail of the readme + # @see https://developer.github.com/v3/repos/contents/#get-the-readme + # + # source://octokit//lib/octokit/client/contents.rb#19 + def readme(repo, options = T.unsafe(nil)); end + + # Delete content in a repository + # + # @example Delete content at lib/octokit.rb + # Octokit.delete_contents("octokit/octokit.rb", + # "lib/octokit.rb", + # "Deleting content", + # "7eb95f97e1a0636015df3837478d3f15184a5f49", + # :branch => "my-new-feature") + # @option options + # @param path [String] A path for the content to delete + # @param sha [String] The _blob sha_ of the content to delete + # @param options [Hash] a customizable set of options + # @param message [String] A commit message for deleting the content + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Sawyer::Resource] The commit info for the delete + # @see https://developer.github.com/v3/repos/contents/#delete-a-file + # + # source://octokit//lib/octokit/client/contents.rb#136 + def remove_content(repo, path, message, sha, options = T.unsafe(nil)); end + + # Delete content in a repository + # + # @example Delete content at lib/octokit.rb + # Octokit.delete_contents("octokit/octokit.rb", + # "lib/octokit.rb", + # "Deleting content", + # "7eb95f97e1a0636015df3837478d3f15184a5f49", + # :branch => "my-new-feature") + # @option options + # @param path [String] A path for the content to delete + # @param sha [String] The _blob sha_ of the content to delete + # @param options [Hash] a customizable set of options + # @param message [String] A commit message for deleting the content + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Sawyer::Resource] The commit info for the delete + # @see https://developer.github.com/v3/repos/contents/#delete-a-file + # + # source://octokit//lib/octokit/client/contents.rb#136 + def remove_contents(repo, path, message, sha, options = T.unsafe(nil)); end + + # Update content in a repository + # + # @example Update content at lib/octokit.rb + # Octokit.update_contents("octokit/octokit.rb", + # "lib/octokit.rb", + # "Updating content", + # "7eb95f97e1a0636015df3837478d3f15184a5f49", + # "File content", + # :branch => "my-new-feature") + # @overload update_contents + # @return [Sawyer::Resource] The contents and commit info for the update + # @see https://developer.github.com/v3/repos/contents/#update-a-file + # + # source://octokit//lib/octokit/client/contents.rb#109 + def update_content(*args); end + + # Update content in a repository + # + # @example Update content at lib/octokit.rb + # Octokit.update_contents("octokit/octokit.rb", + # "lib/octokit.rb", + # "Updating content", + # "7eb95f97e1a0636015df3837478d3f15184a5f49", + # "File content", + # :branch => "my-new-feature") + # @overload update_contents + # @return [Sawyer::Resource] The contents and commit info for the update + # @see https://developer.github.com/v3/repos/contents/#update-a-file + # + # source://octokit//lib/octokit/client/contents.rb#109 + def update_contents(*args); end +end + +# Methods for the dependabot Secrets API +# +# @see https://docs.github.com/en/rest/dependabot/ +# +# source://octokit//lib/octokit/client/dependabot_secrets.rb#8 +module Octokit::Client::DependabotSecrets + # Create or update secrets + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param name [String] Name of secret + # @param options [Hash] encrypted_value and key_id + # @see https://docs.github.com/en/rest/dependabot/repository-secrets?apiVersion=2022-11-28#create-or-update-a-repository-secret + # + # source://octokit//lib/octokit/client/dependabot_secrets.rb#75 + def create_or_update_dependabot_secret(repo, name, options); end + + # Create or update org secrets + # + # @param org [String] A GitHub organization + # @param name [String] Name of secret + # @param options [Hash] encrypted_value and key_id + # @see https://docs.github.com/en/rest/dependabot/organization-secrets?apiVersion=2022-11-28#create-or-update-an-organization-secret + # + # source://octokit//lib/octokit/client/dependabot_secrets.rb#85 + def create_or_update_org_dependabot_secret(org, name, options); end + + # Delete a secret + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param name [String] Name of secret + # @see https://docs.github.com/en/rest/dependabot/repository-secrets?apiVersion=2022-11-28#delete-a-repository-secret + # + # source://octokit//lib/octokit/client/dependabot_secrets.rb#94 + def delete_dependabot_secret(repo, name); end + + # Delete an org secret + # + # @param org [String] A GitHub organization + # @param name [String] Name of secret + # @see https://docs.github.com/en/rest/dependabot/organization-secrets?apiVersion=2022-11-28#delete-an-organization-secret + # + # source://octokit//lib/octokit/client/dependabot_secrets.rb#103 + def delete_org_dependabot_secret(org, name); end + + # Get public key for secrets encryption + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Hash] key_id and key + # @see https://docs.github.com/en/rest/dependabot/repository-secrets#get-a-repository-public-key + # + # source://octokit//lib/octokit/client/dependabot_secrets.rb#14 + def get_dependabot_public_key(repo); end + + # Get a secret + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param name [String] Name of secret + # @return [Hash] name, created_at, updated_at, and visibility + # @see https://docs.github.com/en/rest/dependabot/repository-secrets?apiVersion=2022-11-28#get-a-repository-secret + # + # source://octokit//lib/octokit/client/dependabot_secrets.rb#55 + def get_dependabot_secret(repo, name); end + + # Get public key for secrets encryption + # + # @param org [String] A GitHub organization + # @return [Hash] key_id and key + # @see https://docs.github.com/en/rest/dependabot/organization-secrets?apiVersion=2022-11-28#get-an-organization-public-key + # + # source://octokit//lib/octokit/client/dependabot_secrets.rb#23 + def get_org_dependabot_public_key(org); end + + # Get an org secret + # + # @param org [String] A GitHub organization + # @param name [String] Name of secret + # @return [Hash] name, created_at, updated_at, and visibility + # @see https://docs.github.com/en/rest/dependabot/organization-secrets?apiVersion=2022-11-28#get-an-organization-secret + # + # source://octokit//lib/octokit/client/dependabot_secrets.rb#65 + def get_org_dependabot_secret(org, name); end + + # List secrets + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at) + # @see https://docs.github.com/en/rest/dependabot/repository-secrets?apiVersion=2022-11-28#list-repository-secrets + # + # source://octokit//lib/octokit/client/dependabot_secrets.rb#32 + def list_dependabot_secrets(repo); end + + # List org secrets + # + # @param org [String] A GitHub organization + # @return [Hash] total_count and list of secrets (each item is hash with name, created_at and updated_at) + # @see https://docs.github.com/en/rest/dependabot/organization-secrets?apiVersion=2022-11-28#list-organization-secrets + # + # source://octokit//lib/octokit/client/dependabot_secrets.rb#43 + def list_org_dependabot_secrets(org); end +end + +# Methods for the Deployments API +# +# @see https://developer.github.com/v3/repos/commits/deployments/ +# +# source://octokit//lib/octokit/client/deployments.rb#8 +module Octokit::Client::Deployments + # Create a deployment for a ref + # + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param ref [String] The ref to deploy + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] A deployment + # @see https://developer.github.com/v3/repos/deployments/#create-a-deployment + # + # source://octokit//lib/octokit/client/deployments.rb#41 + def create_deployment(repo, ref, options = T.unsafe(nil)); end + + # Create a deployment status for a Deployment + # + # @option options + # @option options + # @param deployment_url [String] A URL for a deployment resource + # @param state [String] The state: pending, success, failure, error + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] A deployment status + # @see https://developer.github.com/v3/repos/deployments/#create-a-deployment-status + # + # source://octokit//lib/octokit/client/deployments.rb#75 + def create_deployment_status(deployment_url, state, options = T.unsafe(nil)); end + + # Delete a Deployment + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param deployment_id [Integer, String, Repository, Hash] A GitHub repository + # @return [No Content] + # @see https://developer.github.com/v3/repos/deployments/#delete-a-deployment + # + # source://octokit//lib/octokit/client/deployments.rb#52 + def delete_deployment(repo, deployment_id, options = T.unsafe(nil)); end + + # Fetch a single deployment for a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param deployment_id [Integer, String, Repository, Hash] A GitHub repository + # @return [Sawyer::Resource] A single deployment + # @see https://developer.github.com/v3/repos/deployments/#get-a-single-deployment + # + # source://octokit//lib/octokit/client/deployments.rb#15 + def deployment(repo, deployment_id, options = T.unsafe(nil)); end + + # List all statuses for a Deployment + # + # @param deployment_url [String] A URL for a deployment resource + # @return [Array] A list of deployment statuses + # @see https://developer.github.com/v3/repos/deployments/#list-deployment-statuses + # + # source://octokit//lib/octokit/client/deployments.rb#61 + def deployment_statuses(deployment_url, options = T.unsafe(nil)); end + + # List all deployments for a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] A list of deployments + # @see https://developer.github.com/v3/repos/deployments/#list-deployments + # + # source://octokit//lib/octokit/client/deployments.rb#24 + def deployments(repo, options = T.unsafe(nil)); end + + # List all statuses for a Deployment + # + # @param deployment_url [String] A URL for a deployment resource + # @return [Array] A list of deployment statuses + # @see https://developer.github.com/v3/repos/deployments/#list-deployment-statuses + # + # source://octokit//lib/octokit/client/deployments.rb#61 + def list_deployment_statuses(deployment_url, options = T.unsafe(nil)); end + + # List all deployments for a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] A list of deployments + # @see https://developer.github.com/v3/repos/deployments/#list-deployments + # + # source://octokit//lib/octokit/client/deployments.rb#24 + def list_deployments(repo, options = T.unsafe(nil)); end +end + +# Methods for the Repo Downloads API +# +# @see https://developer.github.com/v3/repos/downloads/ +# +# source://octokit//lib/octokit/client/downloads.rb#8 +module Octokit::Client::Downloads + # Delete a single download for a repository + # + # @deprecated As of December 11th, 2012: https://github.com/blog/1302-goodbye-uploads + # @example Get the "Robawt" download from Github/Hubot + # Octokit.delete_download("github/hubot", 1234) + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer] ID of the download + # @return [Boolean] Status + # @see https://developer.github.com/v3/repos/downloads/#delete-a-download + # + # source://octokit//lib/octokit/client/downloads.rb#44 + def delete_download(repo, id, options = T.unsafe(nil)); end + + # Get single download for a repository + # + # @deprecated As of December 11th, 2012: https://github.com/blog/1302-goodbye-uploads + # @example Get the "Robawt" download from Github/Hubot + # Octokit.download("github/hubot") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer] ID of the download + # @return [Sawyer::Resource] A single download from the repository + # @see https://developer.github.com/v3/repos/downloads/#get-a-single-download + # + # source://octokit//lib/octokit/client/downloads.rb#31 + def download(repo, id, options = T.unsafe(nil)); end + + # List available downloads for a repository + # + # @deprecated As of December 11th, 2012: https://github.com/blog/1302-goodbye-uploads + # @example List all downloads for Github/Hubot + # Octokit.downloads("github/hubot") + # @param repo [Integer, String, Repository, Hash] A Github Repository + # @return [Array] A list of available downloads + # @see https://developer.github.com/v3/repos/downloads/#list-downloads-for-a-repository + # + # source://octokit//lib/octokit/client/downloads.rb#17 + def downloads(repo, options = T.unsafe(nil)); end + + # List available downloads for a repository + # + # @deprecated As of December 11th, 2012: https://github.com/blog/1302-goodbye-uploads + # @example List all downloads for Github/Hubot + # Octokit.downloads("github/hubot") + # @param repo [Integer, String, Repository, Hash] A Github Repository + # @return [Array] A list of available downloads + # @see https://developer.github.com/v3/repos/downloads/#list-downloads-for-a-repository + # + # source://octokit//lib/octokit/client/downloads.rb#17 + def list_downloads(repo, options = T.unsafe(nil)); end +end + +# Methods for the Emojis API +# +# source://octokit//lib/octokit/client/emojis.rb#6 +module Octokit::Client::Emojis + # List all emojis used on GitHub + # + # @example List all emojis + # Octokit.emojis + # @return [Sawyer::Resource] A list of all emojis on GitHub + # @see https://developer.github.com/v3/emojis/#emojis + # + # source://octokit//lib/octokit/client/emojis.rb#13 + def emojis(options = T.unsafe(nil)); end +end + +# Methods for the Environments API +# +# @see https://docs.github.com/en/rest/deployments/environments +# +# source://octokit//lib/octokit/client/environments.rb#8 +module Octokit::Client::Environments + # Create or update an environment with protection rules, such as required reviewers + # + # @option options + # @option options + # @option options + # @param environment_name [String] The name of the environment + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] An environment + # @see https://docs.github.com/en/rest/deployments/environments#create-or-update-an-environment + # + # source://octokit//lib/octokit/client/environments.rb#43 + def create_or_update_environment(repo, environment_name, options = T.unsafe(nil)); end + + # Delete an Environment + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param environment_name [String] The name of the environment + # @return [No Content] + # @see https://docs.github.com/en/rest/deployments/environments#delete-an-environment + # + # source://octokit//lib/octokit/client/environments.rb#53 + def delete_environment(repo, environment_name, options = T.unsafe(nil)); end + + # Fetch a single environment for a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param environment_name [String] The name of the environment + # @return [Sawyer::Resource] A single environment + # @see https://docs.github.com/en/rest/deployments/environments#get-an-environment + # + # source://octokit//lib/octokit/client/environments.rb#15 + def environment(repo, environment_name, options = T.unsafe(nil)); end + + # Lists the environments for a repository + # + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Total count of environments and list of environments + # @see https://docs.github.com/en/rest/deployments/environments#list-environments + # + # source://octokit//lib/octokit/client/environments.rb#26 + def environments(repo, options = T.unsafe(nil)); end + + # Lists the environments for a repository + # + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Total count of environments and list of environments + # @see https://docs.github.com/en/rest/deployments/environments#list-environments + # + # source://octokit//lib/octokit/client/environments.rb#26 + def list_environments(repo, options = T.unsafe(nil)); end +end + +# Method for the Events API +# +# @see https://developer.github.com/v3/activity/events/ +# @see https://developer.github.com/v3/issues/events/ +# +# source://octokit//lib/octokit/client/events.rb#9 +module Octokit::Client::Events + # Get information on a single Issue Event + # + # @example Get Event information for ID 3094334 (a pull request was closed) + # Octokit.issue_event("octokit/octokit.rb", 3094334) + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Event number + # @return [Sawyer::Resource] A single Event for an Issue + # @see https://developer.github.com/v3/issues/events/#get-a-single-event + # + # source://octokit//lib/octokit/client/events.rb#146 + def issue_event(repo, number, options = T.unsafe(nil)); end + + # List events for an Issue + # + # @example List all issues events for issue #38 on octokit/octokit.rb + # Octokit.issue_events("octokit/octokit.rb", 38) + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Issue number + # @return [Array] Array of events for that issue + # @see https://developer.github.com/v3/issues/events/#list-events-for-an-issue + # + # source://octokit//lib/octokit/client/events.rb#133 + def issue_events(repo, number, options = T.unsafe(nil)); end + + # List all events for an organization + # + # Requires authenticated client. + # + # @example List events for the lostisland organization + # @client.organization_events("lostisland") + # @param org [String] Organization GitHub handle + # @return [Array] List of all events from a GitHub organization + # @see https://developer.github.com/v3/activity/events/#list-events-for-an-organization + # + # source://octokit//lib/octokit/client/events.rb#95 + def organization_events(org, options = T.unsafe(nil)); end + + # List an organization's public events + # + # @example List public events for GitHub + # Octokit.organization_public_events("GitHub") + # @param org [String, Integer] Organization GitHub login or id. + # @return [Array] List of public events from a GitHub organization + # @see https://developer.github.com/v3/activity/events/#list-public-events-for-an-organization + # + # source://octokit//lib/octokit/client/events.rb#106 + def organization_public_events(org, options = T.unsafe(nil)); end + + # List all public events for GitHub + # + # @example List all pubilc events + # Octokit.public_events + # @return [Array] A list of all public events from GitHub + # @see https://developer.github.com/v3/activity/events/#list-public-events + # + # source://octokit//lib/octokit/client/events.rb#16 + def public_events(options = T.unsafe(nil)); end + + # List events that a user has received + # + # @example List all user received events + # Octokit.received_events("sferik") + # @param user [Integer, String] GitHub user login or id + # @return [Array] A list of all user received events + # @see https://developer.github.com/v3/activity/events/#list-events-that-a-user-has-received + # + # source://octokit//lib/octokit/client/events.rb#49 + def received_events(user, options = T.unsafe(nil)); end + + # List public events a user has received + # + # @example List public user received events + # Octokit.received_public_events("sferik") + # @param user [Integer, String] GitHub user login or id + # @return [Array] A list of public user received events + # @see https://developer.github.com/v3/activity/events/#list-public-events-that-a-user-has-received + # + # source://octokit//lib/octokit/client/events.rb#60 + def received_public_events(user, options = T.unsafe(nil)); end + + # Get all Issue Events for a given Repository + # + # @example Get all Issue Events for Octokit + # Octokit.repository_issue_events("octokit/octokit.rb") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] Array of all Issue Events for this Repository + # @see https://developer.github.com/v3/issues/events/#list-events-for-a-repository + # @see https://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + # + # source://octokit//lib/octokit/client/events.rb#119 + def repo_issue_events(repo, options = T.unsafe(nil)); end + + # List events for a repository + # + # @example List events for a repository + # Octokit.repository_events("sferik/rails_admin") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] A list of events for a repository + # @see https://developer.github.com/v3/activity/events/#list-repository-events + # + # source://octokit//lib/octokit/client/events.rb#71 + def repository_events(repo, options = T.unsafe(nil)); end + + # Get all Issue Events for a given Repository + # + # @example Get all Issue Events for Octokit + # Octokit.repository_issue_events("octokit/octokit.rb") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] Array of all Issue Events for this Repository + # @see https://developer.github.com/v3/issues/events/#list-events-for-a-repository + # @see https://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository + # + # source://octokit//lib/octokit/client/events.rb#119 + def repository_issue_events(repo, options = T.unsafe(nil)); end + + # List public events for a repository's network + # + # @example List events for a repository's network + # Octokit.repository_network_events("sferik/rails_admin") + # @param repo [String, Repository, Hash] A GitHub repository + # @return [Array] A list of events for a repository's network + # @see https://developer.github.com/v3/activity/events/#list-public-events-for-a-network-of-repositories + # + # source://octokit//lib/octokit/client/events.rb#82 + def repository_network_events(repo, options = T.unsafe(nil)); end + + # List all user events + # + # @example List all user events + # Octokit.user_events("sferik") + # @param user [Integer, String] GitHub user login or id. + # @return [Array] A list of all user events + # @see https://developer.github.com/v3/activity/events/#list-events-performed-by-a-user + # + # source://octokit//lib/octokit/client/events.rb#27 + def user_events(user, options = T.unsafe(nil)); end + + # List public user events + # + # @example List public user events + # Octokit.user_events("sferik") + # @param user [Integer, String] GitHub user login or id + # @return [Array] A list of public user events + # @see https://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user + # + # source://octokit//lib/octokit/client/events.rb#38 + def user_public_events(user, options = T.unsafe(nil)); end +end + +# Methods for the Feeds API +# +# @see https://developer.github.com/v3/activity/feeds/ +# +# source://octokit//lib/octokit/client/feeds.rb#8 +module Octokit::Client::Feeds + # Get a Feed by name + # + # @param name [Symbol, String] Name of feed to retrieve. + # @return [Feed] Parsed feed in the format returned by the configured + # parser. + # + # source://octokit//lib/octokit/client/feeds.rb#25 + def feed(name, options = T.unsafe(nil)); end + + # List Feeds + # + # The feeds returned depend on authentication, see the GitHub API docs + # for more information. + # + # @return [Array] list of feeds + # @see https://developer.github.com/v3/activity/feeds/#list-feeds + # + # source://octokit//lib/octokit/client/feeds.rb#16 + def feeds; end +end + +# Methods for the Gists API +# +# @see https://developer.github.com/v3/gists/ +# +# source://octokit//lib/octokit/client/gists.rb#8 +module Octokit::Client::Gists + # Create a gist + # + # @option options + # @option options + # @option options + # @param options [Hash] Gist information. + # @return [Sawyer::Resource] Newly created gist info + # @see https://developer.github.com/v3/gists/#create-a-gist + # + # source://octokit//lib/octokit/client/gists.rb#71 + def create_gist(options = T.unsafe(nil)); end + + # Create gist comment + # + # Requires authenticated client. + # + # @example + # @client.create_gist_comment('3528645', 'This is very helpful.') + # @param gist_id [String] Id of the gist. + # @param comment [String] Comment contents. + # @return [Sawyer::Resource] Hash representing the new comment. + # @see https://developer.github.com/v3/gists/comments/#create-a-comment + # + # source://octokit//lib/octokit/client/gists.rb#198 + def create_gist_comment(gist_id, comment, options = T.unsafe(nil)); end + + # Delete a gist + # + # @param gist [String] Gist ID + # @return [Boolean] Indicating success of deletion + # @see https://developer.github.com/v3/gists/#delete-a-gist + # + # source://octokit//lib/octokit/client/gists.rb#161 + def delete_gist(gist, options = T.unsafe(nil)); end + + # Delete gist comment + # + # Requires authenticated client. + # + # @example + # @client.delete_gist_comment('208sdaz3', '586399') + # @param gist_id [String] Id of the gist. + # @param gist_comment_id [Integer] Id of the gist comment to delete. + # @return [Boolean] True if comment deleted, false otherwise. + # @see https://developer.github.com/v3/gists/comments/#delete-a-comment + # + # source://octokit//lib/octokit/client/gists.rb#229 + def delete_gist_comment(gist_id, gist_comment_id, options = T.unsafe(nil)); end + + # Edit a gist + # + # @example Update a gist + # @client.edit_gist('some_id', { + # :files => {"boo.md" => {"content" => "updated stuff"}} + # }) + # @option options + # @option options + # @param options [Hash] Gist information. + # @return [Sawyer::Resource] Newly created gist info + # @see https://developer.github.com/v3/gists/#edit-a-gist + # + # source://octokit//lib/octokit/client/gists.rb#93 + def edit_gist(gist, options = T.unsafe(nil)); end + + # Fork a gist + # + # @param gist [String] Gist ID + # @return [Sawyer::Resource] Data for the new gist + # @see https://developer.github.com/v3/gists/#fork-a-gist + # + # source://octokit//lib/octokit/client/gists.rb#141 + def fork_gist(gist, options = T.unsafe(nil)); end + + # Get a single gist + # + # @option options + # @param gist [String] ID of gist to fetch + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Gist information + # @see https://developer.github.com/v3/gists/#get-a-single-gist + # @see https://developer.github.com/v3/gists/#get-a-specific-revision-of-a-gist + # + # source://octokit//lib/octokit/client/gists.rb#52 + def gist(gist, options = T.unsafe(nil)); end + + # Get gist comment + # + # @example + # Octokit.gist_comment('208sdaz3', 1451398) + # @param gist_id [String] Id of the gist. + # @param gist_comment_id [Integer] Id of the gist comment. + # @return [Sawyer::Resource] Hash representing gist comment. + # @see https://developer.github.com/v3/gists/comments/#get-a-single-comment + # + # source://octokit//lib/octokit/client/gists.rb#184 + def gist_comment(gist_id, gist_comment_id, options = T.unsafe(nil)); end + + # List gist comments + # + # @example + # Octokit.gist_comments('3528ae645') + # @param gist_id [String] Gist Id. + # @return [Array] Array of hashes representing comments. + # @see https://developer.github.com/v3/gists/comments/#list-comments-on-a-gist + # + # source://octokit//lib/octokit/client/gists.rb#172 + def gist_comments(gist_id, options = T.unsafe(nil)); end + + # List gist commits + # + # @example List commits for a gist + # @client.gist_commits('some_id') + # @param gist [String] Gist ID + # @return [Array] List of commits to the gist + # @see https://developer.github.com/v3/gists/#list-gist-commits + # + # source://octokit//lib/octokit/client/gists.rb#104 + def gist_commits(gist, options = T.unsafe(nil)); end + + # List gist forks + # + # @example List gist forks + # @client.gist_forks('some-id') + # @param gist [String] Gist ID + # @return [Array] List of gist forks + # @see https://developer.github.com/v3/gists/#list-gist-forks + # + # source://octokit//lib/octokit/client/gists.rb#152 + def gist_forks(gist, options = T.unsafe(nil)); end + + # Check if a gist is starred + # + # @param gist [String] Gist ID + # @return [Boolean] Indicates if gist is starred + # @see https://developer.github.com/v3/gists/#check-if-a-gist-is-starred + # + # source://octokit//lib/octokit/client/gists.rb#132 + def gist_starred?(gist, options = T.unsafe(nil)); end + + # List gists for a user or all public gists + # + # @example Fetch all gists for defunkt + # Octokit.gists('defunkt') + # @example Fetch all public gists + # Octokit.gists + # @param user [String] An optional user to filter listing + # @return [Array] A list of gists + # @see https://developer.github.com/v3/gists/#list-gists + # + # source://octokit//lib/octokit/client/gists.rb#18 + def gists(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # List gists for a user or all public gists + # + # @example Fetch all gists for defunkt + # Octokit.gists('defunkt') + # @example Fetch all public gists + # Octokit.gists + # @param user [String] An optional user to filter listing + # @return [Array] A list of gists + # @see https://developer.github.com/v3/gists/#list-gists + # + # source://octokit//lib/octokit/client/gists.rb#18 + def list_gists(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # List public gists + # + # @example Fetch all public gists + # Octokit.public_gists + # @return [Array] A list of gists + # @see https://developer.github.com/v3/gists/#list-gists + # + # source://octokit//lib/octokit/client/gists.rb#33 + def public_gists(options = T.unsafe(nil)); end + + # Star a gist + # + # @param gist [String] Gist ID + # @return [Boolean] Indicates if gist is starred successfully + # @see https://developer.github.com/v3/gists/#star-a-gist + # + # source://octokit//lib/octokit/client/gists.rb#114 + def star_gist(gist, options = T.unsafe(nil)); end + + # List the authenticated user’s starred gists + # + # @return [Array] A list of gists + # @see https://developer.github.com/v3/gists/#list-gists + # + # source://octokit//lib/octokit/client/gists.rb#41 + def starred_gists(options = T.unsafe(nil)); end + + # Unstar a gist + # + # @param gist [String] Gist ID + # @return [Boolean] Indicates if gist is unstarred successfully + # @see https://developer.github.com/v3/gists/#unstar-a-gist + # + # source://octokit//lib/octokit/client/gists.rb#123 + def unstar_gist(gist, options = T.unsafe(nil)); end + + # Update gist comment + # + # Requires authenticated client + # + # @example + # @client.update_gist_comment('208sdaz3', '3528645', ':heart:') + # @param gist_id [String] Id of the gist. + # @param gist_comment_id [Integer] Id of the gist comment to update. + # @param comment [String] Updated comment contents. + # @return [Sawyer::Resource] Hash representing the updated comment. + # @see https://developer.github.com/v3/gists/comments/#edit-a-comment + # + # source://octokit//lib/octokit/client/gists.rb#214 + def update_gist_comment(gist_id, gist_comment_id, comment, options = T.unsafe(nil)); end +end + +# Methods for the Gitignore API +# +# @see https://developer.github.com/v3/gitignore/ +# +# source://octokit//lib/octokit/client/gitignore.rb#8 +module Octokit::Client::Gitignore + # Get a gitignore template. + # + # Use the raw {http://developer.github.com/v3/media/ media type} to get + # the raw contents. + # + # @example Get the Ruby gitignore template + # @client.gitignore_template('Ruby') + # @param template_name [String] Name of the template. Template names are + # case sensitive, make sure to use a valid name from the + # .gitignore_templates list. + # @return [Sawyer::Resource] Gitignore template + # @see https://developer.github.com/v3/gitignore/#get-a-single-template + # + # source://octokit//lib/octokit/client/gitignore.rb#38 + def gitignore_template(template_name, options = T.unsafe(nil)); end + + # Listing available gitignore templates. + # + # These templates can be passed option when creating a repository. + # + # @example Git all the gitignore templates + # @client.gitignore_templates + # @return [Array] List of templates. + # @see https://developer.github.com/v3/gitignore/#listing-available-templates + # + # source://octokit//lib/octokit/client/gitignore.rb#19 + def gitignore_templates(options = T.unsafe(nil)); end +end + +# Methods for the Hooks API +# +# source://octokit//lib/octokit/client/hooks.rb#6 +module Octokit::Client::Hooks + # Create a hook + # + # Requires authenticated client. + # + # @example + # @client.create_hook( + # 'octokit/octokit.rb', + # 'web', + # { + # :url => 'http://something.com/webhook', + # :content_type => 'json' + # }, + # { + # :events => ['push', 'pull_request'], + # :active => true + # } + # ) + # @option options + # @option options + # @param options [Hash] a customizable set of options + # @param config [Hash] A Hash containing key/value pairs to provide + # settings for this hook. These settings vary between the services and + # are defined in the {https://github.com/github/github-services github-services} repo. + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param name [String] The name of the service that is being called. See + # {https://api.github.com/hooks Hooks} for the possible names. + # @return [Sawyer::Resource] Hook info for the new hook + # @see https://api.github.com/hooks + # @see https://github.com/github/github-services + # @see https://developer.github.com/v3/repos/hooks/#create-a-hook + # + # source://octokit//lib/octokit/client/hooks.rb#65 + def create_hook(repo, name, config, options = T.unsafe(nil)); end + + # Create an org hook + # + # Requires client authenticated as admin for the org. + # + # @example + # @client.create_org_hook( + # 'octokit', + # { + # :url => 'http://something.com/webhook', + # :content_type => 'json' + # }, + # { + # :events => ['push', 'pull_request'], + # :active => true + # } + # ) + # @option options + # @option options + # @param config [Hash] A Hash containing key/value pairs to provide + # settings for this hook. + # @param org [String, Integer] Organization GitHub login or id. + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Hook info for the new hook + # @see https://api.github.com/hooks + # @see https://developer.github.com/v3/orgs/hooks/#create-a-hook + # + # source://octokit//lib/octokit/client/hooks.rb#209 + def create_org_hook(org, config, options = T.unsafe(nil)); end + + # Edit a hook + # + # Requires authenticated client. + # + # @example + # @client.edit_hook( + # 'octokit/octokit.rb', + # 100000, + # 'web', + # { + # :url => 'http://something.com/webhook', + # :content_type => 'json' + # }, + # { + # :add_events => ['status'], + # :remove_events => ['pull_request'], + # :active => true + # } + # ) + # @option options + # @option options + # @option options + # @option options + # @param name [String] The name of the service that is being called. See + # {https://api.github.com/hooks Hooks} for the possible names. + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param id [Integer] Id of the hook being updated. + # @param config [Hash] A Hash containing key/value pairs to provide + # settings for this hook. These settings vary between the services and + # are defined in the {https://github.com/github/github-services github-services} repo. + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Hook info for the updated hook + # @see https://api.github.com/hooks + # @see https://github.com/github/github-services + # @see https://developer.github.com/v3/repos/hooks/#edit-a-hook + # + # source://octokit//lib/octokit/client/hooks.rb#108 + def edit_hook(repo, id, name, config, options = T.unsafe(nil)); end + + # Update an org hook + # + # Requires client authenticated as admin for the org. + # + # @example + # @client.edit_org_hook( + # 'octokit', + # 123, + # { + # :url => 'http://something.com/webhook', + # :content_type => 'json' + # }, + # { + # :events => ['push', 'pull_request'], + # :active => true + # } + # ) + # @option options + # @option options + # @param options [Hash] a customizable set of options + # @param config [Hash] A Hash containing key/value pairs to provide + # settings for this hook. + # @param org [String, Integer] Organization GitHub login or id. + # @param id [Integer] Id of the hook to update. + # @return [Sawyer::Resource] Hook info for the new hook + # @see https://api.github.com/hooks + # @see https://developer.github.com/v3/orgs/hooks/#edit-a-hook + # + # source://octokit//lib/octokit/client/hooks.rb#242 + def edit_org_hook(org, id, config, options = T.unsafe(nil)); end + + # Get single hook + # + # Requires authenticated client. + # + # @example + # @client.hook('octokit/octokit.rb', 100000) + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param id [Integer] Id of the hook to get. + # @return [Sawyer::Resource] Hash representing hook. + # @see https://developer.github.com/v3/repos/hooks/#get-single-hook + # + # source://octokit//lib/octokit/client/hooks.rb#30 + def hook(repo, id, options = T.unsafe(nil)); end + + # List repo hooks + # + # Requires authenticated client. + # + # @example + # @client.hooks('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of hashes representing hooks. + # @see https://developer.github.com/v3/repos/hooks/#list-hooks + # + # source://octokit//lib/octokit/client/hooks.rb#16 + def hooks(repo, options = T.unsafe(nil)); end + + # List org hooks + # + # Requires client authenticated as admin for the org. + # + # @example + # @client.org_hooks('octokit') + # @param org [String, Integer] Organization GitHub login or id. + # @return [Array] Array of hashes representing hooks. + # @see https://developer.github.com/v3/orgs/hooks/#list-hooks + # + # source://octokit//lib/octokit/client/hooks.rb#164 + def list_org_hooks(org, options = T.unsafe(nil)); end + + # Get an org hook + # + # Requires client authenticated as admin for the org. + # + # @example + # @client.org_hook('octokit', 123) + # @param org [String, Integer] Organization GitHub login or id. + # @param id [Integer] Id of the hook to get. + # @return [Sawyer::Resource] Hash representing hook. + # @see https://developer.github.com/v3/orgs/hooks/#get-single-hook + # + # source://octokit//lib/octokit/client/hooks.rb#179 + def org_hook(org, id, options = T.unsafe(nil)); end + + # List org hooks + # + # Requires client authenticated as admin for the org. + # + # @example + # @client.org_hooks('octokit') + # @param org [String, Integer] Organization GitHub login or id. + # @return [Array] Array of hashes representing hooks. + # @see https://developer.github.com/v3/orgs/hooks/#list-hooks + # + # source://octokit//lib/octokit/client/hooks.rb#164 + def org_hooks(org, options = T.unsafe(nil)); end + + # Parse payload string + # + # @param payload_string [String] The payload + # @return [Sawyer::Resource] The payload object + # @see https://developer.github.com/v3/activity/events/types/ + # + # source://octokit//lib/octokit/client/hooks.rb#281 + def parse_payload(payload_string); end + + # Ping hook + # + # Requires authenticated client. + # + # @example + # @client.ping_hook('octokit/octokit.rb', 1000000) + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param id [Integer] Id of the hook to send a ping. + # @return [Boolean] Ping requested? + # @see https://developer.github.com/v3/repos/hooks/#ping-a-hook + # + # source://octokit//lib/octokit/client/hooks.rb#151 + def ping_hook(repo, id, options = T.unsafe(nil)); end + + # Ping org hook + # + # Requires client authenticated as admin for the org. + # + # @example + # @client.ping_org_hook('octokit', 1000000) + # @param org [String, Integer] Organization GitHub login or id. + # @param id [Integer] Id of the hook to update. + # @return [Boolean] Success + # @see https://developer.github.com/v3/orgs/hooks/#ping-a-hook + # + # source://octokit//lib/octokit/client/hooks.rb#258 + def ping_org_hook(org, id, options = T.unsafe(nil)); end + + # Delete hook + # + # Requires authenticated client. + # + # @example + # @client.remove_hook('octokit/octokit.rb', 1000000) + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param id [Integer] Id of the hook to remove. + # @return [Boolean] True if hook removed, false otherwise. + # @see https://developer.github.com/v3/repos/hooks/#delete-a-hook + # + # source://octokit//lib/octokit/client/hooks.rb#123 + def remove_hook(repo, id, options = T.unsafe(nil)); end + + # Remove org hook + # + # Requires client authenticated as admin for the org. + # + # @example + # @client.remove_org_hook('octokit', 1000000) + # @param org [String, Integer] Organization GitHub login or id. + # @param id [Integer] Id of the hook to update. + # @return [Boolean] True if hook removed, false otherwise. + # @see https://developer.github.com/v3/orgs/hooks/#delete-a-hook + # + # source://octokit//lib/octokit/client/hooks.rb#272 + def remove_org_hook(org, id, options = T.unsafe(nil)); end + + # Test hook + # + # Requires authenticated client. + # + # @example + # @client.test_hook('octokit/octokit.rb', 1000000) + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param id [Integer] Id of the hook to test. + # @return [Boolean] Success + # @see https://developer.github.com/v3/repos/hooks/#test-a-push-hook + # + # source://octokit//lib/octokit/client/hooks.rb#137 + def test_hook(repo, id, options = T.unsafe(nil)); end + + # Update an org hook + # + # Requires client authenticated as admin for the org. + # + # @example + # @client.edit_org_hook( + # 'octokit', + # 123, + # { + # :url => 'http://something.com/webhook', + # :content_type => 'json' + # }, + # { + # :events => ['push', 'pull_request'], + # :active => true + # } + # ) + # @option options + # @option options + # @param options [Hash] a customizable set of options + # @param config [Hash] A Hash containing key/value pairs to provide + # settings for this hook. + # @param org [String, Integer] Organization GitHub login or id. + # @param id [Integer] Id of the hook to update. + # @return [Sawyer::Resource] Hook info for the new hook + # @see https://api.github.com/hooks + # @see https://developer.github.com/v3/orgs/hooks/#edit-a-hook + # + # source://octokit//lib/octokit/client/hooks.rb#242 + def update_org_hook(org, id, config, options = T.unsafe(nil)); end +end + +# Methods for the Issues API +# +# @see https://developer.github.com/v3/issues/ +# +# source://octokit//lib/octokit/client/issues.rb#8 +module Octokit::Client::Issues + # Add assignees to an issue + # + # @example Add assignees "pengwynn" and "joeyw" to Issue #23 on octokit/octokit.rb + # Octokit.add_assignees("octokit/octokit.rb", 23, ["pengwynn", "joeyw"]) + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Issue number + # @param assignees [Array] Assignees to be added + # @return [Sawyer::Resource] Issue + # @see https://developer.github.com/v3/issues/assignees/#add-assignees-to-an-issue + # + # source://octokit//lib/octokit/client/issues.rb#344 + def add_assignees(repo, number, assignees, options = T.unsafe(nil)); end + + # Add a comment to an issue + # + # @example Add the comment "Almost to v1" to Issue #23 on octokit/octokit.rb + # Octokit.add_comment("octokit/octokit.rb", 23, "Almost to v1") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Issue number + # @param comment [String] Comment to be added + # @return [Sawyer::Resource] Comment + # @see https://developer.github.com/v3/issues/comments/#create-a-comment + # + # source://octokit//lib/octokit/client/issues.rb#283 + def add_comment(repo, number, comment, options = T.unsafe(nil)); end + + # Close an issue + # + # @example Close Issue #25 from octokit/octokit.rb + # Octokit.close_issue("octokit/octokit.rb", "25") + # @option options + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Number ID of the issue + # @param options [Hash] A customizable set of options. + # @return [Sawyer::Resource] The updated Issue + # @see https://developer.github.com/v3/issues/#edit-an-issue + # + # source://octokit//lib/octokit/client/issues.rb#131 + def close_issue(repo, number, options = T.unsafe(nil)); end + + # Create an issue for a repository + # + # @example Create a new Issues for a repository + # Octokit.create_issue("sferik/rails_admin", 'Updated Docs', 'Added some extra links') + # @option options + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param title [String] A descriptive title + # @param body [String] An optional concise description + # @param options [Hash] A customizable set of options. + # @return [Sawyer::Resource] Your newly created issue + # @see https://developer.github.com/v3/issues/#create-an-issue + # + # source://octokit//lib/octokit/client/issues.rb#91 + def create_issue(repo, title, body = T.unsafe(nil), options = T.unsafe(nil)); end + + # Delete a single comment + # + # @example Delete the comment #1194549 on an issue on octokit/octokit.rb + # Octokit.delete_comment("octokit/octokit.rb", 1194549) + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Comment number + # @return [Boolean] Success + # @see https://developer.github.com/v3/issues/comments/#delete-a-comment + # + # source://octokit//lib/octokit/client/issues.rb#308 + def delete_comment(repo, number, options = T.unsafe(nil)); end + + # Get a single issue from a repository + # + # @example Get issue #25 from octokit/octokit.rb + # Octokit.issue("octokit/octokit.rb", "25") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Number ID of the issue + # @return [Sawyer::Resource] The issue you requested, if it exists + # @see https://developer.github.com/v3/issues/#get-a-single-issue + # + # source://octokit//lib/octokit/client/issues.rb#114 + def issue(repo, number, options = T.unsafe(nil)); end + + # Get a single comment attached to an issue + # + # @example Get comment #1194549 from an issue on octokit/octokit.rb + # Octokit.issue_comment("octokit/octokit.rb", 1194549) + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Number ID of the comment + # @return [Sawyer::Resource] The specific comment in question + # @see https://developer.github.com/v3/issues/comments/#get-a-single-comment + # + # source://octokit//lib/octokit/client/issues.rb#270 + def issue_comment(repo, number, options = T.unsafe(nil)); end + + # Get all comments attached to an issue + # + # @example Get comments for issue #25 from octokit/octokit.rb + # Octokit.issue_comments("octokit/octokit.rb", "25") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Number ID of the issue + # @return [Array] Array of comments that belong to an issue + # @see https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue + # + # source://octokit//lib/octokit/client/issues.rb#258 + def issue_comments(repo, number, options = T.unsafe(nil)); end + + # Get the timeline for an issue + # + # @example Get timeline for issue #1435 on octokit/octokit.rb + # Octokit.issue_timeline("octokit/octokit.rb", 1435) + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Number ID of the comment + # @return [Sawyer::Resource] The timeline for this issue + # @see https://developer.github.com/v3/issues/timeline/ + # + # source://octokit//lib/octokit/client/issues.rb#320 + def issue_timeline(repo, number, options = T.unsafe(nil)); end + + # List issues for the authenticated user or repository + # + # @example List issues for the authenticated user across repositories + # @client = Octokit::Client.new(:login => 'foo', :password => 'bar') + # @client.list_issues + # @example List issues for a repository + # Octokit.list_issues("sferik/rails_admin") + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param repository [Integer, String, Repository, Hash] A GitHub repository. + # @param options [Sawyer::Resource] A customizable set of options. + # @return [Array] A list of issues for a repository. + # @see https://developer.github.com/v3/issues/#list-issues-for-a-repository + # @see https://developer.github.com/v3/issues/#list-issues + # + # source://octokit//lib/octokit/client/issues.rb#30 + def issues(repository = T.unsafe(nil), options = T.unsafe(nil)); end + + # Get all comments attached to issues for the repository + # + # By default, Issue Comments are ordered by ascending ID. + # + # @example Get issues comments, sort by updated descending since a time + # @client.issues_comments("octokit/octokit.rb", { + # :sort => 'desc', + # :direction => 'asc', + # :since => '2010-05-04T23:45:02Z' + # }) + # @example Get the comments for issues in the octokit repository + # @client.issues_comments("octokit/octokit.rb") + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] Optional parameters + # @return [Array] List of issues comments. + # @see https://developer.github.com/v3/issues/comments/#list-comments-in-a-repository + # + # source://octokit//lib/octokit/client/issues.rb#246 + def issues_comments(repo, options = T.unsafe(nil)); end + + # Lists the available assignees for issues in a repository. + # + # @example Get available assignees on repository octokit/octokit.rb + # Octokit.list_assignees("octokit/octokit.rb") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] List of GitHub users. + # @see https://developer.github.com/v3/issues/assignees/#list-assignees + # + # source://octokit//lib/octokit/client/issues.rb#331 + def list_assignees(repo, options = T.unsafe(nil)); end + + # List issues for the authenticated user or repository + # + # @example List issues for the authenticated user across repositories + # @client = Octokit::Client.new(:login => 'foo', :password => 'bar') + # @client.list_issues + # @example List issues for a repository + # Octokit.list_issues("sferik/rails_admin") + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param repository [Integer, String, Repository, Hash] A GitHub repository. + # @param options [Sawyer::Resource] A customizable set of options. + # @return [Array] A list of issues for a repository. + # @see https://developer.github.com/v3/issues/#list-issues-for-a-repository + # @see https://developer.github.com/v3/issues/#list-issues + # + # source://octokit//lib/octokit/client/issues.rb#30 + def list_issues(repository = T.unsafe(nil), options = T.unsafe(nil)); end + + # Lock an issue's conversation, limiting it to collaborators + # + # @example Lock Issue #25 from octokit/octokit.rb + # Octokit.lock_issue("octokit/octokit.rb", "25") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Number ID of the issue + # @return [Boolean] Success + # @see https://developer.github.com/v3/issues/#lock-an-issue + # + # source://octokit//lib/octokit/client/issues.rb#160 + def lock_issue(repo, number, options = T.unsafe(nil)); end + + # Create an issue for a repository + # + # @example Create a new Issues for a repository + # Octokit.create_issue("sferik/rails_admin", 'Updated Docs', 'Added some extra links') + # @option options + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param title [String] A descriptive title + # @param body [String] An optional concise description + # @param options [Hash] A customizable set of options. + # @return [Sawyer::Resource] Your newly created issue + # @see https://developer.github.com/v3/issues/#create-an-issue + # + # source://octokit//lib/octokit/client/issues.rb#91 + def open_issue(repo, title, body = T.unsafe(nil), options = T.unsafe(nil)); end + + # List all issues for a given organization for the authenticated user + # + # @example List all issues for a given organization for the authenticated user + # @client = Octokit::Client.new(:login => 'foo', :password => 'bar') + # @client.org_issues("octokit") + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param org [String, Integer] Organization GitHub login or id. + # @param options [Sawyer::Resource] A customizable set of options. + # @return [Array] A list of issues. + # @see https://developer.github.com/v3/issues/#list-issues + # + # source://octokit//lib/octokit/client/issues.rb#73 + def org_issues(org, options = T.unsafe(nil)); end + + # Remove assignees from an issue + # + # @example Remove assignees "pengwynn" and "joeyw" from Issue #23 on octokit/octokit.rb + # Octokit.remove_assignees("octokit/octokit.rb", 23, ["pengwynn", "joeyw"]) + # @example Remove assignees "pengwynn" from Issue #23 on octokit/octokit.rb + # Octokit.remove_assignees("octokit/octokit.rb", 23, ["pengwynn"], + # :accept => "application/vnd.github.v3+json") + # @param number [Integer] Issue number + # @param options [Hash] Header params for request + # @param assignees [Array] Assignees to be removed + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Sawyer::Resource] Issue + # @see https://developer.github.com/v3/issues/assignees/#remove-assignees-from-an-issue + # + # source://octokit//lib/octokit/client/issues.rb#362 + def remove_assignees(repo, number, assignees, options = T.unsafe(nil)); end + + # Reopen an issue + # + # @example Reopen Issue #25 from octokit/octokit.rb + # Octokit.reopen_issue("octokit/octokit.rb", "25") + # @option options + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Number ID of the issue + # @param options [Hash] A customizable set of options. + # @return [Sawyer::Resource] The updated Issue + # @see https://developer.github.com/v3/issues/#edit-an-issue + # + # source://octokit//lib/octokit/client/issues.rb#148 + def reopen_issue(repo, number, options = T.unsafe(nil)); end + + # Unlock an issue's conversation, opening it to all viewers + # + # @example Unlock Issue #25 from octokit/octokit.rb + # Octokit.close_issue("octokit/octokit.rb", "25") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Number ID of the issue + # @return [Boolean] Success + # @see https://developer.github.com/v3/issues/#unlock-an-issue + # + # source://octokit//lib/octokit/client/issues.rb#172 + def unlock_issue(repo, number, options = T.unsafe(nil)); end + + # Update a single comment on an issue + # + # @example Update the comment #1194549 with body "I've started this on my 25-issue-comments-v3 fork" on an issue on octokit/octokit.rb + # Octokit.update_comment("octokit/octokit.rb", 1194549, "Almost to v1, added this on my fork") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Comment number + # @param comment [String] Body of the comment which will replace the existing body. + # @return [Sawyer::Resource] Comment + # @see https://developer.github.com/v3/issues/comments/#edit-a-comment + # + # source://octokit//lib/octokit/client/issues.rb#296 + def update_comment(repo, number, comment, options = T.unsafe(nil)); end + + # Update an issue + # + # @example Change only the assignee of Issue #25 + # Octokit.update_issue("octokit/octokit.rb", "25", :assignee => "pengwynn") + # @example Change the title of Issue #25 + # Octokit.update_issue("octokit/octokit.rb", "25", "A new title", "the same body") + # @option options + # @overload update_issue + # @overload update_issue + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] The updated Issue + # @see https://developer.github.com/v3/issues/#edit-an-issue + # + # source://octokit//lib/octokit/client/issues.rb#209 + def update_issue(repo, number, *args); end + + # List all issues across owned and member repositories for the authenticated user + # + # @example List issues for the authenticated user across owned and member repositories + # @client = Octokit::Client.new(:login => 'foo', :password => 'bar') + # @client.user_issues + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param options [Sawyer::Resource] A customizable set of options. + # @return [Array] A list of issues for a repository. + # @see https://developer.github.com/v3/issues/#list-issues + # + # source://octokit//lib/octokit/client/issues.rb#52 + def user_issues(options = T.unsafe(nil)); end +end + +# Methods for the Issue Labels API +# +# @see https://developer.github.com/v3/issues/labels/ +# +# source://octokit//lib/octokit/client/labels.rb#10 +module Octokit::Client::Labels + # Add a label to a repository + # + # @example Add a new label "Version 1.0" with color "#cccccc" + # Octokit.add_label("octokit/octokit.rb", "Version 1.0", "cccccc") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param label [String] A new label + # @param color [String] A color, in hex, without the leading # + # @return [Sawyer::Resource] The new label + # @see https://developer.github.com/v3/issues/labels/#create-a-label + # + # source://octokit//lib/octokit/client/labels.rb#43 + def add_label(repo, label, color = T.unsafe(nil), options = T.unsafe(nil)); end + + # Add label(s) to an Issue + # + # @example Add two labels for octokit/octokit.rb + # Octokit.add_labels_to_an_issue("octokit/octokit.rb", 10, ['V3 Transition', 'Improvement']) + # @param repo [Integer, String, Repository, Hash] A Github repository + # @param number [Integer] Number ID of the issue + # @param labels [Array] An array of labels to apply to this Issue + # @return [Array] A list of the labels currently on the issue + # @see https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue + # + # source://octokit//lib/octokit/client/labels.rb#126 + def add_labels_to_an_issue(repo, number, labels); end + + # Delete a label from a repository. + # + # This deletes the label from the repository, and removes it from all issues. + # + # @example Delete the label "Version 1.0" from the repository. + # Octokit.delete_label!("octokit/octokit.rb", "Version 1.0") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param label [String] String name of the label + # @return [Boolean] Success + # @see https://developer.github.com/v3/issues/labels/#delete-a-label + # + # source://octokit//lib/octokit/client/labels.rb#72 + def delete_label!(repo, label, options = T.unsafe(nil)); end + + # Get single label for a repository + # + # @example Get the "V3 Addition" label from octokit/octokit.rb + # Octokit.label("octokit/octokit.rb", "V3 Addition") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param name [String] Name of the label + # @return [Sawyer::Resource] A single label from the repository + # @see https://developer.github.com/v3/issues/labels/#get-a-single-label + # + # source://octokit//lib/octokit/client/labels.rb#30 + def label(repo, name, options = T.unsafe(nil)); end + + # List available labels for a repository + # + # @example List labels for octokit/octokit.rb + # Octokit.labels("octokit/octokit.rb") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] A list of the labels across the repository + # @see https://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository + # + # source://octokit//lib/octokit/client/labels.rb#18 + def labels(repo, options = T.unsafe(nil)); end + + # List labels for a given issue + # + # @example List labels for octokit/octokit.rb, issue # 1 + # Octokit.labels_for_issue("octokit/octokit.rb", 1) + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Number ID of the issue + # @return [Array] A list of the labels currently on the issue + # @see https://developer.github.com/v3/issues/labels/#list-labels-on-an-issue + # + # source://octokit//lib/octokit/client/labels.rb#113 + def labels_for_issue(repo, number, options = T.unsafe(nil)); end + + # Get labels for every issue in a milestone + # + # @example List all labels for milestone #2 on octokit/octokit.rb + # Octokit.labels_for_milestone("octokit/octokit.rb", 2) + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Number ID of the milestone + # @return [Array] A list of the labels across the milestone + # @see http://developer.github.com/v3/issues/labels/#get-labels-for-every-issue-in-a-milestone + # + # source://octokit//lib/octokit/client/labels.rb#151 + def labels_for_milestone(repo, number, options = T.unsafe(nil)); end + + # Remove all label from an Issue + # + # This removes the label from the Issue + # + # @example Remove all labels from Issue #23 + # Octokit.remove_all_labels("octokit/octokit.rb", 23) + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Number ID of the issue + # @return [Boolean] Success of operation + # @see https://developer.github.com/v3/issues/labels/#remove-all-labels-from-an-issue + # + # source://octokit//lib/octokit/client/labels.rb#101 + def remove_all_labels(repo, number, options = T.unsafe(nil)); end + + # Remove a label from an Issue + # + # This removes the label from the Issue + # + # @example Remove the label "Version 1.0" from the repository. + # Octokit.remove_label("octokit/octokit.rb", 23, "Version 1.0") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param number [Integer] Number ID of the issue + # @param label [String] String name of the label + # @return [Array] A list of the labels currently on the issue + # @see https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue + # + # source://octokit//lib/octokit/client/labels.rb#87 + def remove_label(repo, number, label, options = T.unsafe(nil)); end + + # Replace all labels on an Issue + # + # @example Replace labels for octokit/octokit.rb Issue #10 + # Octokit.replace_all_labels("octokit/octokit.rb", 10, ['V3 Transition', 'Improvement']) + # @param repo [Integer, String, Repository, Hash] A Github repository + # @param number [Integer] Number ID of the issue + # @param labels [Array] An array of labels to use as replacement + # @return [Array] A list of the labels currently on the issue + # @see https://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue + # + # source://octokit//lib/octokit/client/labels.rb#139 + def replace_all_labels(repo, number, labels, _options = T.unsafe(nil)); end + + # Update a label + # + # @example Update the label "Version 1.0" with new color "#cceeaa" + # Octokit.update_label("octokit/octokit.rb", "Version 1.0", {:color => "cceeaa"}) + # @option options + # @option options + # @param label [String] The name of the label which will be updated + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] A customizable set of options. + # @return [Sawyer::Resource] The updated label + # @see https://developer.github.com/v3/issues/labels/#update-a-label + # + # source://octokit//lib/octokit/client/labels.rb#58 + def update_label(repo, label, options = T.unsafe(nil)); end +end + +# Methods for the Legacy Search API +# +# @see https://developer.github.com/v3/search/ +# +# source://octokit//lib/octokit/client/legacy_search.rb#8 +module Octokit::Client::LegacySearch + # Legacy search issues within a repository + # + # @example Search for 'test' in the open issues for sferik/rails_admin + # Octokit.search_issues("sferik/rails_admin", 'test', 'open') + # @param repo [String, Repository, Hash] A GitHub repository + # @param search_term [String] The term to search for + # @param state [String] :state (open) open or closed. + # @return [Array] A list of issues matching the search term and state + # + # source://octokit//lib/octokit/client/legacy_search.rb#26 + def legacy_search_issues(repo, search_term, state = T.unsafe(nil), options = T.unsafe(nil)); end + + # Legacy repository search + # + # @param q [String] Search keyword + # @return [Array] List of repositories found + # @see https://developer.github.com/v3/search/#search-repositories + # + # source://octokit//lib/octokit/client/legacy_search.rb#14 + def legacy_search_repositories(q, options = T.unsafe(nil)); end + + # Search for user. + # + # @example + # Octokit.search_users('pengwynn') + # @param search [String] User to search for. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/search/#search-users + # + # source://octokit//lib/octokit/client/legacy_search.rb#37 + def legacy_search_users(search, options = T.unsafe(nil)); end +end + +# source://octokit//lib/octokit/client/licenses.rb#7 +module Octokit::Client::Licenses + # source://octokit//lib/octokit/client/licenses.rb#25 + def license(license_name, options = T.unsafe(nil)); end + + # source://octokit//lib/octokit/client/licenses.rb#14 + def licenses(options = T.unsafe(nil)); end + + # source://octokit//lib/octokit/client/licenses.rb#37 + def repository_license_contents(repo, options = T.unsafe(nil)); end +end + +# Methods for the Markdown API +# +# @see https://developer.github.com/v3/markdown/ +# +# source://octokit//lib/octokit/client/markdown.rb#8 +module Octokit::Client::Markdown + # Render an arbitrary Markdown document + # + # @example Render some GFM + # Octokit.markdown('Fixed in #111', :mode => "gfm", :context => "octokit/octokit.rb") + # @option options + # @option options + # @param text [String] Markdown source + # @param options [Hash] a customizable set of options + # @return [String] HTML renderization + # @see https://developer.github.com/v3/markdown/#render-an-arbitrary-markdown-document + # + # source://octokit//lib/octokit/client/markdown.rb#18 + def markdown(text, options = T.unsafe(nil)); end +end + +# Methods for the Marketplace Listing API +# +# @see https://developer.github.com/v3/apps/marketplace/ +# +# source://octokit//lib/octokit/client/marketplace.rb#8 +module Octokit::Client::Marketplace + # List all GitHub accounts on a specific plan + # + # @param plan_id [Integer] The id of the GitHub plan + # @param options [Hash] A customizable set of options + # @return [Array] A list of accounts + # @see https://developer.github.com/v3/apps/marketplace/#list-all-github-accounts-user-or-organization-on-a-specific-plan + # + # source://octokit//lib/octokit/client/marketplace.rb#28 + def list_accounts_for_plan(plan_id, options = T.unsafe(nil)); end + + # List all plans for an app's marketplace listing + # + # @param options [Hash] A customizable set of options + # @return [Array] A list of plans + # @see https://developer.github.com/v3/apps/marketplace/#list-all-plans-for-your-marketplace-listing + # + # source://octokit//lib/octokit/client/marketplace.rb#16 + def list_plans(options = T.unsafe(nil)); end + + # Get user's Marketplace purchases + # + # @param options [Hash] A customizable set of options + # @return [Array] A list of Marketplace purchases + # @see https://developer.github.com/v3/apps/marketplace/#get-a-users-marketplace-purchases + # + # source://octokit//lib/octokit/client/marketplace.rb#51 + def marketplace_purchases(options = T.unsafe(nil)); end + + # Get the plan associated with a given GitHub account + # + # @param account_id [Integer] The id of the GitHub account + # @param options [Hash] A customizable set of options + # @return [Sawyer::Resource] Account with plan details, or nil + # @see https://developer.github.com/v3/apps/marketplace/#check-if-a-github-account-is-associated-with-any-marketplace-listing + # + # source://octokit//lib/octokit/client/marketplace.rb#40 + def plan_for_account(account_id, options = T.unsafe(nil)); end +end + +# Methods for the Meta API +# +# @see https://developer.github.com/v3/meta/ +# +# source://octokit//lib/octokit/client/meta.rb#8 +module Octokit::Client::Meta + # Get meta information about GitHub.com, the service. + # + # @example Get GitHub meta information + # @client.github_meta + # @return [Sawyer::Resource] Hash with meta information. + # @see https://developer.github.com/v3/meta/#meta + # + # source://octokit//lib/octokit/client/meta.rb#14 + def github_meta(options = T.unsafe(nil)); end + + # Get meta information about GitHub.com, the service. + # + # @example Get GitHub meta information + # @client.github_meta + # @return [Sawyer::Resource] Hash with meta information. + # @see https://developer.github.com/v3/meta/#meta + # + # source://octokit//lib/octokit/client/meta.rb#14 + def meta(options = T.unsafe(nil)); end +end + +# Methods for the Issues Milestones API +# +# @see https://developer.github.com/v3/issues/milestones/ +# +# source://octokit//lib/octokit/client/milestones.rb#8 +module Octokit::Client::Milestones + # Create a milestone for a repository + # + # @example Create a milestone for a repository + # Octokit.create_milestone("octokit/octokit.rb", "0.7.0", {:description => 'Add support for v3 of Github API'}) + # @option options + # @option options + # @option options + # @param repository [Integer, String, Repository, Hash] A GitHub repository + # @param title [String] A unique title. + # @param options [Hash] A customizable set of options. + # @return [Sawyer::Resource] A single milestone object + # @see https://developer.github.com/v3/issues/milestones/#create-a-milestone + # + # source://octokit//lib/octokit/client/milestones.rb#51 + def create_milestone(repository, title, options = T.unsafe(nil)); end + + # Delete a single milestone for a repository + # + # @example Delete a single milestone from a repository + # Octokit.delete_milestone("octokit/octokit.rb", 1) + # @option options + # @param repository [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] A customizable set of options. + # @return [Boolean] Success + # @see https://developer.github.com/v3/issues/milestones/#delete-a-milestone + # + # source://octokit//lib/octokit/client/milestones.rb#82 + def delete_milestone(repository, number, options = T.unsafe(nil)); end + + # Update a milestone for a repository + # + # @example Update a milestone for a repository + # Octokit.update_milestone("octokit/octokit.rb", 1, {:description => 'Add support for v3 of Github API'}) + # @option options + # @option options + # @option options + # @option options + # @param repository [Integer, String, Repository, Hash] A GitHub repository + # @param number [String, Integer] ID of the milestone + # @param options [Hash] A customizable set of options. + # @return [Sawyer::Resource] A single milestone object + # @see https://developer.github.com/v3/issues/milestones/#update-a-milestone + # + # source://octokit//lib/octokit/client/milestones.rb#68 + def edit_milestone(repository, number, options = T.unsafe(nil)); end + + # List milestones for a repository + # + # @example List milestones for a repository + # Octokit.list_milestones("octokit/octokit.rb") + # @option options + # @option options + # @option options + # @option options + # @param repository [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] A customizable set of options. + # @return [Array] A list of milestones for a repository. + # @see https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + # + # source://octokit//lib/octokit/client/milestones.rb#21 + def list_milestones(repository, options = T.unsafe(nil)); end + + # Get a single milestone for a repository + # + # @example Get a single milestone for a repository + # Octokit.milestone("octokit/octokit.rb", 1) + # @option options + # @param repository [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] A customizable set of options. + # @return [Sawyer::Resource] A single milestone from a repository. + # @see https://developer.github.com/v3/issues/milestones/#get-a-single-milestone + # + # source://octokit//lib/octokit/client/milestones.rb#35 + def milestone(repository, number, options = T.unsafe(nil)); end + + # List milestones for a repository + # + # @example List milestones for a repository + # Octokit.list_milestones("octokit/octokit.rb") + # @option options + # @option options + # @option options + # @option options + # @param repository [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] A customizable set of options. + # @return [Array] A list of milestones for a repository. + # @see https://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + # + # source://octokit//lib/octokit/client/milestones.rb#21 + def milestones(repository, options = T.unsafe(nil)); end + + # Update a milestone for a repository + # + # @example Update a milestone for a repository + # Octokit.update_milestone("octokit/octokit.rb", 1, {:description => 'Add support for v3 of Github API'}) + # @option options + # @option options + # @option options + # @option options + # @param repository [Integer, String, Repository, Hash] A GitHub repository + # @param number [String, Integer] ID of the milestone + # @param options [Hash] A customizable set of options. + # @return [Sawyer::Resource] A single milestone object + # @see https://developer.github.com/v3/issues/milestones/#update-a-milestone + # + # source://octokit//lib/octokit/client/milestones.rb#68 + def update_milestone(repository, number, options = T.unsafe(nil)); end +end + +# Methods for the Notifications API +# +# @see https://developer.github.com/v3/activity/notifications/ +# +# source://octokit//lib/octokit/client/notifications.rb#8 +module Octokit::Client::Notifications + # Delete a thread subscription + # + # @example + # @client.delete_thread_subscription(1) + # @param thread_id [Integer] Id of the thread. + # @return [Boolean] True if delete successful, false otherwise. + # @see https://developer.github.com/v3/activity/notifications/#delete-a-thread-subscription + # + # source://octokit//lib/octokit/client/notifications.rb#162 + def delete_thread_subscription(thread_id, options = T.unsafe(nil)); end + + # Mark notifications as read + # + # @example + # @client.mark_notifications_as_read + # @option options + # @option options + # @option options + # @param options [Hash] Optional parameters + # @return [Boolean] True if marked as read, false otherwise + # @see https://developer.github.com/v3/activity/notifications/#mark-as-read + # + # source://octokit//lib/octokit/client/notifications.rb#68 + def mark_notifications_as_read(options = T.unsafe(nil)); end + + # Mark notifications from a specific repository as read + # + # @example + # @client.mark_notifications_as_read("octokit/octokit.rb") + # @option options + # @option options + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param options [Hash] Optional parameters + # @return [Boolean] True if marked as read, false otherwise + # @see https://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository + # + # source://octokit//lib/octokit/client/notifications.rb#89 + def mark_repo_notifications_as_read(repo, options = T.unsafe(nil)); end + + # Mark notifications from a specific repository as read + # + # @example + # @client.mark_notifications_as_read("octokit/octokit.rb") + # @option options + # @option options + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param options [Hash] Optional parameters + # @return [Boolean] True if marked as read, false otherwise + # @see https://developer.github.com/v3/activity/notifications/#mark-notifications-as-read-in-a-repository + # + # source://octokit//lib/octokit/client/notifications.rb#89 + def mark_repository_notifications_as_read(repo, options = T.unsafe(nil)); end + + # Mark thread as read + # + # @example + # @client.mark_thread_as_read(1, :read => false) + # @param thread_id [Integer] Id of the thread to update. + # @return [Boolean] True if updated, false otherwise. + # @see https://developer.github.com/v3/activity/notifications/#mark-a-thread-as-read + # + # source://octokit//lib/octokit/client/notifications.rb#115 + def mark_thread_as_read(thread_id, options = T.unsafe(nil)); end + + # List your notifications + # + # @example Get all notifications since a certain time. + # @client.notifications({all: true, since: '2012-10-09T23:39:01Z'}) + # @example Get users notifications + # @client.notifications + # @option options + # @option options + # @option options + # @param options [Hash] Optional parameters + # @return [Array] Array of notifications. + # @see https://developer.github.com/v3/activity/notifications/#list-your-notifications + # + # source://octokit//lib/octokit/client/notifications.rb#26 + def notifications(options = T.unsafe(nil)); end + + # List your notifications in a repository + # + # @example Get your notifications for octokit/octokit.rb since a time. + # @client.repository_notifications({since: '2012-10-09T23:39:01Z'}) + # @example Get your notifications for octokit/octokit.rb + # @client.repository_notifications('octokit/octokit.rb') + # @option options + # @option options + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param options [Hash] Optional parameters + # @return [Array] Array of notifications. + # @see https://developer.github.com/v3/activity/notifications/#list-your-notifications-in-a-repository + # + # source://octokit//lib/octokit/client/notifications.rb#48 + def repo_notifications(repo, options = T.unsafe(nil)); end + + # List your notifications in a repository + # + # @example Get your notifications for octokit/octokit.rb since a time. + # @client.repository_notifications({since: '2012-10-09T23:39:01Z'}) + # @example Get your notifications for octokit/octokit.rb + # @client.repository_notifications('octokit/octokit.rb') + # @option options + # @option options + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param options [Hash] Optional parameters + # @return [Array] Array of notifications. + # @see https://developer.github.com/v3/activity/notifications/#list-your-notifications-in-a-repository + # + # source://octokit//lib/octokit/client/notifications.rb#48 + def repository_notifications(repo, options = T.unsafe(nil)); end + + # List notifications for a specific thread + # + # @example + # @client.notification_thread(1000) + # @param thread_id [Integer] Id of the thread. + # @return [Array] Array of notifications. + # @see https://developer.github.com/v3/activity/notifications/#view-a-single-thread + # + # source://octokit//lib/octokit/client/notifications.rb#104 + def thread_notifications(thread_id, options = T.unsafe(nil)); end + + # Get thread subscription + # + # @example + # @client.thread_subscription(1) + # @param thread_id [Integer] Id of the thread. + # @return [Sawyer::Resource] Subscription. + # @see https://developer.github.com/v3/activity/notifications/#get-a-thread-subscription + # + # source://octokit//lib/octokit/client/notifications.rb#128 + def thread_subscription(thread_id, options = T.unsafe(nil)); end + + # Update thread subscription + # + # This lets you subscribe to a thread, or ignore it. Subscribing to a + # thread is unnecessary if the user is already subscribed to the + # repository. Ignoring a thread will mute all future notifications (until + # you comment or get @mentioned). + # + # @example Subscribe to notifications + # @client.update_thread_subscription(1, :subscribed => true) + # @example Ignore notifications from a repo + # @client.update_thread_subscription(1, :ignored => true) + # @option options + # @option options + # @param thread_id [Integer] Id of the thread. + # @param options + # @return [Sawyer::Resource] Updated subscription. + # @see https://developer.github.com/v3/activity/notifications/#set-a-thread-subscription + # + # source://octokit//lib/octokit/client/notifications.rb#151 + def update_thread_subscription(thread_id, options = T.unsafe(nil)); end +end + +# Methods for the OauthApplications API +# +# @see https://developer.github.com/v3/apps/oauth_applications +# +# source://octokit//lib/octokit/client/oauth_applications.rb#8 +module Octokit::Client::OauthApplications + # Check if a token is valid. + # + # Applications can check if a token is valid without rate limits. + # + # @example + # client = Octokit::Client.new(:client_id => 'abcdefg12345', :client_secret => 'secret') + # client.check_token('deadbeef1234567890deadbeef987654321') + # @param access_token [String] 40 character GitHub OAuth access token + # @return [Sawyer::Resource] A single authorization for the authenticated user + # @see https://developer.github.com/v3/apps/oauth_applications/#check-a-token + # + # source://octokit//lib/octokit/client/oauth_applications.rb#21 + def check_application_authorization(access_token, options = T.unsafe(nil)); end + + # Check if a token is valid. + # + # Applications can check if a token is valid without rate limits. + # + # @example + # client = Octokit::Client.new(:client_id => 'abcdefg12345', :client_secret => 'secret') + # client.check_token('deadbeef1234567890deadbeef987654321') + # @param access_token [String] 40 character GitHub OAuth access token + # @return [Sawyer::Resource] A single authorization for the authenticated user + # @see https://developer.github.com/v3/apps/oauth_applications/#check-a-token + # + # source://octokit//lib/octokit/client/oauth_applications.rb#21 + def check_token(access_token, options = T.unsafe(nil)); end + + # Delete an app authorization + # + # OAuth application owners can revoke a grant for their OAuth application and a specific user. + # + # @example + # client = Octokit::Client.new(:client_id => 'abcdefg12345', :client_secret => 'secret') + # client.delete_app_authorization('deadbeef1234567890deadbeef987654321') + # @param access_token [String] 40 character GitHub OAuth access token + # @return [Boolean] Result + # @see https://developer.github.com/v3/apps/oauth_applications/#delete-an-app-token + # + # source://octokit//lib/octokit/client/oauth_applications.rb#99 + def delete_app_authorization(access_token, options = T.unsafe(nil)); end + + # Delete an app token + # + # Applications can revoke (delete) a token + # + # @example + # client = Octokit::Client.new(:client_id => 'abcdefg12345', :client_secret => 'secret') + # client.delete_app_token('deadbeef1234567890deadbeef987654321') + # @param access_token [String] 40 character GitHub OAuth access token + # @return [Boolean] Result + # @see https://developer.github.com/v3/apps/oauth_applications/#delete-an-app-token + # + # source://octokit//lib/octokit/client/oauth_applications.rb#69 + def delete_app_token(access_token, options = T.unsafe(nil)); end + + # Delete an app token + # + # Applications can revoke (delete) a token + # + # @example + # client = Octokit::Client.new(:client_id => 'abcdefg12345', :client_secret => 'secret') + # client.delete_app_token('deadbeef1234567890deadbeef987654321') + # @param access_token [String] 40 character GitHub OAuth access token + # @return [Boolean] Result + # @see https://developer.github.com/v3/apps/oauth_applications/#delete-an-app-token + # + # source://octokit//lib/octokit/client/oauth_applications.rb#69 + def delete_application_authorization(access_token, options = T.unsafe(nil)); end + + # Reset a token + # + # Applications can reset a token without requiring a user to re-authorize. + # + # @example + # client = Octokit::Client.new(:client_id => 'abcdefg12345', :client_secret => 'secret') + # client.reset_token('deadbeef1234567890deadbeef987654321') + # @param access_token [String] 40 character GitHub OAuth access token + # @return [Sawyer::Resource] A single authorization for the authenticated user + # @see https://developer.github.com/v3/apps/oauth_applications/#reset-a-token + # + # source://octokit//lib/octokit/client/oauth_applications.rb#45 + def reset_application_authorization(access_token, options = T.unsafe(nil)); end + + # Reset a token + # + # Applications can reset a token without requiring a user to re-authorize. + # + # @example + # client = Octokit::Client.new(:client_id => 'abcdefg12345', :client_secret => 'secret') + # client.reset_token('deadbeef1234567890deadbeef987654321') + # @param access_token [String] 40 character GitHub OAuth access token + # @return [Sawyer::Resource] A single authorization for the authenticated user + # @see https://developer.github.com/v3/apps/oauth_applications/#reset-a-token + # + # source://octokit//lib/octokit/client/oauth_applications.rb#45 + def reset_token(access_token, options = T.unsafe(nil)); end + + # Delete an app token + # + # Applications can revoke (delete) a token + # + # @example + # client = Octokit::Client.new(:client_id => 'abcdefg12345', :client_secret => 'secret') + # client.delete_app_token('deadbeef1234567890deadbeef987654321') + # @param access_token [String] 40 character GitHub OAuth access token + # @return [Boolean] Result + # @see https://developer.github.com/v3/apps/oauth_applications/#delete-an-app-token + # + # source://octokit//lib/octokit/client/oauth_applications.rb#69 + def revoke_application_authorization(access_token, options = T.unsafe(nil)); end +end + +# Methods for the Git Data API +# +# @see https://developer.github.com/v3/git/ +# +# source://octokit//lib/octokit/client/objects.rb#8 +module Octokit::Client::Objects + # Get a single blob, fetching its content and encoding + # + # @example Fetch a blob and inspect its contents + # blob = Octokit.blob("octocat/Hello-World", "827efc6d56897b048c772eb4087f854f46256132") + # blob.encoding # => "utf-8" + # blob.content # => "Foo bar baz" + # @example Fetch a base64-encoded blob and inspect its contents + # require "base64" + # blob = Octokit.blob("octocat/Hello-World", "827efc6d56897b048c772eb4087f854f46256132") + # blob.encoding # => "base64" + # blob.content # => "Rm9vIGJhciBiYXo=" + # Base64.decode64(blob.content) # => "Foo bar baz" + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param blob_sha [String] The SHA of the blob to fetch + # @return [Sawyer::Resource] A hash representing the fetched blob + # @see https://developer.github.com/v3/git/blobs/#get-a-blob + # + # source://octokit//lib/octokit/client/objects.rb#61 + def blob(repo, blob_sha, options = T.unsafe(nil)); end + + # Create a blob + # + # @example Create a blob containing foo bar baz + # Octokit.create_blob("octocat/Hello-World", "foo bar baz") + # @example Create a blob containing foo bar baz, encoded using base64 + # require "base64" + # Octokit.create_blob("octocat/Hello-World", Base64.encode64("foo bar baz"), "base64") + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param content [String] Content of the blob + # @param encoding [String] The content's encoding. utf-8 and base64 are accepted. If your data cannot be losslessly sent as a UTF-8 string, you can base64 encode it + # @return [String] The new blob's SHA, e.g. 827efc6d56897b048c772eb4087f854f46256132 + # @see https://developer.github.com/v3/git/blobs/#create-a-blob + # + # source://octokit//lib/octokit/client/objects.rb#77 + def create_blob(repo, content, encoding = T.unsafe(nil), options = T.unsafe(nil)); end + + # Create a tag + # + # Requires authenticated client. + # + # @example + # @client.create_tag( + # "octokit/octokit.rb", + # "v9000.0.0", + # "Version 9000\n", + # "f4cdf6eb734f32343ce3f27670c17b35f54fd82e", + # "commit", + # "Wynn Netherland", + # "wynn.netherland@gmail.com", + # "2012-06-03T17:03:11-07:00" + # ) + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param tag [String] Tag string. + # @param message [String] Tag message. + # @param object_sha [String] SHA of the git object this is tagging. + # @param tagger_name [String] Name of the author of the tag. + # @param tagger_email [String] Email of the author of the tag. + # @param tagger_date [string] Timestamp of when this object was tagged. + # @param type [String] Type of the object we're tagging. Normally this is + # a `commit` but it can also be a `tree` or a `blob`. + # @return [Sawyer::Resource] Hash representing new tag. + # @see https://developer.github.com/v3/git/tags/#create-a-tag-object + # + # source://octokit//lib/octokit/client/objects.rb#125 + def create_tag(repo, tag, message, object_sha, type, tagger_name, tagger_email, tagger_date, options = T.unsafe(nil)); end + + # Create a tree + # + # Pass :base_tree => "827efc6..." in options to update an existing tree with new data. + # + # @example Create a tree containing one file + # tree = Octokit.create_tree("octocat/Hello-World", [ { :path => "file.rb", :mode => "100644", :type => "blob", :sha => "44b4fc6d56897b048c772eb4087f854f46256132" } ]) + # tree.sha # => "cd8274d15fa3ae2ab983129fb037999f264ba9a7" + # tree.tree.first.path # => "file.rb" + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param tree [Array] An array of hashes representing a tree structure + # @return [Sawyer::Resource] A hash representing the new tree + # @see https://developer.github.com/v3/git/trees/#create-a-tree + # + # source://octokit//lib/octokit/client/objects.rb#40 + def create_tree(repo, tree, options = T.unsafe(nil)); end + + # Get a tag + # + # @example Fetch a tag + # Octokit.tag('octokit/octokit.rb', '23aad20633f4d2981b1c7209a800db3014774e96') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param tag_sha [String] The SHA of the tag to fetch. + # @return [Sawyer::Resource] Hash representing the tag. + # @see https://developer.github.com/v3/git/tags/#get-a-tag + # + # source://octokit//lib/octokit/client/objects.rb#95 + def tag(repo, tag_sha, options = T.unsafe(nil)); end + + # Get a single tree, fetching information about its root-level objects + # + # Pass :recursive => true in options to fetch information about all of the tree's objects, including those in subdirectories. + # + # @example Fetch a tree and inspect the path of one of its files + # tree = Octokit.tree("octocat/Hello-World", "9fb037999f264ba9a7fc6274d15fa3ae2ab98312") + # tree.tree.first.path # => "file.rb" + # @example Fetch a tree recursively + # tree = Octokit.tree("octocat/Hello-World", "fc6274d15fa3ae2ab983129fb037999f264ba9a7", :recursive => true) + # tree.tree.first.path # => "subdir/file.txt" + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param tree_sha [String] The SHA of the tree to fetch + # @return [Sawyer::Resource] A hash representing the fetched tree + # @see https://developer.github.com/v3/git/trees/#get-a-tree + # @see https://developer.github.com/v3/git/trees/#get-a-tree-recursively + # + # source://octokit//lib/octokit/client/objects.rb#24 + def tree(repo, tree_sha, options = T.unsafe(nil)); end +end + +# Methods for the Organizations API +# +# @see https://developer.github.com/v3/orgs/ +# +# source://octokit//lib/octokit/client/organizations.rb#8 +module Octokit::Client::Organizations + # Add team member + # + # Requires authenticated organization owner or member with team + # `admin` permission. + # + # @example + # @client.add_team_member(100000, 'pengwynn') + # @example + # # Opt-in to future behavior for this endpoint. Adds the member to the + # # team if they're already an org member. If not, the method will return + # # 422 and indicate the user should call the new Team Membership endpoint. + # @client.add_team_member \ + # 100000, + # 'pengwynn', + # :accept => "application/vnd.github.the-wasp-preview+json" + # @param team_id [Integer] Team id. + # @param user [String] GitHub username of new team member. + # @return [Boolean] True on successful addition, false otherwise. + # @see https://developer.github.com/v3/orgs/teams/#add-team-member + # @see https://developer.github.com/changes/2014-08-05-team-memberships-api/ + # + # source://octokit//lib/octokit/client/organizations.rb#458 + def add_team_member(team_id, user, options = T.unsafe(nil)); end + + # Add or invite a user to a team + # + # @example Check if a user has a membership for a team + # @client.add_team_membership(1234, 'pengwynn') + # @param team_id [Integer] Team id. + # @param user [String] GitHub username of the user to invite. + # @return [Sawyer::Resource] Hash of team membership info + # @see https://developer.github.com/v3/orgs/teams/#add-or-update-team-membership + # + # source://octokit//lib/octokit/client/organizations.rb#679 + def add_team_membership(team_id, user, options = T.unsafe(nil)); end + + # Add team repository + # + # This can also be used to update the permission of an existing team + # + # Requires authenticated user to be an owner of the organization that the + # team is associated with. Also, the repo must be owned by the + # organization, or a direct form of a repo owned by the organization. + # + # @example + # @client.add_team_repo(100000, 'github/developer.github.com') + # @example + # @client.add_team_repository(100000, 'github/developer.github.com') + # @example Add a team with admin permissions + # @client.add_team_repository(100000, 'github/developer.github.com', permission: 'admin') + # @option options + # @param repo [String, Hash, Repository] A GitHub repository. + # @param team_id [Integer] Team id. + # @param options [Hash] a customizable set of options + # @return [Boolean] True if successful, false otherwise. + # @see Octokit::Repository + # @see https://developer.github.com/v3/orgs/teams/#add-or-update-team-repository + # + # source://octokit//lib/octokit/client/organizations.rb#570 + def add_team_repo(team_id, repo, options = T.unsafe(nil)); end + + # Add team repository + # + # This can also be used to update the permission of an existing team + # + # Requires authenticated user to be an owner of the organization that the + # team is associated with. Also, the repo must be owned by the + # organization, or a direct form of a repo owned by the organization. + # + # @example + # @client.add_team_repo(100000, 'github/developer.github.com') + # @example + # @client.add_team_repository(100000, 'github/developer.github.com') + # @example Add a team with admin permissions + # @client.add_team_repository(100000, 'github/developer.github.com', permission: 'admin') + # @option options + # @param repo [String, Hash, Repository] A GitHub repository. + # @param team_id [Integer] Team id. + # @param options [Hash] a customizable set of options + # @return [Boolean] True if successful, false otherwise. + # @see Octokit::Repository + # @see https://developer.github.com/v3/orgs/teams/#add-or-update-team-repository + # + # source://octokit//lib/octokit/client/organizations.rb#570 + def add_team_repository(team_id, repo, options = T.unsafe(nil)); end + + # List all GitHub organizations + # + # This provides a list of every organization, in the order that they + # were created. + # + # Organization that you’ve seen. + # + # @option options + # @param options [Hash] Optional options. + # @return [Array] List of GitHub organizations. + # @see https://developer.github.com/v3/orgs/#list-all-organizations + # + # source://octokit//lib/octokit/client/organizations.rb#116 + def all_organizations(options = T.unsafe(nil)); end + + # List all GitHub organizations + # + # This provides a list of every organization, in the order that they + # were created. + # + # Organization that you’ve seen. + # + # @option options + # @param options [Hash] Optional options. + # @return [Array] List of GitHub organizations. + # @see https://developer.github.com/v3/orgs/#list-all-organizations + # + # source://octokit//lib/octokit/client/organizations.rb#116 + def all_orgs(options = T.unsafe(nil)); end + + # Get GitHub Actions billing for an organization + # + # Requires authenticated organization owner. + # + # @example + # @client.billing_actions('github') + # @param org [String, Integer] Organization GitHub login or id. + # @return [Sawyer::Resource] Hash representing GitHub Actions billing for an organization. + # @see https://docs.github.com/en/rest/reference/billing#get-github-actions-billing-for-an-organization + # + # source://octokit//lib/octokit/client/organizations.rb#839 + def billing_actions(org); end + + # List child teams + # + # Requires authenticated organization member. + # + # @example + # @client.child_teams(100000, :accept => "application/vnd.github.hellcat-preview+json") + # @param team_id [Integer] Team id. + # @return [Sawyer::Resource] Hash representing team. + # @see https://developer.github.com/v3/orgs/teams/#list-child-teams + # + # source://octokit//lib/octokit/client/organizations.rb#384 + def child_teams(team_id, options = T.unsafe(nil)); end + + # Conceal a user's membership of an organization. + # + # Requires authenticated organization owner. + # + # @example + # @client.unpublicize_membership('github', 'pengwynn') + # @example + # @client.conceal_membership('github', 'pengwynn') + # @param org [String, Integer] Organization GitHub login or id. + # @param user [String] GitHub username of user to unpublicize. + # @return [Boolean] True of unpublicization successful, false otherwise. + # @see https://developer.github.com/v3/orgs/members/#conceal-a-users-membership + # + # source://octokit//lib/octokit/client/organizations.rb#640 + def conceal_membership(org, user, options = T.unsafe(nil)); end + + # Converts an organization member to an outside collaborator + # + # Requires authenticated organization members. + # + # @example + # @client.convert_to_outside_collaborator('github', 'lizzhale') + # @param org [String, Integer] Organization GitHub login or id. + # @param user [String] GitHub username to be removed as outside collaborator + # @return [Boolean] Return true if outside collaborator removed from organization, false otherwise. + # @see https://developer.github.com/v3/orgs/outside-collaborators/#convert-member-to-outside-collaborator + # + # source://octokit//lib/octokit/client/organizations.rb#284 + def convert_to_outside_collaborator(org, user, options = T.unsafe(nil)); end + + # Create team + # + # Requires authenticated organization owner. + # + # @example + # @client.create_team('github', { + # :name => 'Designers', + # :repo_names => ['github/dotfiles'] + # }) + # @option options + # @option options + # @option options + # @option options + # @param org [String, Integer] Organization GitHub login or id. + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Hash representing new team. + # @see https://developer.github.com/v3/orgs/teams/#create-team + # + # source://octokit//lib/octokit/client/organizations.rb#320 + def create_team(org, options = T.unsafe(nil)); end + + # Deletes a previous migration archive. + # + # Requires authenticated organization owner. + # + # @param org [String, Integer] Organization GitHub login or id. + # @param id [Integer] ID number of the migration. + # @see https://docs.github.com/en/rest/reference/migrations#delete-an-organization-migration-archive + # + # source://octokit//lib/octokit/client/organizations.rb#813 + def delete_migration_archive(org, id, options = T.unsafe(nil)); end + + # Delete an organization. + # + # Requires authenticated organization owner. + # + # @example + # @client.delete_organization("my-org") + # @example + # @client.delete_org("my-org") + # @param org [String, Integer] Organization login or ID. + # @return [Boolean] True if deletion successful, otherwise false. + # @see https://docs.github.com/rest/orgs/orgs#delete-an-organization + # + # source://octokit//lib/octokit/client/organizations.rb#64 + def delete_org(org); end + + # Delete an organization. + # + # Requires authenticated organization owner. + # + # @example + # @client.delete_organization("my-org") + # @example + # @client.delete_org("my-org") + # @param org [String, Integer] Organization login or ID. + # @return [Boolean] True if deletion successful, otherwise false. + # @see https://docs.github.com/rest/orgs/orgs#delete-an-organization + # + # source://octokit//lib/octokit/client/organizations.rb#64 + def delete_organization(org); end + + # Delete team + # + # Requires authenticated organization owner. + # + # @example + # @client.delete_team(100000) + # @param team_id [Integer] Team id. + # @return [Boolean] True if deletion successful, false otherwise. + # @see https://developer.github.com/v3/orgs/teams/#delete-team + # + # source://octokit//lib/octokit/client/organizations.rb#420 + def delete_team(team_id, options = T.unsafe(nil)); end + + # Get organizations for a user. + # + # Nonauthenticated calls to this method will return organizations that + # the user is a public member. + # + # Use an authenticated client to get both public and private organizations + # for a user. + # + # Calling this method on a `@client` will return that users organizations. + # Private organizations are included only if the `@client` is authenticated. + # + # @example + # Octokit.organizations('pengwynn') + # @example + # @client.organizations('pengwynn') + # @example + # Octokit.orgs('pengwynn') + # @example + # Octokit.list_organizations('pengwynn') + # @example + # Octokit.list_orgs('pengwynn') + # @example + # @client.organizations + # @param user [Integer, String] GitHub user login or id of the user to get + # list of organizations. + # @return [Array] Array of hashes representing organizations. + # @see https://developer.github.com/v3/orgs/#list-your-organizations + # @see https://developer.github.com/v3/orgs/#list-user-organizations + # + # source://octokit//lib/octokit/client/organizations.rb#97 + def list_organizations(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # Get organizations for a user. + # + # Nonauthenticated calls to this method will return organizations that + # the user is a public member. + # + # Use an authenticated client to get both public and private organizations + # for a user. + # + # Calling this method on a `@client` will return that users organizations. + # Private organizations are included only if the `@client` is authenticated. + # + # @example + # Octokit.organizations('pengwynn') + # @example + # @client.organizations('pengwynn') + # @example + # Octokit.orgs('pengwynn') + # @example + # Octokit.list_organizations('pengwynn') + # @example + # Octokit.list_orgs('pengwynn') + # @example + # @client.organizations + # @param user [Integer, String] GitHub user login or id of the user to get + # list of organizations. + # @return [Array] Array of hashes representing organizations. + # @see https://developer.github.com/v3/orgs/#list-your-organizations + # @see https://developer.github.com/v3/orgs/#list-user-organizations + # + # source://octokit//lib/octokit/client/organizations.rb#97 + def list_orgs(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # Fetches the URL to a migration archive. + # + # Requires authenticated organization owner. + # + # @param org [String, Integer] Organization GitHub login or id. + # @param id [Integer] ID number of the migration. + # @see https://docs.github.com/en/rest/reference/migrations#download-an-organization-migration-archive + # + # source://octokit//lib/octokit/client/organizations.rb#799 + def migration_archive_url(org, id, options = T.unsafe(nil)); end + + # Fetches the status of a migration. + # + # Requires authenticated organization owner. + # + # @param org [String, Integer] Organization GitHub login or id. + # @param id [Integer] ID number of the migration. + # @see https://docs.github.com/en/rest/reference/migrations#get-an-organization-migration-status + # + # source://octokit//lib/octokit/client/organizations.rb#788 + def migration_status(org, id, options = T.unsafe(nil)); end + + # Lists the most recent migrations. + # + # Requires authenticated organization owner. + # + # @param org [String, Integer] Organization GitHub login or id. + # @return [Array] Array of migration resources. + # @see https://docs.github.com/en/rest/reference/migrations#list-organization-migrations + # + # source://octokit//lib/octokit/client/organizations.rb#777 + def migrations(org, options = T.unsafe(nil)); end + + # Get an organization + # + # @example + # Octokit.organization('github') + # @example + # Octokit.org('github') + # @param org [String, Integer] Organization GitHub login or id. + # @return [Sawyer::Resource] Hash representing GitHub organization. + # @see https://developer.github.com/v3/orgs/#get-an-organization + # + # source://octokit//lib/octokit/client/organizations.rb#18 + def org(org, options = T.unsafe(nil)); end + + # List pending organization invitations + # + # Requires authenticated organization member. + # + # @example + # @client.organization_invitations('github') + # @param org [String, Integer] Organization GitHub login or id. + # @return [Array] Array of hashes representing invitations. + # @see https://developer.github.com/v3/orgs/members/#list-pending-organization-invitations + # + # source://octokit//lib/octokit/client/organizations.rb#239 + def org_invitations(org, options = T.unsafe(nil)); end + + # Check if a user is a member of an organization. + # + # Use this to check if another user is a member of an organization that + # you are a member. If you are not in the organization you are checking, + # use .organization_public_member? instead. + # + # @example Check if a user is in your organization + # @client.organization_member?('your_organization', 'pengwynn') + # => false + # @param org [String, Integer] Organization GitHub login or id. + # @param user [String] GitHub username of the user to check. + # @return [Boolean] Is a member? + # @see https://developer.github.com/v3/orgs/members/#check-membership + # + # source://octokit//lib/octokit/client/organizations.rb#199 + def org_member?(org, user, options = T.unsafe(nil)); end + + # Get organization members + # + # Public members of the organization are returned by default. An + # authenticated client that is a member of the GitHub organization + # is required to get private members. + # + # @example + # Octokit.organization_members('github') + # @example + # Octokit.org_members('github') + # @param org [String, Integer] Organization GitHub login or id. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/orgs/members/#members-list + # + # source://octokit//lib/octokit/client/organizations.rb#160 + def org_members(org, options = T.unsafe(nil)); end + + # Get an organization membership + # + # @option options + # @param org [Integer, String] The GitHub Organization. + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Hash representing the organization membership. + # @see https://developer.github.com/v3/orgs/members/#get-your-organization-membership + # @see https://developer.github.com/v3/orgs/members/#get-organization-membership + # + # source://octokit//lib/octokit/client/organizations.rb#711 + def org_membership(org, options = T.unsafe(nil)); end + + # List all organizations memberships for the authenticated user + # + # @return [Array] Array of organizations memberships. + # @see https://developer.github.com/v3/orgs/members/#list-your-organization-memberships + # + # source://octokit//lib/octokit/client/organizations.rb#699 + def org_memberships(options = T.unsafe(nil)); end + + # Check if a user is a public member of an organization. + # + # If you are checking for membership of a user of an organization that + # you are in, use .organization_member? instead. + # + # @example Check if a user is a hubbernaut + # @client.organization_public_member?('github', 'pengwynn') + # => true + # @param org [String, Integer] Organization GitHub login or id. + # @param user [String] GitHub username of the user to check. + # @return [Boolean] Is a public member? + # @see https://developer.github.com/v3/orgs/members/#check-public-membership + # + # source://octokit//lib/octokit/client/organizations.rb#224 + def org_public_member?(org, user, options = T.unsafe(nil)); end + + # Get organization public members + # + # Lists the public members of an organization + # + # @example + # Octokit.organization_public_members('github') + # @example + # Octokit.org_public_members('github') + # @param org [String] Organization GitHub username. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/orgs/members/#public-members-list + # + # source://octokit//lib/octokit/client/organizations.rb#178 + def org_public_members(org, options = T.unsafe(nil)); end + + # List organization repositories + # + # Public repositories are available without authentication. Private repos + # require authenticated organization member. + # + # @example + # Octokit.organization_repositories('github') + # @example + # Octokit.org_repositories('github') + # @example + # Octokit.org_repos('github') + # @example + # @client.org_repos('github', {:type => 'private'}) + # @option options + # @param org [String, Integer] Organization GitHub login or id for which + # to list repos. + # @param options [Hash] a customizable set of options + # @return [Array] List of repositories + # @see https://developer.github.com/v3/repos/#list-organization-repositories + # + # source://octokit//lib/octokit/client/organizations.rb#141 + def org_repos(org, options = T.unsafe(nil)); end + + # List organization repositories + # + # Public repositories are available without authentication. Private repos + # require authenticated organization member. + # + # @example + # Octokit.organization_repositories('github') + # @example + # Octokit.org_repositories('github') + # @example + # Octokit.org_repos('github') + # @example + # @client.org_repos('github', {:type => 'private'}) + # @option options + # @param org [String, Integer] Organization GitHub login or id for which + # to list repos. + # @param options [Hash] a customizable set of options + # @return [Array] List of repositories + # @see https://developer.github.com/v3/repos/#list-organization-repositories + # + # source://octokit//lib/octokit/client/organizations.rb#141 + def org_repositories(org, options = T.unsafe(nil)); end + + # List teams + # + # Requires authenticated organization member. + # + # @example + # @client.organization_teams('github') + # @example + # @client.org_teams('github') + # @param org [String, Integer] Organization GitHub login or id. + # @return [Array] Array of hashes representing teams. + # @see https://developer.github.com/v3/orgs/teams/#list-teams + # + # source://octokit//lib/octokit/client/organizations.rb#299 + def org_teams(org, options = T.unsafe(nil)); end + + # Get an organization + # + # @example + # Octokit.organization('github') + # @example + # Octokit.org('github') + # @param org [String, Integer] Organization GitHub login or id. + # @return [Sawyer::Resource] Hash representing GitHub organization. + # @see https://developer.github.com/v3/orgs/#get-an-organization + # + # source://octokit//lib/octokit/client/organizations.rb#18 + def organization(org, options = T.unsafe(nil)); end + + # Get organization audit log. + # + # Gets the audit log for an organization. + # + # To list oldest events first, specify asc. + # + # @example + # Octokit.organization_audit_log('github', {include: 'all', phrase: 'action:org.add_member created:>2022-08-29 user:octocat'}) + # @option options + # @option options + # @option options + # @param org [String, Integer] Organization GitHub login or id for which + # to retrieve the audit log. + # @param options [Hash] a customizable set of options + # @return [Array] List of events + # @see https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/orgs#get-the-audit-log-for-an-organization + # + # source://octokit//lib/octokit/client/organizations.rb#859 + def organization_audit_log(org, options = T.unsafe(nil)); end + + # List pending organization invitations + # + # Requires authenticated organization member. + # + # @example + # @client.organization_invitations('github') + # @param org [String, Integer] Organization GitHub login or id. + # @return [Array] Array of hashes representing invitations. + # @see https://developer.github.com/v3/orgs/members/#list-pending-organization-invitations + # + # source://octokit//lib/octokit/client/organizations.rb#239 + def organization_invitations(org, options = T.unsafe(nil)); end + + # Check if a user is a member of an organization. + # + # Use this to check if another user is a member of an organization that + # you are a member. If you are not in the organization you are checking, + # use .organization_public_member? instead. + # + # @example Check if a user is in your organization + # @client.organization_member?('your_organization', 'pengwynn') + # => false + # @param org [String, Integer] Organization GitHub login or id. + # @param user [String] GitHub username of the user to check. + # @return [Boolean] Is a member? + # @see https://developer.github.com/v3/orgs/members/#check-membership + # + # source://octokit//lib/octokit/client/organizations.rb#199 + def organization_member?(org, user, options = T.unsafe(nil)); end + + # Get organization members + # + # Public members of the organization are returned by default. An + # authenticated client that is a member of the GitHub organization + # is required to get private members. + # + # @example + # Octokit.organization_members('github') + # @example + # Octokit.org_members('github') + # @param org [String, Integer] Organization GitHub login or id. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/orgs/members/#members-list + # + # source://octokit//lib/octokit/client/organizations.rb#160 + def organization_members(org, options = T.unsafe(nil)); end + + # Get an organization membership + # + # @option options + # @param org [Integer, String] The GitHub Organization. + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Hash representing the organization membership. + # @see https://developer.github.com/v3/orgs/members/#get-your-organization-membership + # @see https://developer.github.com/v3/orgs/members/#get-organization-membership + # + # source://octokit//lib/octokit/client/organizations.rb#711 + def organization_membership(org, options = T.unsafe(nil)); end + + # List all organizations memberships for the authenticated user + # + # @return [Array] Array of organizations memberships. + # @see https://developer.github.com/v3/orgs/members/#list-your-organization-memberships + # + # source://octokit//lib/octokit/client/organizations.rb#699 + def organization_memberships(options = T.unsafe(nil)); end + + # Check if a user is a public member of an organization. + # + # If you are checking for membership of a user of an organization that + # you are in, use .organization_member? instead. + # + # @example Check if a user is a hubbernaut + # @client.organization_public_member?('github', 'pengwynn') + # => true + # @param org [String, Integer] Organization GitHub login or id. + # @param user [String] GitHub username of the user to check. + # @return [Boolean] Is a public member? + # @see https://developer.github.com/v3/orgs/members/#check-public-membership + # + # source://octokit//lib/octokit/client/organizations.rb#224 + def organization_public_member?(org, user, options = T.unsafe(nil)); end + + # Get organization public members + # + # Lists the public members of an organization + # + # @example + # Octokit.organization_public_members('github') + # @example + # Octokit.org_public_members('github') + # @param org [String] Organization GitHub username. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/orgs/members/#public-members-list + # + # source://octokit//lib/octokit/client/organizations.rb#178 + def organization_public_members(org, options = T.unsafe(nil)); end + + # List organization repositories + # + # Public repositories are available without authentication. Private repos + # require authenticated organization member. + # + # @example + # Octokit.organization_repositories('github') + # @example + # Octokit.org_repositories('github') + # @example + # Octokit.org_repos('github') + # @example + # @client.org_repos('github', {:type => 'private'}) + # @option options + # @param org [String, Integer] Organization GitHub login or id for which + # to list repos. + # @param options [Hash] a customizable set of options + # @return [Array] List of repositories + # @see https://developer.github.com/v3/repos/#list-organization-repositories + # + # source://octokit//lib/octokit/client/organizations.rb#141 + def organization_repositories(org, options = T.unsafe(nil)); end + + # List teams + # + # Requires authenticated organization member. + # + # @example + # @client.organization_teams('github') + # @example + # @client.org_teams('github') + # @param org [String, Integer] Organization GitHub login or id. + # @return [Array] Array of hashes representing teams. + # @see https://developer.github.com/v3/orgs/teams/#list-teams + # + # source://octokit//lib/octokit/client/organizations.rb#299 + def organization_teams(org, options = T.unsafe(nil)); end + + # Get organizations for a user. + # + # Nonauthenticated calls to this method will return organizations that + # the user is a public member. + # + # Use an authenticated client to get both public and private organizations + # for a user. + # + # Calling this method on a `@client` will return that users organizations. + # Private organizations are included only if the `@client` is authenticated. + # + # @example + # Octokit.organizations('pengwynn') + # @example + # @client.organizations('pengwynn') + # @example + # Octokit.orgs('pengwynn') + # @example + # Octokit.list_organizations('pengwynn') + # @example + # Octokit.list_orgs('pengwynn') + # @example + # @client.organizations + # @param user [Integer, String] GitHub user login or id of the user to get + # list of organizations. + # @return [Array] Array of hashes representing organizations. + # @see https://developer.github.com/v3/orgs/#list-your-organizations + # @see https://developer.github.com/v3/orgs/#list-user-organizations + # + # source://octokit//lib/octokit/client/organizations.rb#97 + def organizations(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # Get organizations for a user. + # + # Nonauthenticated calls to this method will return organizations that + # the user is a public member. + # + # Use an authenticated client to get both public and private organizations + # for a user. + # + # Calling this method on a `@client` will return that users organizations. + # Private organizations are included only if the `@client` is authenticated. + # + # @example + # Octokit.organizations('pengwynn') + # @example + # @client.organizations('pengwynn') + # @example + # Octokit.orgs('pengwynn') + # @example + # Octokit.list_organizations('pengwynn') + # @example + # Octokit.list_orgs('pengwynn') + # @example + # @client.organizations + # @param user [Integer, String] GitHub user login or id of the user to get + # list of organizations. + # @return [Array] Array of hashes representing organizations. + # @see https://developer.github.com/v3/orgs/#list-your-organizations + # @see https://developer.github.com/v3/orgs/#list-user-organizations + # + # source://octokit//lib/octokit/client/organizations.rb#97 + def orgs(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # List outside collaborators for an organization + # + # Requires authenticated organization members. + # + # @example + # @client.outside_collaborators('github') + # @param org [String, Integer] Organization GitHub login or id. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/orgs/outside_collaborators/#list-outside-collaborators + # + # source://octokit//lib/octokit/client/organizations.rb#254 + def outside_collaborators(org, options = T.unsafe(nil)); end + + # Publicize a user's membership of an organization + # + # Requires authenticated organization owner. + # + # @example + # @client.publicize_membership('github', 'pengwynn') + # @param org [String, Integer] Organization GitHub login or id. + # @param user [String] GitHub username of user to publicize. + # @return [Boolean] True if publicization successful, false otherwise. + # @see https://developer.github.com/v3/orgs/members/#publicize-a-users-membership + # + # source://octokit//lib/octokit/client/organizations.rb#624 + def publicize_membership(org, user, options = T.unsafe(nil)); end + + # Remove organization member + # + # Requires authenticated organization owner or member with team `admin` access. + # + # @example + # @client.remove_organization_member('github', 'pengwynn') + # @example + # @client.remove_org_member('github', 'pengwynn') + # @param org [String, Integer] Organization GitHub login or id. + # @param user [String] GitHub username of user to remove. + # @return [Boolean] True if removal is successful, false otherwise. + # @see https://developer.github.com/v3/orgs/members/#remove-a-member + # + # source://octokit//lib/octokit/client/organizations.rb#607 + def remove_org_member(org, user, options = T.unsafe(nil)); end + + # Remove an organization membership + # + # @param org [String, Integer] Organization GitHub login or id. + # @return [Boolean] Success + # @see https://developer.github.com/v3/orgs/members/#remove-organization-membership + # + # source://octokit//lib/octokit/client/organizations.rb#747 + def remove_org_membership(org, options = T.unsafe(nil)); end + + # Remove organization member + # + # Requires authenticated organization owner or member with team `admin` access. + # + # @example + # @client.remove_organization_member('github', 'pengwynn') + # @example + # @client.remove_org_member('github', 'pengwynn') + # @param org [String, Integer] Organization GitHub login or id. + # @param user [String] GitHub username of user to remove. + # @return [Boolean] True if removal is successful, false otherwise. + # @see https://developer.github.com/v3/orgs/members/#remove-a-member + # + # source://octokit//lib/octokit/client/organizations.rb#607 + def remove_organization_member(org, user, options = T.unsafe(nil)); end + + # Remove an organization membership + # + # @param org [String, Integer] Organization GitHub login or id. + # @return [Boolean] Success + # @see https://developer.github.com/v3/orgs/members/#remove-organization-membership + # + # source://octokit//lib/octokit/client/organizations.rb#747 + def remove_organization_membership(org, options = T.unsafe(nil)); end + + # Remove outside collaborator from an organization + # + # Requires authenticated organization members. + # + # @example + # @client.remove_outside_collaborator('github', 'lizzhale') + # @param org [String, Integer] Organization GitHub login or id. + # @param user [String] GitHub username to be removed as outside collaborator + # @return [Boolean] Return true if outside collaborator removed from organization, false otherwise. + # @see https://developer.github.com/v3/orgs/outside-collaborators/#remove-outside-collaborator + # + # source://octokit//lib/octokit/client/organizations.rb#269 + def remove_outside_collaborator(org, user, options = T.unsafe(nil)); end + + # Remove team member + # + # Requires authenticated organization owner or member with team + # `admin` permission. + # + # @example + # @client.remove_team_member(100000, 'pengwynn') + # @param team_id [Integer] Team id. + # @param user [String] GitHub username of the user to boot. + # @return [Boolean] True if user removed, false otherwise. + # @see https://developer.github.com/v3/orgs/teams/#remove-team-member + # + # source://octokit//lib/octokit/client/organizations.rb#476 + def remove_team_member(team_id, user, options = T.unsafe(nil)); end + + # Remove team membership + # + # @example + # @client.remove_team_membership(100000, 'pengwynn') + # @param team_id [Integer] Team id. + # @param user [String] GitHub username of the user to boot. + # @return [Boolean] True if user removed, false otherwise. + # @see https://developer.github.com/v3/orgs/teams/#remove-team-membership + # + # source://octokit//lib/octokit/client/organizations.rb#691 + def remove_team_membership(team_id, user, options = T.unsafe(nil)); end + + # Remove team repository + # + # Removes repository from team. Does not delete the repository. + # + # Requires authenticated organization owner. + # + # @example + # @client.remove_team_repository(100000, 'github/developer.github.com') + # @example + # @client.remove_team_repo(100000, 'github/developer.github.com') + # @param team_id [Integer] Team id. + # @param repo [String, Hash, Repository] A GitHub repository. + # @return [Boolean] Return true if repo removed from team, false otherwise. + # @see Octokit::Repository + # @see https://developer.github.com/v3/orgs/teams/#remove-team-repository + # + # source://octokit//lib/octokit/client/organizations.rb#590 + def remove_team_repo(team_id, repo, _options = T.unsafe(nil)); end + + # Remove team repository + # + # Removes repository from team. Does not delete the repository. + # + # Requires authenticated organization owner. + # + # @example + # @client.remove_team_repository(100000, 'github/developer.github.com') + # @example + # @client.remove_team_repo(100000, 'github/developer.github.com') + # @param team_id [Integer] Team id. + # @param repo [String, Hash, Repository] A GitHub repository. + # @return [Boolean] Return true if repo removed from team, false otherwise. + # @see Octokit::Repository + # @see https://developer.github.com/v3/orgs/teams/#remove-team-repository + # + # source://octokit//lib/octokit/client/organizations.rb#590 + def remove_team_repository(team_id, repo, _options = T.unsafe(nil)); end + + # Initiates the generation of a migration archive. + # + # Requires authenticated organization owner. + # + # @example + # @client.start_migration('github', ['github/dotfiles']) + # @option options + # @param org [String, Integer] Organization GitHub login or id. + # @param repositories [Array] :repositories Repositories for the organization. + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Hash representing the new migration. + # @see https://docs.github.com/en/rest/reference/migrations#start-an-organization-migration + # + # source://octokit//lib/octokit/client/organizations.rb#765 + def start_migration(org, repositories, options = T.unsafe(nil)); end + + # Get team + # + # Requires authenticated organization member. + # + # @example + # @client.team(100000) + # @param team_id [Integer] Team id. + # @return [Sawyer::Resource] Hash representing team. + # @see https://developer.github.com/v3/orgs/teams/#get-team + # + # source://octokit//lib/octokit/client/organizations.rb#336 + def team(team_id, options = T.unsafe(nil)); end + + # Get team by name and org + # + # Requires authenticated organization member. + # + # @example + # @client.team_by_name("github", "justice-league") + # @param org [String, Integer] Organization GitHub login or id. + # @param team_slug [String] Team slug. + # @return [Sawyer::Resource] Hash representing team. + # @see https://developer.github.com/v3/teams/#get-team-by-name + # + # source://octokit//lib/octokit/client/organizations.rb#350 + def team_by_name(org, team_slug, options = T.unsafe(nil)); end + + # List pending team invitations + # + # Requires authenticated organization member. + # + # @example + # @client.team_invitations('github') + # @param team_id [Integer] Team id. + # @return [Array] Array of hashes representing invitations. + # @see https://developer.github.com/v3/orgs/teams/#list-pending-team-invitations + # + # source://octokit//lib/octokit/client/organizations.rb#509 + def team_invitations(team_id, options = T.unsafe(nil)); end + + # Check if a user is a member of a team. + # + # Use this to check if another user is a member of a team that + # you are a member. + # + # @example Check if a user is in your team + # @client.team_member?(100000, 'pengwynn') + # => false + # @param team_id [Integer] Team id. + # @param user [String] GitHub username of the user to check. + # @return [Boolean] Is a member? + # @see https://developer.github.com/v3/orgs/teams/#get-team-member + # + # source://octokit//lib/octokit/client/organizations.rb#495 + def team_member?(team_id, user, options = T.unsafe(nil)); end + + # List team members + # + # Requires authenticated organization member. + # + # @example + # @client.team_members(100000) + # @param team_id [Integer] Team id. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/orgs/teams/#list-team-members + # + # source://octokit//lib/octokit/client/organizations.rb#433 + def team_members(team_id, options = T.unsafe(nil)); end + + # Check if a user has a team membership. + # + # @example Check if a user has a membership for a team + # @client.team_membership(1234, 'pengwynn') + # @param team_id [Integer] Team id. + # @param user [String] GitHub username of the user to check. + # @return [Sawyer::Resource] Hash of team membership info + # @see https://developer.github.com/v3/orgs/teams/#get-team-membership + # + # source://octokit//lib/octokit/client/organizations.rb#664 + def team_membership(team_id, user, options = T.unsafe(nil)); end + + # Check team permissions for a repository + # + # Requires authenticated organization member. + # + # @example + # # Check whether the team has any permissions with the repository + # @client.team_permissions_for_repo("github", "justice-league", "octocat", "hello-world") + # @example + # # Get the full repository object including the permissions level and role for the team + # @client.team_permissions_for_repo("github", "justice-league", "octocat", "hello-world", :accept => 'application/vnd.github.v3.repository+json') + # @param team_slug_or_id [String, Integer] Team slug or Team ID. + # @param repo [String] Name of the repo to check permissions against. + # @param owner [String] Owner name for the repository. + # @param org [String, Integer] Organization GitHub login or id. + # @return [String, Sawyer::Resource] Depending on options it may be an empty string or a resource. + # @see https://docs.github.com/en/rest/teams/teams#check-team-permissions-for-a-repository + # + # source://octokit//lib/octokit/client/organizations.rb#371 + def team_permissions_for_repo(org, team_slug_or_id, owner, repo, options = T.unsafe(nil)); end + + # Check if a repo is managed by a specific team + # + # @example + # @client.team_repository?(8675309, 'octokit/octokit.rb') + # @example + # @client.team_repo?(8675309, 'octokit/octokit.rb') + # @param team_id [Integer] Team ID. + # @param repo [String, Hash, Repository] A GitHub repository. + # @return [Boolean] True if managed by a team. False if not managed by + # the team OR the requesting user does not have authorization to access + # the team information. + # @see https://developer.github.com/v3/orgs/teams/#check-if-a-team-manages-a-repository + # + # source://octokit//lib/octokit/client/organizations.rb#541 + def team_repo?(team_id, repo, _options = T.unsafe(nil)); end + + # List team repositories + # + # Requires authenticated organization member. + # + # @example + # @client.team_repositories(100000) + # @example + # @client.team_repos(100000) + # @param team_id [Integer] Team id. + # @return [Array] Array of hashes representing repositories. + # @see https://developer.github.com/v3/orgs/teams/#list-team-repos + # + # source://octokit//lib/octokit/client/organizations.rb#524 + def team_repos(team_id, options = T.unsafe(nil)); end + + # List team repositories + # + # Requires authenticated organization member. + # + # @example + # @client.team_repositories(100000) + # @example + # @client.team_repos(100000) + # @param team_id [Integer] Team id. + # @return [Array] Array of hashes representing repositories. + # @see https://developer.github.com/v3/orgs/teams/#list-team-repos + # + # source://octokit//lib/octokit/client/organizations.rb#524 + def team_repositories(team_id, options = T.unsafe(nil)); end + + # Check if a repo is managed by a specific team + # + # @example + # @client.team_repository?(8675309, 'octokit/octokit.rb') + # @example + # @client.team_repo?(8675309, 'octokit/octokit.rb') + # @param team_id [Integer] Team ID. + # @param repo [String, Hash, Repository] A GitHub repository. + # @return [Boolean] True if managed by a team. False if not managed by + # the team OR the requesting user does not have authorization to access + # the team information. + # @see https://developer.github.com/v3/orgs/teams/#check-if-a-team-manages-a-repository + # + # source://octokit//lib/octokit/client/organizations.rb#541 + def team_repository?(team_id, repo, _options = T.unsafe(nil)); end + + # Unlock a previous migration archive. + # + # Requires authenticated organization owner. + # + # @param org [String, Integer] Organization GitHub login or id. + # @param id [Integer] ID number of the migration. + # @param repo [String] Name of the repository. + # @see https://docs.github.com/en/rest/reference/migrations#unlock-an-organization-repository + # + # source://octokit//lib/octokit/client/organizations.rb#825 + def unlock_repository(org, id, repo, options = T.unsafe(nil)); end + + # Conceal a user's membership of an organization. + # + # Requires authenticated organization owner. + # + # @example + # @client.unpublicize_membership('github', 'pengwynn') + # @example + # @client.conceal_membership('github', 'pengwynn') + # @param org [String, Integer] Organization GitHub login or id. + # @param user [String] GitHub username of user to unpublicize. + # @return [Boolean] True of unpublicization successful, false otherwise. + # @see https://developer.github.com/v3/orgs/members/#conceal-a-users-membership + # + # source://octokit//lib/octokit/client/organizations.rb#640 + def unpublicize_membership(org, user, options = T.unsafe(nil)); end + + # Update an organization. + # + # Requires authenticated client with proper organization permissions. + # + # @example + # @client.update_org('github', {:company => 'Unicorns, Inc.'}) + # @example + # @client.update_organization('github', { + # :billing_email => 'support@github.com', + # :company => 'GitHub', + # :email => 'support@github.com', + # :location => 'San Francisco', + # :name => 'github' + # }) + # @option values + # @option values + # @option values + # @option values + # @option values + # @option values + # @option values + # @param org [String, Integer] Organization GitHub login or id. + # @param values [Hash] The updated organization attributes. + # @return [Sawyer::Resource] Hash representing GitHub organization. + # @see https://developer.github.com/v3/orgs/#edit-an-organization + # + # source://octokit//lib/octokit/client/organizations.rb#48 + def update_org(org, values, options = T.unsafe(nil)); end + + # Edit an organization membership + # + # @option options + # @option options + # @option options + # @param options [Hash] a customizable set of options + # @param org [String, Integer] Organization GitHub login or id. + # @return [Sawyer::Resource] Hash representing the updated organization membership. + # @see https://developer.github.com/v3/orgs/members/#edit-your-organization-membership + # @see https://developer.github.com/v3/orgs/members/#add-or-update-organization-membership + # + # source://octokit//lib/octokit/client/organizations.rb#730 + def update_org_membership(org, options = T.unsafe(nil)); end + + # Update an organization. + # + # Requires authenticated client with proper organization permissions. + # + # @example + # @client.update_org('github', {:company => 'Unicorns, Inc.'}) + # @example + # @client.update_organization('github', { + # :billing_email => 'support@github.com', + # :company => 'GitHub', + # :email => 'support@github.com', + # :location => 'San Francisco', + # :name => 'github' + # }) + # @option values + # @option values + # @option values + # @option values + # @option values + # @option values + # @option values + # @param org [String, Integer] Organization GitHub login or id. + # @param values [Hash] The updated organization attributes. + # @return [Sawyer::Resource] Hash representing GitHub organization. + # @see https://developer.github.com/v3/orgs/#edit-an-organization + # + # source://octokit//lib/octokit/client/organizations.rb#48 + def update_organization(org, values, options = T.unsafe(nil)); end + + # Edit an organization membership + # + # @option options + # @option options + # @option options + # @param options [Hash] a customizable set of options + # @param org [String, Integer] Organization GitHub login or id. + # @return [Sawyer::Resource] Hash representing the updated organization membership. + # @see https://developer.github.com/v3/orgs/members/#edit-your-organization-membership + # @see https://developer.github.com/v3/orgs/members/#add-or-update-organization-membership + # + # source://octokit//lib/octokit/client/organizations.rb#730 + def update_organization_membership(org, options = T.unsafe(nil)); end + + # Update team + # + # Requires authenticated organization owner. + # + # @example + # @client.update_team(100000, { + # :name => 'Front-end Designers', + # :permission => 'push' + # }) + # @option options + # @option options + # @option options + # @param team_id [Integer] Team id. + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Hash representing updated team. + # @see https://developer.github.com/v3/orgs/teams/#edit-team + # + # source://octokit//lib/octokit/client/organizations.rb#407 + def update_team(team_id, options = T.unsafe(nil)); end + + # List all teams for the authenticated user across all their orgs + # + # @return [Array] Array of team resources. + # @see https://developer.github.com/v3/orgs/teams/#list-user-teams + # + # source://octokit//lib/octokit/client/organizations.rb#649 + def user_teams(options = T.unsafe(nil)); end +end + +# Methods for the Pages API +# +# @see https://developer.github.com/v3/repos/pages/ +# +# source://octokit//lib/octokit/client/pages.rb#8 +module Octokit::Client::Pages + # List the latest Pages build information for a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return Sawyer::Resource A GitHub Pages resource about a build + # @see https://developer.github.com/v3/repos/pages/#list-latest-pages-build + # + # source://octokit//lib/octokit/client/pages.rb#45 + def latest_pages_build(repo, options = T.unsafe(nil)); end + + # List Pages builds for a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] A list of build history for a repository. + # @see https://developer.github.com/v3/repos/pages/#list-pages-builds + # + # source://octokit//lib/octokit/client/pages.rb#35 + def list_pages_builds(repo, options = T.unsafe(nil)); end + + # List Pages information for a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return Sawyer::Resource A GitHub Pages resource + # @see https://developer.github.com/v3/repos/pages/#get-information-about-a-pages-site + # + # source://octokit//lib/octokit/client/pages.rb#14 + def pages(repo, options = T.unsafe(nil)); end + + # Get a specific Pages build by ID + # + # @example + # Octokit.pages_build("github/developer.github.com", 5472601) + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param id [Integer, String] Build ID + # @return [Sawyer::Resource] Pages build information + # @see https://developer.github.com/v3/repos/pages/#list-a-specific-pages-build + # + # source://octokit//lib/octokit/client/pages.rb#26 + def pages_build(repo, id, options = T.unsafe(nil)); end + + # List Pages builds for a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] A list of build history for a repository. + # @see https://developer.github.com/v3/repos/pages/#list-pages-builds + # + # source://octokit//lib/octokit/client/pages.rb#35 + def pages_builds(repo, options = T.unsafe(nil)); end + + # Request a page build for the latest revision of the default branch + # + # You can only request builds for your repositories + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Sawyer::Resource] Request result + # @see https://developer.github.com/v3/repos/pages/#request-a-page-build + # + # source://octokit//lib/octokit/client/pages.rb#56 + def request_page_build(repo, options = T.unsafe(nil)); end +end + +# Methods for Projects API +# +# @see https://docs.github.com/en/rest/projects +# +# source://octokit//lib/octokit/client/projects.rb#8 +module Octokit::Client::Projects + # List columns cards + # + # Requires authenticated client + # + # @example + # @client.column_cards(30294) + # @param id [Integer] Project column id + # @return [Array] Cards in the column + # @see https://developer.github.com/v3/projects/cards/#list-project-cards + # + # source://octokit//lib/octokit/client/projects.rb#204 + def column_cards(id, options = T.unsafe(nil)); end + + # Create organization project + # + # Requires authenticated client + # + # @example Create a project with name and body + # @client.create_org_project("octokit", "octocan", body: 'Improve clients') + # @example Create with only a name + # @client.create_org_project("octocat", "make more octocats") + # @option options + # @param name [String] Project name + # @param org [String] A GitHub organization + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Organization project + # @see https://developer.github.com/v3/projects/#create-an-organization-project + # + # source://octokit//lib/octokit/client/projects.rb#68 + def create_org_project(org, name, options = T.unsafe(nil)); end + + # Create organization project + # + # Requires authenticated client + # + # @example Create a project with name and body + # @client.create_org_project("octokit", "octocan", body: 'Improve clients') + # @example Create with only a name + # @client.create_org_project("octocat", "make more octocats") + # @option options + # @param name [String] Project name + # @param org [String] A GitHub organization + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Organization project + # @see https://developer.github.com/v3/projects/#create-an-organization-project + # + # source://octokit//lib/octokit/client/projects.rb#68 + def create_organization_project(org, name, options = T.unsafe(nil)); end + + # Create a project + # + # Requires authenticated client + # + # @example Create project with name and body + # @client.create_project('octokit/octokit.rb', 'bugs be gone', body: 'Fix all the bugs @joeyw creates') + # @example Create project with only a name + # @client.create_project('octokit/octokit.rb', 'implement new APIs') + # @option options + # @param name [String] Project name + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Fresh new project + # @see https://developer.github.com/v3/projects/#create-a-repository-project + # + # source://octokit//lib/octokit/client/projects.rb#36 + def create_project(repo, name, options = T.unsafe(nil)); end + + # Create project card + # + # Requires authenticated client + # + # @example Create a project card for an repository issue + # @client.create_project_card(123495, content_id: 1, content_type: 'Issue') + # @example Create a project card with a note + # @client.create_project_card(123495, note: 'New note card') + # @note If :note is supplied, :content_id and :content_type must be + # excluded. Similarly, if :content_id is supplied, :content_type must + # be set and :note must not be included. + # @option options + # @option options + # @option options + # @param id [Integer] Project column id + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Newly created card + # @see https://developer.github.com/v3/projects/cards/#create-a-project-card + # + # source://octokit//lib/octokit/client/projects.rb#226 + def create_project_card(id, options = T.unsafe(nil)); end + + # Create a project column + # + # Requires authenticated client + # + # @example + # @client.create_project_column(123942, "To Dones") + # @param id [Integer] Project column id + # @param name [String] New column name + # @return [Sawyer::Resource] Newly created column + # @see https://developer.github.com/v3/projects/columns/#create-a-project-column + # + # source://octokit//lib/octokit/client/projects.rb#134 + def create_project_column(id, name, options = T.unsafe(nil)); end + + # Delete a project + # + # Requires authenticated client + # + # @example + # @client.delete_project(123942) + # @param id [Integer] Project id + # @return [Boolean] Result of deletion + # @see https://developer.github.com/v3/projects/#delete-a-project + # + # source://octokit//lib/octokit/client/projects.rb#109 + def delete_project(id, options = T.unsafe(nil)); end + + # Delete a project card + # + # Requires authenticated client + # + # @example + # @client.delete_project_card(123495) + # @param id [Integer] Project card id + # @return [Boolean] True of deleted, false otherwise + # @see https://developer.github.com/v3/projects/cards/#delete-a-project-card + # + # source://octokit//lib/octokit/client/projects.rb#289 + def delete_project_card(id, options = T.unsafe(nil)); end + + # Delete a project column + # + # Requires authenticated client + # + # @example + # @client.delete_project_column(30294) + # @param id [Integer] Project column id + # @return [Boolean] Result of deletion request, true when deleted + # @see https://developer.github.com/v3/projects/columns/#delete-a-project-column + # + # source://octokit//lib/octokit/client/projects.rb#174 + def delete_project_column(id, options = T.unsafe(nil)); end + + # Move a project card + # + # Requires authenticated client + # + # @example Move a card to the top of another column + # @client.move_project_card(123495, 'top', column_id: 59402) + # @example Move a card to the bottom of the same column + # @client.move_project_card(123495, 'bottom') + # @option options + # @param position [String] Can be one of top, bottom, + # or after:, where is the id value of a + # card in the same column, or in the new column specified by column_id. + # @param id [Integer] Project card id + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Empty sawyer resource + # @see https://developer.github.com/v3/projects/cards/#move-a-project-card + # + # source://octokit//lib/octokit/client/projects.rb#275 + def move_project_card(id, position, options = T.unsafe(nil)); end + + # Move a project column + # + # Requires authenticated client + # + # @example + # @client.move_project_column(30294, "last") + # @param id [Integer] Project column id + # @param position [String] New position for the column. Can be one of + # first, last, or after:, where + # is the id value of a column in the same project. + # @return [Sawyer::Resource] Result + # @see https://developer.github.com/v3/projects/columns/#move-a-project-column + # + # source://octokit//lib/octokit/client/projects.rb#190 + def move_project_column(id, position, options = T.unsafe(nil)); end + + # List organization projects + # + # Requires authenticated client + # + # @example + # @client.org_projects("octokit") + # @param org [String] A GitHub organization + # @return [Array] Organization projects + # @see https://developer.github.com/v3/projects/#list-organization-projects + # + # source://octokit//lib/octokit/client/projects.rb#50 + def org_projects(org, options = T.unsafe(nil)); end + + # List organization projects + # + # Requires authenticated client + # + # @example + # @client.org_projects("octokit") + # @param org [String] A GitHub organization + # @return [Array] Organization projects + # @see https://developer.github.com/v3/projects/#list-organization-projects + # + # source://octokit//lib/octokit/client/projects.rb#50 + def organization_projects(org, options = T.unsafe(nil)); end + + # Get a project by id + # + # @example + # Octokit.project(123942) + # @param id [Integer] Project id + # @return [Sawyer::Resource] Project + # @see https://developer.github.com/v3/projects/#get-a-project + # + # source://octokit//lib/octokit/client/projects.rb#81 + def project(id, options = T.unsafe(nil)); end + + # Get a project card + # + # Requires authenticated client + # + # @example + # @client.project_card(123495) + # @param id [Integer] Project card id + # @return [Sawyer::Resource] Project card + # @see https://developer.github.com/v3/projects/cards/#get-a-project-card + # + # source://octokit//lib/octokit/client/projects.rb#239 + def project_card(id, options = T.unsafe(nil)); end + + # Get a project column by ID + # + # @example + # Octokit.project_column(30294) + # @param id [Integer] Project column id + # @return [Sawyer::Resource] Project column + # @see https://developer.github.com/v3/projects/columns/#get-a-project-column + # + # source://octokit//lib/octokit/client/projects.rb#146 + def project_column(id, options = T.unsafe(nil)); end + + # List project columns + # + # @example + # @client.project_columns(123942) + # @param id [Integer] Project id + # @return [Array] List of project columns + # @see https://developer.github.com/v3/projects/columns/#list-project-columns + # + # source://octokit//lib/octokit/client/projects.rb#120 + def project_columns(id, options = T.unsafe(nil)); end + + # List projects for a repository + # + # Requires authenticated client + # + # @example + # @client.projects('octokit/octokit.rb') + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] Repository projects + # @see https://developer.github.com/v3/projects/#list-repository-projects + # + # source://octokit//lib/octokit/client/projects.rb#18 + def projects(repo, options = T.unsafe(nil)); end + + # Update a project + # + # Requires authenticated client + # + # @example Update project name + # @client.update_project(123942, name: 'New name') + # @option options + # @option options + # @param id [Integer] Project id + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Project + # @see https://developer.github.com/v3/projects/#update-a-project + # + # source://octokit//lib/octokit/client/projects.rb#96 + def update_project(id, options = T.unsafe(nil)); end + + # Update a project card + # + # Requires authenticated client + # + # @example + # @client.update_project_card(12345, note: 'new note') + # @option options + # @param id [Integer] Project card id + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Updated project card + # @see https://developer.github.com/v3/projects/cards/#update-a-project-card + # + # source://octokit//lib/octokit/client/projects.rb#255 + def update_project_card(id, options = T.unsafe(nil)); end + + # Update a project column + # + # Requires authenticated client + # + # @example + # @client.update_project_column(30294, "new column name") + # @param id [Integer] Project column id + # @param name [String] New column name + # @return [Sawyer::Resource] Updated column + # @see https://developer.github.com/v3/projects/columns/#update-a-project-column + # + # source://octokit//lib/octokit/client/projects.rb#160 + def update_project_column(id, name, options = T.unsafe(nil)); end +end + +# Methods for the Pull Requests API +# +# @see https://developer.github.com/v3/pulls/ +# +# source://octokit//lib/octokit/client/pull_requests.rb#8 +module Octokit::Client::PullRequests + # Close a pull request + # + # @example + # @client.close_pull_request('octokit/octokit.rb', 67) + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param number [Integer] Number of pull request to update. + # @return [Sawyer::Resource] Hash representing updated pull request. + # @see https://developer.github.com/v3/pulls/#update-a-pull-request + # + # source://octokit//lib/octokit/client/pull_requests.rb#119 + def close_pull_request(repo, number, options = T.unsafe(nil)); end + + # Create a pull request comment + # + # @deprecated The position will be deprecated in the next major version. Please refer to the details below. + # @example + # @client.create_pull_request_comment("octokit/octokit.rb", 163, ":shipit:", + # "2d3201e4440903d8b04a5487842053ca4883e5f0", "lib/octokit/request.rb", 47) + # @param pull_id [Integer] Pull request id + # @param body [String] Comment content + # @param path [String] Relative path of the file to comment on. + # @param line [Integer] Line index in the diff to comment on. + # For a multi-line comment, the last line of the range + # and specify 'start_line' in the 'options'. + # @param commit_id [String] Sha of the commit to comment on. + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Sawyer::Resource] Hash representing the new comment + # @see https://developer.github.com/v3/pulls/comments/#create-a-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#209 + def create_pull_comment(repo, pull_id, body, commit_id, path, line, options = T.unsafe(nil)); end + + # Create reply to a pull request comment + # + # @example + # @client.create_pull_request_comment_reply("octokit/octokit.rb", 163, "done.", 1903950) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param pull_id [Integer] Pull request id + # @param body [String] Comment contents + # @param comment_id [Integer] Comment id to reply to + # @return [Sawyer::Resource] Hash representing new comment + # @see https://developer.github.com/v3/pulls/comments/#create-a-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#231 + def create_pull_reply(repo, pull_id, body, comment_id, options = T.unsafe(nil)); end + + # Create a pull request + # + # @example + # @client.create_pull_request("octokit/octokit.rb", "master", "feature-branch", + # "Pull Request title", "Pull Request body") + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param base [String] The branch (or git ref) you want your changes + # pulled into. This should be an existing branch on the current + # repository. You cannot submit a pull request to one repo that requests + # a merge to a base of another repo. + # @param head [String] The branch (or git ref) where your changes are implemented. + # @param body [String] The body for the pull request (optional). Supports GFM. + # @param title [String] Title for the pull request + # @return [Sawyer::Resource] The newly created pull request + # @see https://developer.github.com/v3/pulls/#create-a-pull-request + # + # source://octokit//lib/octokit/client/pull_requests.rb#52 + def create_pull_request(repo, base, head, title, body = T.unsafe(nil), options = T.unsafe(nil)); end + + # Create a pull request comment + # + # @deprecated The position will be deprecated in the next major version. Please refer to the details below. + # @example + # @client.create_pull_request_comment("octokit/octokit.rb", 163, ":shipit:", + # "2d3201e4440903d8b04a5487842053ca4883e5f0", "lib/octokit/request.rb", 47) + # @param pull_id [Integer] Pull request id + # @param body [String] Comment content + # @param path [String] Relative path of the file to comment on. + # @param line [Integer] Line index in the diff to comment on. + # For a multi-line comment, the last line of the range + # and specify 'start_line' in the 'options'. + # @param commit_id [String] Sha of the commit to comment on. + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Sawyer::Resource] Hash representing the new comment + # @see https://developer.github.com/v3/pulls/comments/#create-a-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#209 + def create_pull_request_comment(repo, pull_id, body, commit_id, path, line, options = T.unsafe(nil)); end + + # Create reply to a pull request comment + # + # @example + # @client.create_pull_request_comment_reply("octokit/octokit.rb", 163, "done.", 1903950) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param pull_id [Integer] Pull request id + # @param body [String] Comment contents + # @param comment_id [Integer] Comment id to reply to + # @return [Sawyer::Resource] Hash representing new comment + # @see https://developer.github.com/v3/pulls/comments/#create-a-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#231 + def create_pull_request_comment_reply(repo, pull_id, body, comment_id, options = T.unsafe(nil)); end + + # Create a pull request from existing issue + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param base [String] The branch (or git ref) you want your changes + # pulled into. This should be an existing branch on the current + # repository. You cannot submit a pull request to one repo that requests + # a merge to a base of another repo. + # @param head [String] The branch (or git ref) where your changes are implemented. + # @param issue [Integer] Number of Issue on which to base this pull request + # @return [Sawyer::Resource] The newly created pull request + # @see https://developer.github.com/v3/pulls/#alternative-input + # + # source://octokit//lib/octokit/client/pull_requests.rb#73 + def create_pull_request_for_issue(repo, base, head, issue, options = T.unsafe(nil)); end + + # Create reply to a pull request comment + # + # @example + # @client.create_pull_request_comment_reply("octokit/octokit.rb", 163, "done.", 1903950) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param pull_id [Integer] Pull request id + # @param body [String] Comment contents + # @param comment_id [Integer] Comment id to reply to + # @return [Sawyer::Resource] Hash representing new comment + # @see https://developer.github.com/v3/pulls/comments/#create-a-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#231 + def create_review_reply(repo, pull_id, body, comment_id, options = T.unsafe(nil)); end + + # Create a pull request comment + # + # @deprecated The position will be deprecated in the next major version. Please refer to the details below. + # @example + # @client.create_pull_request_comment("octokit/octokit.rb", 163, ":shipit:", + # "2d3201e4440903d8b04a5487842053ca4883e5f0", "lib/octokit/request.rb", 47) + # @param pull_id [Integer] Pull request id + # @param body [String] Comment content + # @param path [String] Relative path of the file to comment on. + # @param line [Integer] Line index in the diff to comment on. + # For a multi-line comment, the last line of the range + # and specify 'start_line' in the 'options'. + # @param commit_id [String] Sha of the commit to comment on. + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Sawyer::Resource] Hash representing the new comment + # @see https://developer.github.com/v3/pulls/comments/#create-a-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#209 + def create_view_comment(repo, pull_id, body, commit_id, path, line, options = T.unsafe(nil)); end + + # Delete pull request comment + # + # @example + # @client.delete_pull_request_comment("octokit/octokit.rb", 1902707) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param comment_id [Integer] Id of the comment to delete + # @return [Boolean] True if deleted, false otherwise + # @see https://developer.github.com/v3/pulls/comments/#delete-a-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#265 + def delete_pull_comment(repo, comment_id, options = T.unsafe(nil)); end + + # Delete pull request comment + # + # @example + # @client.delete_pull_request_comment("octokit/octokit.rb", 1902707) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param comment_id [Integer] Id of the comment to delete + # @return [Boolean] True if deleted, false otherwise + # @see https://developer.github.com/v3/pulls/comments/#delete-a-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#265 + def delete_pull_request_comment(repo, comment_id, options = T.unsafe(nil)); end + + # Delete pull request comment + # + # @example + # @client.delete_pull_request_comment("octokit/octokit.rb", 1902707) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param comment_id [Integer] Id of the comment to delete + # @return [Boolean] True if deleted, false otherwise + # @see https://developer.github.com/v3/pulls/comments/#delete-a-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#265 + def delete_review_comment(repo, comment_id, options = T.unsafe(nil)); end + + # Merge a pull request + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number of pull request + # @param commit_message [String] Optional commit message for the merge commit + # @return [Array] Merge commit info if successful + # @see https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button + # + # source://octokit//lib/octokit/client/pull_requests.rb#300 + def merge_pull_request(repo, number, commit_message = T.unsafe(nil), options = T.unsafe(nil)); end + + # Get a pull request + # + # @example + # Octokit.pull_request('rails/rails', 42, :state => 'closed') + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number of the pull request to fetch + # @return [Sawyer::Resource] Pull request info + # @see https://developer.github.com/v3/pulls/#get-a-single-pull-request + # + # source://octokit//lib/octokit/client/pull_requests.rb#32 + def pull(repo, number, options = T.unsafe(nil)); end + + # Get a pull request comment + # + # @example + # @client.pull_request_comment("pengwynn/octkit", 1903950) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param comment_id [Integer] Id of comment to get + # @return [Sawyer::Resource] Hash representing the comment + # @see https://developer.github.com/v3/pulls/comments/#get-a-single-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#187 + def pull_comment(repo, comment_id, options = T.unsafe(nil)); end + + # List comments on a pull request + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number of pull request + # @return [Array] List of comments + # @see https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request + # + # source://octokit//lib/octokit/client/pull_requests.rb#172 + def pull_comments(repo, number, options = T.unsafe(nil)); end + + # List commits on a pull request + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number of pull request + # @return [Array] List of commits + # @see https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request + # + # source://octokit//lib/octokit/client/pull_requests.rb#130 + def pull_commits(repo, number, options = T.unsafe(nil)); end + + # List files on a pull request + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number of pull request + # @return [Array] List of files + # @see https://developer.github.com/v3/pulls/#list-pull-requests-files + # + # source://octokit//lib/octokit/client/pull_requests.rb#277 + def pull_files(repo, number, options = T.unsafe(nil)); end + + # Check pull request merge status + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number of pull request + # @return [Boolean] True if the pull request has been merged + # @see https://developer.github.com/v3/pulls/#get-if-a-pull-request-has-been-merged + # + # source://octokit//lib/octokit/client/pull_requests.rb#310 + def pull_merged?(repo, number, options = T.unsafe(nil)); end + + # Get a pull request + # + # @example + # Octokit.pull_request('rails/rails', 42, :state => 'closed') + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number of the pull request to fetch + # @return [Sawyer::Resource] Pull request info + # @see https://developer.github.com/v3/pulls/#get-a-single-pull-request + # + # source://octokit//lib/octokit/client/pull_requests.rb#32 + def pull_request(repo, number, options = T.unsafe(nil)); end + + # Get a pull request comment + # + # @example + # @client.pull_request_comment("pengwynn/octkit", 1903950) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param comment_id [Integer] Id of comment to get + # @return [Sawyer::Resource] Hash representing the comment + # @see https://developer.github.com/v3/pulls/comments/#get-a-single-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#187 + def pull_request_comment(repo, comment_id, options = T.unsafe(nil)); end + + # List comments on a pull request + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number of pull request + # @return [Array] List of comments + # @see https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request + # + # source://octokit//lib/octokit/client/pull_requests.rb#172 + def pull_request_comments(repo, number, options = T.unsafe(nil)); end + + # List commits on a pull request + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number of pull request + # @return [Array] List of commits + # @see https://developer.github.com/v3/pulls/#list-commits-on-a-pull-request + # + # source://octokit//lib/octokit/client/pull_requests.rb#130 + def pull_request_commits(repo, number, options = T.unsafe(nil)); end + + # List files on a pull request + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number of pull request + # @return [Array] List of files + # @see https://developer.github.com/v3/pulls/#list-pull-requests-files + # + # source://octokit//lib/octokit/client/pull_requests.rb#277 + def pull_request_files(repo, number, options = T.unsafe(nil)); end + + # Check pull request merge status + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number of pull request + # @return [Boolean] True if the pull request has been merged + # @see https://developer.github.com/v3/pulls/#get-if-a-pull-request-has-been-merged + # + # source://octokit//lib/octokit/client/pull_requests.rb#310 + def pull_request_merged?(repo, number, options = T.unsafe(nil)); end + + # List pull requests for a repository + # + # @example + # Octokit.pull_requests('rails/rails', :state => 'closed') + # @overload pull_requests + # @return [Array] Array of pulls + # @see https://developer.github.com/v3/pulls/#list-pull-requests + # + # source://octokit//lib/octokit/client/pull_requests.rb#19 + def pull_requests(repo, options = T.unsafe(nil)); end + + # List pull request comments for a repository + # + # By default, Review Comments are ordered by ascending ID. + # + # @example Get review comments, sort by updated asc since a time + # @client.pull_requests_comments("octokit/octokit.rb", { + # :sort => 'updated', + # :direction => 'asc', + # :since => '2010-05-04T23:45:02Z' + # }) + # @example Get the pull request review comments in the octokit repository + # @client.issues_comments("octokit/octokit.rb") + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] Optional parameters + # @return [Array] List of pull request review comments. + # @see https://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + # + # source://octokit//lib/octokit/client/pull_requests.rb#160 + def pull_requests_comments(repo, options = T.unsafe(nil)); end + + # List pull requests for a repository + # + # @example + # Octokit.pull_requests('rails/rails', :state => 'closed') + # @overload pull_requests + # @return [Array] Array of pulls + # @see https://developer.github.com/v3/pulls/#list-pull-requests + # + # source://octokit//lib/octokit/client/pull_requests.rb#19 + def pulls(repo, options = T.unsafe(nil)); end + + # List pull request comments for a repository + # + # By default, Review Comments are ordered by ascending ID. + # + # @example Get review comments, sort by updated asc since a time + # @client.pull_requests_comments("octokit/octokit.rb", { + # :sort => 'updated', + # :direction => 'asc', + # :since => '2010-05-04T23:45:02Z' + # }) + # @example Get the pull request review comments in the octokit repository + # @client.issues_comments("octokit/octokit.rb") + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] Optional parameters + # @return [Array] List of pull request review comments. + # @see https://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + # + # source://octokit//lib/octokit/client/pull_requests.rb#160 + def pulls_comments(repo, options = T.unsafe(nil)); end + + # Get a pull request comment + # + # @example + # @client.pull_request_comment("pengwynn/octkit", 1903950) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param comment_id [Integer] Id of comment to get + # @return [Sawyer::Resource] Hash representing the comment + # @see https://developer.github.com/v3/pulls/comments/#get-a-single-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#187 + def review_comment(repo, comment_id, options = T.unsafe(nil)); end + + # List comments on a pull request + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number of pull request + # @return [Array] List of comments + # @see https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request + # + # source://octokit//lib/octokit/client/pull_requests.rb#172 + def review_comments(repo, number, options = T.unsafe(nil)); end + + # List pull request comments for a repository + # + # By default, Review Comments are ordered by ascending ID. + # + # @example Get review comments, sort by updated asc since a time + # @client.pull_requests_comments("octokit/octokit.rb", { + # :sort => 'updated', + # :direction => 'asc', + # :since => '2010-05-04T23:45:02Z' + # }) + # @example Get the pull request review comments in the octokit repository + # @client.issues_comments("octokit/octokit.rb") + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param options [Hash] Optional parameters + # @return [Array] List of pull request review comments. + # @see https://developer.github.com/v3/pulls/comments/#list-comments-in-a-repository + # + # source://octokit//lib/octokit/client/pull_requests.rb#160 + def reviews_comments(repo, options = T.unsafe(nil)); end + + # Update pull request comment + # + # @example + # @client.update_pull_request_comment("octokit/octokit.rb", 1903950, ":shipit:") + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param comment_id [Integer] Id of the comment to update + # @param body [String] Updated comment content + # @return [Sawyer::Resource] Hash representing the updated comment + # @see https://developer.github.com/v3/pulls/comments/#edit-a-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#250 + def update_pull_comment(repo, comment_id, body, options = T.unsafe(nil)); end + + # Update a pull request + # + # @example + # @client.update_pull_request('octokit/octokit.rb', 67, 'new title', 'updated body', 'closed') + # @example Passing nil for optional attributes to update specific attributes. + # @client.update_pull_request('octokit/octokit.rb', 67, nil, nil, 'open') + # @example Empty body by passing empty string + # @client.update_pull_request('octokit/octokit.rb', 67, nil, '') + # @overload update_pull_request + # @overload update_pull_request + # @return [Sawyer::Resource] Hash representing updated pull request. + # @see https://developer.github.com/v3/pulls/#update-a-pull-request + # + # source://octokit//lib/octokit/client/pull_requests.rb#104 + def update_pull_request(*args); end + + # Update a pull request branch + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number of pull request + # @param options [Hash] Optional parameters (e.g. expected_head_sha) + # @return [Boolean] True if the pull request branch has been updated + # @see https://developer.github.com/v3/pulls/#update-a-pull-request-branch + # + # source://octokit//lib/octokit/client/pull_requests.rb#289 + def update_pull_request_branch(repo, number, options = T.unsafe(nil)); end + + # Update pull request comment + # + # @example + # @client.update_pull_request_comment("octokit/octokit.rb", 1903950, ":shipit:") + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param comment_id [Integer] Id of the comment to update + # @param body [String] Updated comment content + # @return [Sawyer::Resource] Hash representing the updated comment + # @see https://developer.github.com/v3/pulls/comments/#edit-a-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#250 + def update_pull_request_comment(repo, comment_id, body, options = T.unsafe(nil)); end + + # Update pull request comment + # + # @example + # @client.update_pull_request_comment("octokit/octokit.rb", 1903950, ":shipit:") + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param comment_id [Integer] Id of the comment to update + # @param body [String] Updated comment content + # @return [Sawyer::Resource] Hash representing the updated comment + # @see https://developer.github.com/v3/pulls/comments/#edit-a-comment + # + # source://octokit//lib/octokit/client/pull_requests.rb#250 + def update_review_comment(repo, comment_id, body, options = T.unsafe(nil)); end +end + +# Methods for API rate limiting info +# +# @see https://developer.github.com/v3/#rate-limiting +# +# source://octokit//lib/octokit/client/rate_limit.rb#8 +module Octokit::Client::RateLimit + # Get rate limit info from last response if available + # or make a new request to fetch rate limit + # + # @return [Octokit::RateLimit] Rate limit info + # @see https://developer.github.com/v3/rate_limit/#rate-limit + # + # source://octokit//lib/octokit/client/rate_limit.rb#14 + def rate_limit(_options = T.unsafe(nil)); end + + # Refresh rate limit info by making a new request + # + # @return [Octokit::RateLimit] Rate limit info + # @see https://developer.github.com/v3/rate_limit/#rate-limit + # + # source://octokit//lib/octokit/client/rate_limit.rb#35 + def rate_limit!(_options = T.unsafe(nil)); end + + # Get number of rate limted requests remaining + # + # @return [Integer] Number of requests remaining in this period + # @see https://developer.github.com/v3/rate_limit/#rate-limit + # + # source://octokit//lib/octokit/client/rate_limit.rb#25 + def rate_limit_remaining(_options = T.unsafe(nil)); end + + # Refresh rate limit info and get number of rate limted requests remaining + # + # @return [Integer] Number of requests remaining in this period + # @see https://developer.github.com/v3/rate_limit/#rate-limit + # + # source://octokit//lib/octokit/client/rate_limit.rb#45 + def rate_limit_remaining!(_options = T.unsafe(nil)); end + + # Get rate limit info from last response if available + # or make a new request to fetch rate limit + # + # @return [Octokit::RateLimit] Rate limit info + # @see https://developer.github.com/v3/rate_limit/#rate-limit + # + # source://octokit//lib/octokit/client/rate_limit.rb#14 + def ratelimit(_options = T.unsafe(nil)); end + + # Refresh rate limit info by making a new request + # + # @return [Octokit::RateLimit] Rate limit info + # @see https://developer.github.com/v3/rate_limit/#rate-limit + # + # source://octokit//lib/octokit/client/rate_limit.rb#35 + def ratelimit!(_options = T.unsafe(nil)); end + + # Get number of rate limted requests remaining + # + # @return [Integer] Number of requests remaining in this period + # @see https://developer.github.com/v3/rate_limit/#rate-limit + # + # source://octokit//lib/octokit/client/rate_limit.rb#25 + def ratelimit_remaining(_options = T.unsafe(nil)); end + + # Refresh rate limit info and get number of rate limted requests remaining + # + # @return [Integer] Number of requests remaining in this period + # @see https://developer.github.com/v3/rate_limit/#rate-limit + # + # source://octokit//lib/octokit/client/rate_limit.rb#45 + def ratelimit_remaining!(_options = T.unsafe(nil)); end +end + +# Methods for the Reacions API +# +# @see https://developer.github.com/v3/reactions/ +# +# source://octokit//lib/octokit/client/reactions.rb#8 +module Octokit::Client::Reactions + # List reactions for a commit comment + # + # @example + # @client.commit_comment_reactions("octokit/octokit.rb", 1) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The id of the commit comment + # @return [Array] Array of Hashes representing the reactions. + # @see https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment + # + # source://octokit//lib/octokit/client/reactions.rb#19 + def commit_comment_reactions(repo, id, options = T.unsafe(nil)); end + + # Create a reaction for a commit comment + # + # @example + # @client.create_commit_comment_reactions("octokit/octokit.rb", 1) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The id of the commit comment + # @param reaction [String] The Reaction + # @return [] Hash representing the reaction + # @see https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment + # @see https://developer.github.com/v3/reactions/#reaction-types + # + # source://octokit//lib/octokit/client/reactions.rb#35 + def create_commit_comment_reaction(repo, id, reaction, options = T.unsafe(nil)); end + + # Create reaction for an issue comment + # + # @example + # @client.create_issue_comment_reaction("octokit/octokit.rb", 1) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The Issue comment id + # @param reaction [String] The Reaction + # @return [] Hashes representing the reaction. + # @see https://developer.github.com/v3/reactions/#create-reaction-for-an-issue-comment + # @see https://developer.github.com/v3/reactions/#reaction-types + # + # source://octokit//lib/octokit/client/reactions.rb#100 + def create_issue_comment_reaction(repo, id, reaction, options = T.unsafe(nil)); end + + # Create reaction for an issue + # + # @example + # @client.create_issue_reaction("octokit/octokit.rb", 1) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] The Issue number + # @param reaction [String] The Reaction + # @return [] Hash representing the reaction. + # @see https://developer.github.com/v3/reactions/#create-reaction-for-an-issue + # @see https://developer.github.com/v3/reactions/#reaction-types + # + # source://octokit//lib/octokit/client/reactions.rb#67 + def create_issue_reaction(repo, number, reaction, options = T.unsafe(nil)); end + + # Create reaction for a pull request review comment + # + # @example + # @client.create_pull_request_reiew_comment_reaction("octokit/octokit.rb", 1) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The Issue comment id + # @param reaction [String] The Reaction + # @return [] Hash representing the reaction. + # @see https://developer.github.com/v3/reactions/#create-reaction-for-a-pull-request-review-comment + # @see https://developer.github.com/v3/reactions/#reaction-types + # + # source://octokit//lib/octokit/client/reactions.rb#133 + def create_pull_request_review_comment_reaction(repo, id, reaction, options = T.unsafe(nil)); end + + # Create reaction for a release + # + # @example + # @client.create_release_reaction("octokit/octokit.rb", 1) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The Release id + # @param reaction [String] The Reaction + # @return [] Hash representing the reaction. + # @see https://docs.github.com/en/free-pro-team@latest/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-a-release + # @see https://developer.github.com/v3/reactions/#reaction-types + # + # source://octokit//lib/octokit/client/reactions.rb#182 + def create_release_reaction(repo, release_id, reaction, options = T.unsafe(nil)); end + + # Delete a reaction + # + # @example + # @client.delete_issue_reaction("octokit/octokit.rb", 1, 2) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param issue_id [Integer] The Issue comment id + # @param reaction_id [Integer] The Reaction id + # @return [Boolean] Return true if reaction was deleted, false otherwise. + # @see https://docs.github.com/en/rest/reactions/reactions#delete-an-issue-reaction + # + # source://octokit//lib/octokit/client/reactions.rb#150 + def delete_issue_reaction(repo, issue_id, reaction_id, options = T.unsafe(nil)); end + + # Delete a reaction for a release + # + # @example + # @client.delete_release_reaction("octokit/octokit.rb", 1, 2) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param issue_id [Integer] The Release id + # @param reaction_id [Integer] The Reaction id + # @return [Boolean] Return true if reaction was deleted, false otherwise. + # @see https://docs.github.com/en/free-pro-team@latest/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-release-reaction + # + # source://octokit//lib/octokit/client/reactions.rb#199 + def delete_release_reaction(repo, release_id, reaction_id, options = T.unsafe(nil)); end + + # List reactions for an issue comment + # + # @example + # @client.issue_comment_reactions("octokit/octokit.rb", 1) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The Issue comment id + # @return [Array] Array of Hashes representing the reactions. + # @see https://developer.github.com/v3/reactions/#list-reactions-for-an-issue-comment + # + # source://octokit//lib/octokit/client/reactions.rb#83 + def issue_comment_reactions(repo, id, options = T.unsafe(nil)); end + + # List reactions for an issue + # + # @example + # @client.issue_reactions("octokit/octokit.rb", 1) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] The Issue number + # @return [Array] Array of Hashes representing the reactions. + # @see https://developer.github.com/v3/reactions/#list-reactions-for-an-issue + # + # source://octokit//lib/octokit/client/reactions.rb#50 + def issue_reactions(repo, number, options = T.unsafe(nil)); end + + # List reactions for a pull request review comment + # + # @example + # @client.pull_request_review_comment_reactions("octokit/octokit.rb", 1) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The Issue comment id + # @return [Array] Array of Hashes representing the reactions. + # @see https://developer.github.com/v3/reactions/#list-reactions-for-a-pull-request-review-comment + # + # source://octokit//lib/octokit/client/reactions.rb#116 + def pull_request_review_comment_reactions(repo, id, options = T.unsafe(nil)); end + + # List reactions for a release + # + # @example + # @client.release_reactions("octokit/octokit.rb", 1) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The Release id + # @return [Array] Array of Hashes representing the reactions. + # @see https://docs.github.com/en/free-pro-team@latest/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-a-release + # + # source://octokit//lib/octokit/client/reactions.rb#165 + def release_reactions(repo, release_id, options = T.unsafe(nil)); end +end + +# Methods for References for Git Data API +# +# @see https://developer.github.com/v3/git/refs/ +# +# source://octokit//lib/octokit/client/refs.rb#8 +module Octokit::Client::Refs + # Create a reference + # + # @example Create refs/heads/master for octocat/Hello-World with sha 827efc6d56897b048c772eb4087f854f46256132 + # Octokit.create_ref("octocat/Hello-World", "heads/master", "827efc6d56897b048c772eb4087f854f46256132") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param ref [String] The ref, e.g. tags/v0.0.3 + # @param sha [String] A SHA, e.g. 827efc6d56897b048c772eb4087f854f46256132 + # @return [Array] The list of references, already containing the new one + # @see https://developer.github.com/v3/git/refs/#create-a-reference + # + # source://octokit//lib/octokit/client/refs.rb#60 + def create_ref(repo, ref, sha, options = T.unsafe(nil)); end + + # Create a reference + # + # @example Create refs/heads/master for octocat/Hello-World with sha 827efc6d56897b048c772eb4087f854f46256132 + # Octokit.create_ref("octocat/Hello-World", "heads/master", "827efc6d56897b048c772eb4087f854f46256132") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param ref [String] The ref, e.g. tags/v0.0.3 + # @param sha [String] A SHA, e.g. 827efc6d56897b048c772eb4087f854f46256132 + # @return [Array] The list of references, already containing the new one + # @see https://developer.github.com/v3/git/refs/#create-a-reference + # + # source://octokit//lib/octokit/client/refs.rb#60 + def create_reference(repo, ref, sha, options = T.unsafe(nil)); end + + # Delete a single branch + # + # @example Delete uritemplate for sigmavirus24/github3.py + # Octokit.delete_branch("sigmavirus24/github3.py", "uritemplate") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param branch [String] The branch, e.g. fix-refs + # @return [Boolean] Success + # @see https://developer.github.com/v3/git/refs/#delete-a-reference + # + # source://octokit//lib/octokit/client/refs.rb#113 + def delete_branch(repo, branch, options = T.unsafe(nil)); end + + # Delete a single reference + # + # @example Delete tags/v0.0.3 for sferik/rails_admin + # Octokit.delete_ref("sferik/rails_admin","tags/v0.0.3") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param ref [String] The ref, e.g. tags/v0.0.3 + # @return [Boolean] Success + # @see https://developer.github.com/v3/git/refs/#delete-a-reference + # + # source://octokit//lib/octokit/client/refs.rb#125 + def delete_ref(repo, ref, options = T.unsafe(nil)); end + + # Delete a single reference + # + # @example Delete tags/v0.0.3 for sferik/rails_admin + # Octokit.delete_ref("sferik/rails_admin","tags/v0.0.3") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param ref [String] The ref, e.g. tags/v0.0.3 + # @return [Boolean] Success + # @see https://developer.github.com/v3/git/refs/#delete-a-reference + # + # source://octokit//lib/octokit/client/refs.rb#125 + def delete_reference(repo, ref, options = T.unsafe(nil)); end + + # List all refs for a given user and repo + # + # @example Fetch all refs for sferik/rails_admin + # Octokit.refs("sferik/rails_admin") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param namespace [String] The ref namespace, e.g. tag or heads + # @return [Array] A list of references matching the repo and the namespace + # @see https://developer.github.com/v3/git/refs/#get-all-references + # + # source://octokit//lib/octokit/client/refs.rb#17 + def list_references(repo, namespace = T.unsafe(nil), options = T.unsafe(nil)); end + + # List all refs for a given user and repo + # + # @example Fetch all refs for sferik/rails_admin + # Octokit.refs("sferik/rails_admin") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param namespace [String] The ref namespace, e.g. tag or heads + # @return [Array] A list of references matching the repo and the namespace + # @see https://developer.github.com/v3/git/refs/#get-all-references + # + # source://octokit//lib/octokit/client/refs.rb#17 + def list_refs(repo, namespace = T.unsafe(nil), options = T.unsafe(nil)); end + + # Fetch matching refs + # + # @example Fetch refs matching tags/v2 for sferik/rails_admin + # Octokit.ref("sferik/rails_admin","tags/v2") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param ref [String] The ref, e.g. tags/v0.0.3 or heads/rails-3 + # @return [Array] The reference matching the given repo and the ref id + # @see https://developer.github.com/v3/git/refs/#list-matching-references + # + # source://octokit//lib/octokit/client/refs.rb#34 + def matching_refs(repo, ref, options = T.unsafe(nil)); end + + # Fetch a given reference + # + # @example Fetch tags/v0.0.3 for sferik/rails_admin + # Octokit.ref("sferik/rails_admin","tags/v0.0.3") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param ref [String] The ref, e.g. tags/v0.0.3 + # @return [Sawyer::Resource] The reference matching the given repo and the ref id + # @see https://developer.github.com/v3/git/refs/#get-a-reference + # + # source://octokit//lib/octokit/client/refs.rb#46 + def ref(repo, ref, options = T.unsafe(nil)); end + + # Fetch a given reference + # + # @example Fetch tags/v0.0.3 for sferik/rails_admin + # Octokit.ref("sferik/rails_admin","tags/v0.0.3") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param ref [String] The ref, e.g. tags/v0.0.3 + # @return [Sawyer::Resource] The reference matching the given repo and the ref id + # @see https://developer.github.com/v3/git/refs/#get-a-reference + # + # source://octokit//lib/octokit/client/refs.rb#46 + def reference(repo, ref, options = T.unsafe(nil)); end + + # List all refs for a given user and repo + # + # @example Fetch all refs for sferik/rails_admin + # Octokit.refs("sferik/rails_admin") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param namespace [String] The ref namespace, e.g. tag or heads + # @return [Array] A list of references matching the repo and the namespace + # @see https://developer.github.com/v3/git/refs/#get-all-references + # + # source://octokit//lib/octokit/client/refs.rb#17 + def references(repo, namespace = T.unsafe(nil), options = T.unsafe(nil)); end + + # List all refs for a given user and repo + # + # @example Fetch all refs for sferik/rails_admin + # Octokit.refs("sferik/rails_admin") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param namespace [String] The ref namespace, e.g. tag or heads + # @return [Array] A list of references matching the repo and the namespace + # @see https://developer.github.com/v3/git/refs/#get-all-references + # + # source://octokit//lib/octokit/client/refs.rb#17 + def refs(repo, namespace = T.unsafe(nil), options = T.unsafe(nil)); end + + # Update a branch + # + # @example Force update heads/sc/featureA for octocat/Hello-World with sha aa218f56b14c9653891f9e74264a383fa43fefbd + # Octokit.update_branch("octocat/Hello-World", "sc/featureA", "aa218f56b14c9653891f9e74264a383fa43fefbd") + # @example Fast-forward update heads/sc/featureA for octocat/Hello-World with sha aa218f56b14c9653891f9e74264a383fa43fefbd + # Octokit.update_branch("octocat/Hello-World", "sc/featureA", "aa218f56b14c9653891f9e74264a383fa43fefbd", false) + # @param branch [String] The ref, e.g. feature/new-shiny + # @param force [Boolean] A flag indicating whether to force the update or to make sure the update is a fast-forward update. + # @param sha [String] A SHA, e.g. 827efc6d56897b048c772eb4087f854f46256132 + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] The list of references updated + # @see https://developer.github.com/v3/git/refs/#update-a-reference + # + # source://octokit//lib/octokit/client/refs.rb#101 + def update_branch(repo, branch, sha, force = T.unsafe(nil), options = T.unsafe(nil)); end + + # Update a reference + # + # @example Force update heads/sc/featureA for octocat/Hello-World with sha aa218f56b14c9653891f9e74264a383fa43fefbd + # Octokit.update_ref("octocat/Hello-World", "heads/sc/featureA", "aa218f56b14c9653891f9e74264a383fa43fefbd") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param ref [String] The ref, e.g. tags/v0.0.3 + # @param sha [String] A SHA, e.g. 827efc6d56897b048c772eb4087f854f46256132 + # @param force [Boolean] A flag indicating whether to force the update or to make sure the update is a fast-forward update. + # @return [Array] The list of references updated + # @see https://developer.github.com/v3/git/refs/#update-a-reference + # + # source://octokit//lib/octokit/client/refs.rb#80 + def update_ref(repo, ref, sha, force = T.unsafe(nil), options = T.unsafe(nil)); end + + # Update a reference + # + # @example Force update heads/sc/featureA for octocat/Hello-World with sha aa218f56b14c9653891f9e74264a383fa43fefbd + # Octokit.update_ref("octocat/Hello-World", "heads/sc/featureA", "aa218f56b14c9653891f9e74264a383fa43fefbd") + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param ref [String] The ref, e.g. tags/v0.0.3 + # @param sha [String] A SHA, e.g. 827efc6d56897b048c772eb4087f854f46256132 + # @param force [Boolean] A flag indicating whether to force the update or to make sure the update is a fast-forward update. + # @return [Array] The list of references updated + # @see https://developer.github.com/v3/git/refs/#update-a-reference + # + # source://octokit//lib/octokit/client/refs.rb#80 + def update_reference(repo, ref, sha, force = T.unsafe(nil), options = T.unsafe(nil)); end +end + +# Methods for the Releases API +# +# @see https://developer.github.com/v3/repos/releases/ +# +# source://octokit//lib/octokit/client/releases.rb#8 +module Octokit::Client::Releases + # Create a release + # + # @option options + # @option options + # @option options + # @option options + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param tag_name [String] Git tag from which to create release + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] The release + # @see https://developer.github.com/v3/repos/releases/#create-a-release + # + # source://octokit//lib/octokit/client/releases.rb#30 + def create_release(repo, tag_name, options = T.unsafe(nil)); end + + # Delete a release + # + # @param url [String] URL for the release as returned from .releases + # @return [Boolean] Success or failure + # @see https://developer.github.com/v3/repos/releases/#delete-a-release + # + # source://octokit//lib/octokit/client/releases.rb#65 + def delete_release(url, options = T.unsafe(nil)); end + + # Delete a release asset + # + # @param asset_url [String] URL for the asset as returned from .release_assets + # @return [Boolean] Success or failure + # @see https://developer.github.com/v3/repos/releases/#delete-a-release-asset + # + # source://octokit//lib/octokit/client/releases.rb#128 + def delete_release_asset(asset_url, options = T.unsafe(nil)); end + + # Update a release + # + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param url [String] URL for the release as returned from .releases + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] The release + # @see https://developer.github.com/v3/repos/releases/#edit-a-release + # + # source://octokit//lib/octokit/client/releases.rb#55 + def edit_release(url, options = T.unsafe(nil)); end + + # Update a release asset + # + # @option options + # @option options + # @param asset_url [String] URL for the asset as returned from .release_assets + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] The release asset + # @see https://developer.github.com/v3/repos/releases/#edit-a-release-asset + # + # source://octokit//lib/octokit/client/releases.rb#118 + def edit_release_asset(asset_url, options = T.unsafe(nil)); end + + # Get the latest release + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Sawyer::Resource] The release + # @see https://developer.github.com/v3/repos/releases/#get-the-latest-release + # + # source://octokit//lib/octokit/client/releases.rb#147 + def latest_release(repo, options = T.unsafe(nil)); end + + # List releases for a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] A list of releases + # @see https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository + # + # source://octokit//lib/octokit/client/releases.rb#14 + def list_releases(repo, options = T.unsafe(nil)); end + + # Get a release + # + # @param url [String] URL for the release as returned from .releases + # @return [Sawyer::Resource] The release + # @see https://developer.github.com/v3/repos/releases/#get-a-single-release + # + # source://octokit//lib/octokit/client/releases.rb#40 + def release(url, options = T.unsafe(nil)); end + + # Get a single release asset + # + # @param asset_url [String] URL for the asset as returned from .release_assets + # @return [Sawyer::Resource] The release asset + # @see https://developer.github.com/v3/repos/releases/#get-a-single-release-asset + # + # source://octokit//lib/octokit/client/releases.rb#107 + def release_asset(asset_url, options = T.unsafe(nil)); end + + # List release assets + # + # @param release_url [String] URL for the release as returned from .releases + # @return [Array] A list of release assets + # @see https://developer.github.com/v3/repos/releases/#list-assets-for-a-release + # + # source://octokit//lib/octokit/client/releases.rb#74 + def release_assets(release_url, options = T.unsafe(nil)); end + + # Get the release for a given tag + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param tag_name [String] the name for a tag + # @return [Sawyer::Resource] The release + # @see https://developer.github.com/v3/repos/releases/#get-a-release-by-tag-name + # + # source://octokit//lib/octokit/client/releases.rb#138 + def release_for_tag(repo, tag_name, options = T.unsafe(nil)); end + + # List releases for a repository + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] A list of releases + # @see https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository + # + # source://octokit//lib/octokit/client/releases.rb#14 + def releases(repo, options = T.unsafe(nil)); end + + # Update a release + # + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param url [String] URL for the release as returned from .releases + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] The release + # @see https://developer.github.com/v3/repos/releases/#edit-a-release + # + # source://octokit//lib/octokit/client/releases.rb#55 + def update_release(url, options = T.unsafe(nil)); end + + # Update a release asset + # + # @option options + # @option options + # @param asset_url [String] URL for the asset as returned from .release_assets + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] The release asset + # @see https://developer.github.com/v3/repos/releases/#edit-a-release-asset + # + # source://octokit//lib/octokit/client/releases.rb#118 + def update_release_asset(asset_url, options = T.unsafe(nil)); end + + # Upload a release asset + # + # @option options + # @option options + # @param release_url [String] URL for the release as returned from .releases + # @param path_or_file [String] Path to file to upload + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] The release asset + # @see https://developer.github.com/v3/repos/releases/#upload-a-release-asset + # + # source://octokit//lib/octokit/client/releases.rb#86 + def upload_asset(release_url, path_or_file, options = T.unsafe(nil)); end + + private + + # source://octokit//lib/octokit/client/releases.rb#153 + def content_type_from_file(file); end +end + +# Methods for the Repositories API +# +# @see https://developer.github.com/v3/repos/ +# +# source://octokit//lib/octokit/client/repositories.rb#8 +module Octokit::Client::Repositories + # Add collaborator to repo + # + # This can also be used to update the permission of an existing collaborator + # + # Requires authenticated client. + # + # @example + # @client.add_collaborator('octokit/octokit.rb', 'holman') + # @example + # @client.add_collab('octokit/octokit.rb', 'holman') + # @example Add a collaborator with admin permissions + # @client.add_collaborator('octokit/octokit.rb', 'holman', permission: 'admin') + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param collaborator [String] Collaborator GitHub username to add. + # @param options [Hash] a customizable set of options + # @return [Boolean] True if collaborator added, false otherwise. + # @see https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator + # + # source://octokit//lib/octokit/client/repositories.rb#345 + def add_collab(repo, collaborator, options = T.unsafe(nil)); end + + # Add collaborator to repo + # + # This can also be used to update the permission of an existing collaborator + # + # Requires authenticated client. + # + # @example + # @client.add_collaborator('octokit/octokit.rb', 'holman') + # @example + # @client.add_collab('octokit/octokit.rb', 'holman') + # @example Add a collaborator with admin permissions + # @client.add_collaborator('octokit/octokit.rb', 'holman', permission: 'admin') + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param collaborator [String] Collaborator GitHub username to add. + # @param options [Hash] a customizable set of options + # @return [Boolean] True if collaborator added, false otherwise. + # @see https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator + # + # source://octokit//lib/octokit/client/repositories.rb#345 + def add_collaborator(repo, collaborator, options = T.unsafe(nil)); end + + # Add deploy key to a repo + # + # Requires authenticated client. + # + # @example + # @client.add_deploy_key('octokit/octokit.rb', 'Staging server', 'ssh-rsa AAA...') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param title [String] Title reference for the deploy key. + # @param key [String] Public key. + # @return [Sawyer::Resource] Hash representing newly added key. + # @see https://developer.github.com/v3/repos/keys/#add-a-new-deploy-key + # + # source://octokit//lib/octokit/client/repositories.rb#266 + def add_deploy_key(repo, title, key, options = T.unsafe(nil)); end + + # List all repositories + # + # This provides a dump of every repository, in the order that they were + # created. + # + # @option options + # @param options [Hash] Optional options + # @return [Array] List of repositories. + # @see https://developer.github.com/v3/repos/#list-all-public-repositories + # + # source://octokit//lib/octokit/client/repositories.rb#87 + def all_repositories(options = T.unsafe(nil)); end + + # Get a single branch from a repository + # + # @example Get branch 'master` from octokit/octokit.rb + # Octokit.branch("octokit/octokit.rb", "master") + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param branch [String] Branch name + # @return [Sawyer::Resource] The branch requested, if it exists + # @see https://developer.github.com/v3/repos/#get-branch + # + # source://octokit//lib/octokit/client/repositories.rb#566 + def branch(repo, branch, options = T.unsafe(nil)); end + + # Get branch protection summary + # + # @example + # @client.branch_protection('octokit/octokit.rb', 'master') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param branch [String] Branch name + # @return [Sawyer::Resource, nil] Branch protection summary or nil if the branch + # is not protected + # @see https://developer.github.com/v3/repos/branches/#get-branch-protection + # + # source://octokit//lib/octokit/client/repositories.rb#606 + def branch_protection(repo, branch, options = T.unsafe(nil)); end + + # List branches + # + # Requires authenticated client for private repos. + # + # @example + # Octokit.branches('octokit/octokit.rb') + # @example + # @client.branches('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of hashes representing branches. + # @see https://developer.github.com/v3/repos/#list-branches + # + # source://octokit//lib/octokit/client/repositories.rb#554 + def branches(repo, options = T.unsafe(nil)); end + + # Check to see if a particular user is an assignee for a repository. + # + # @example + # Octokit.check_assignee('octokit/octokit.rb', 'andrew') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param assignee [String] User login to check + # @return [Boolean] True if assignable on project, false otherwise. + # @see https://developer.github.com/v3/issues/assignees/#check-assignee + # + # source://octokit//lib/octokit/client/repositories.rb#670 + def check_assignee(repo, assignee, options = T.unsafe(nil)); end + + # Checks if a user is a collaborator for a repo. + # + # Requires authenticated client. + # + # @example + # @client.collaborator?('octokit/octokit.rb', 'holman') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param collaborator [String] Collaborator GitHub username to check. + # @return [Boolean] True if user is a collaborator, false otherwise. + # @see https://developer.github.com/v3/repos/collaborators/#check-if-a-user-is-a-collaborator + # + # source://octokit//lib/octokit/client/repositories.rb#377 + def collaborator?(repo, collaborator, options = T.unsafe(nil)); end + + # List collaborators + # + # Requires authenticated client for private repos. + # + # @example + # Octokit.collaborators('octokit/octokit.rb') + # @example + # Octokit.collabs('octokit/octokit.rb') + # @example + # @client.collabs('octokit/octokit.rb') + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param options [Hash] a customizable set of options + # @return [Array] Array of hashes representing collaborating users. + # @see https://developer.github.com/v3/repos/collaborators/#list-collaborators + # + # source://octokit//lib/octokit/client/repositories.rb#320 + def collaborators(repo, options = T.unsafe(nil)); end + + # List collaborators + # + # Requires authenticated client for private repos. + # + # @example + # Octokit.collaborators('octokit/octokit.rb') + # @example + # Octokit.collabs('octokit/octokit.rb') + # @example + # @client.collabs('octokit/octokit.rb') + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param options [Hash] a customizable set of options + # @return [Array] Array of hashes representing collaborating users. + # @see https://developer.github.com/v3/repos/collaborators/#list-collaborators + # + # source://octokit//lib/octokit/client/repositories.rb#320 + def collabs(repo, options = T.unsafe(nil)); end + + # List contributors to a repo + # + # Requires authenticated client for private repos. + # + # @example + # Octokit.contributors('octokit/octokit.rb', true) + # @example + # Octokit.contribs('octokit/octokit.rb') + # @example + # @client.contribs('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param anon [Boolean] Set true to include anonymous contributors. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/repos/#list-contributors + # + # source://octokit//lib/octokit/client/repositories.rb#457 + def contribs(repo, anon = T.unsafe(nil), options = T.unsafe(nil)); end + + # List contributors to a repo + # + # Requires authenticated client for private repos. + # + # @example + # Octokit.contributors('octokit/octokit.rb', true) + # @example + # Octokit.contribs('octokit/octokit.rb') + # @example + # @client.contribs('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param anon [Boolean] Set true to include anonymous contributors. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/repos/#list-contributors + # + # source://octokit//lib/octokit/client/repositories.rb#457 + def contributors(repo, anon = T.unsafe(nil), options = T.unsafe(nil)); end + + # Create a repository for a user or organization + # + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param name [String] Name of the new repo + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Repository info for the new repository + # @see https://developer.github.com/v3/repos/#create + # + # source://octokit//lib/octokit/client/repositories.rb#154 + def create(name, options = T.unsafe(nil)); end + + # Create a repository for a user or organization + # + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param name [String] Name of the new repo + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Repository info for the new repository + # @see https://developer.github.com/v3/repos/#create + # + # source://octokit//lib/octokit/client/repositories.rb#154 + def create_repo(name, options = T.unsafe(nil)); end + + # Create a repository for a user or organization generated from a template repository + # + # @option options + # @option options + # @option options + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub template repository + # @param name [String] Name of the new repo + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Repository info for the new repository + # + # source://octokit//lib/octokit/client/repositories.rb#203 + def create_repo_from_template(repo, name, options = T.unsafe(nil)); end + + # Create a repository for a user or organization + # + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param name [String] Name of the new repo + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Repository info for the new repository + # @see https://developer.github.com/v3/repos/#create + # + # source://octokit//lib/octokit/client/repositories.rb#154 + def create_repository(name, options = T.unsafe(nil)); end + + # Create a repository for a user or organization generated from a template repository + # + # @option options + # @option options + # @option options + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub template repository + # @param name [String] Name of the new repo + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Repository info for the new repository + # + # source://octokit//lib/octokit/client/repositories.rb#203 + def create_repository_from_template(repo, name, options = T.unsafe(nil)); end + + # Delete repository + # + # Note: If OAuth is used, 'delete_repo' scope is required + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Boolean] `true` if repository was deleted + # @see https://developer.github.com/v3/repos/#delete-a-repository + # + # source://octokit//lib/octokit/client/repositories.rb#175 + def delete_repo(repo, options = T.unsafe(nil)); end + + # Delete repository + # + # Note: If OAuth is used, 'delete_repo' scope is required + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Boolean] `true` if repository was deleted + # @see https://developer.github.com/v3/repos/#delete-a-repository + # + # source://octokit//lib/octokit/client/repositories.rb#175 + def delete_repository(repo, options = T.unsafe(nil)); end + + # Delete a repository subscription + # + # @example + # @client.delete_subscription("octokit/octokit.rb") + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Boolean] True if subscription deleted, false otherwise. + # @see https://developer.github.com/v3/activity/watching/#delete-a-repository-subscription + # + # source://octokit//lib/octokit/client/repositories.rb#721 + def delete_subscription(repo, options = T.unsafe(nil)); end + + # Get a single deploy key for a repo + # + # @example + # @client.deploy_key('octokit/octokit.rb', 8675309) + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param id [Integer] Deploy key ID. + # @return [Sawyer::Resource] Deploy key. + # @see https://developer.github.com/v3/repos/keys/#get-a-deploy-key + # + # source://octokit//lib/octokit/client/repositories.rb#251 + def deploy_key(repo, id, options = T.unsafe(nil)); end + + # Get deploy keys on a repo + # + # Requires authenticated client. + # + # @example + # @client.deploy_keys('octokit/octokit.rb') + # @example + # @client.list_deploy_keys('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Array] Array of hashes representing deploy keys. + # @see https://developer.github.com/v3/repos/keys/#list-deploy-keys + # + # source://octokit//lib/octokit/client/repositories.rb#238 + def deploy_keys(repo, options = T.unsafe(nil)); end + + # Disable vulnerability alerts for a repository + # + # @example Disable vulnerability alerts for a repository + # @client.disable_vulnerability_alerts("octokit/octokit.rb") + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param options [Hash] + # @return [Boolean] True if vulnerability alerts disabled, false otherwise. + # @see https://docs.github.com/en/rest/reference/repos#disable-vulnerability-alerts + # + # source://octokit//lib/octokit/client/repositories.rb#774 + def disable_vulnerability_alerts(repo, options = T.unsafe(nil)); end + + # Create a repository dispatch event + # + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param event_type [String] A custom webhook event name. + # @param options [Hash] a customizable set of options + # @return [Boolean] True if event was dispatched, false otherwise. + # @see https://developer.github.com/v3/repos/#create-a-repository-dispatch-event + # + # source://octokit//lib/octokit/client/repositories.rb#734 + def dispatch_event(repo, event_type, options = T.unsafe(nil)); end + + # Edit a repository + # + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param repo [String, Hash, Repository] A GitHub repository + # @param options [Hash] Repository information to update + # @return [Sawyer::Resource] Repository information + # @see https://developer.github.com/v3/repos/#update-a-repository + # + # source://octokit//lib/octokit/client/repositories.rb#46 + def edit(repo, options = T.unsafe(nil)); end + + # Edit a deploy key + # + # @deprecated This method is no longer supported in the API + # @example Update the key for a deploy key. + # @client.edit_deploy_key('octokit/octokit.rb', 8675309, :key => 'ssh-rsa BBB...') + # @example + # @client.update_deploy_key('octokit/octokit.rb', 8675309, :title => 'Uber', :key => 'ssh-rsa BBB...')) + # @option title + # @option key + # @param id [Integer] Deploy key ID. + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param options [Hash] Attributes to edit. + # @param title [Hash] a customizable set of options + # @param key [Hash] a customizable set of options + # @return [Sawyer::Resource] Updated deploy key. + # @see https://developer.github.com/changes/2014-02-24-finer-grained-scopes-for-ssh-keys/ + # @see https://developer.github.com/v3/repos/keys/#edit-a-deploy-key + # + # source://octokit//lib/octokit/client/repositories.rb#285 + def edit_deploy_key(repo, id, options); end + + # Edit a repository + # + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param repo [String, Hash, Repository] A GitHub repository + # @param options [Hash] Repository information to update + # @return [Sawyer::Resource] Repository information + # @see https://developer.github.com/v3/repos/#update-a-repository + # + # source://octokit//lib/octokit/client/repositories.rb#46 + def edit_repository(repo, options = T.unsafe(nil)); end + + # Enable vulnerability alerts for a repository + # + # @example Enable vulnerability alerts for a repository + # @client.enable_vulnerability_alerts("octokit/octokit.rb") + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param options [Hash] + # @return [Boolean] True if vulnerability alerts enabled, false otherwise. + # @see https://docs.github.com/en/rest/reference/repos#enable-vulnerability-alerts + # + # source://octokit//lib/octokit/client/repositories.rb#761 + def enable_vulnerability_alerts(repo, options = T.unsafe(nil)); end + + # Fork a repository + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Sawyer::Resource] Repository info for the new fork + # @see https://developer.github.com/v3/repos/forks/#create-a-fork + # + # source://octokit//lib/octokit/client/repositories.rb#134 + def fork(repo, options = T.unsafe(nil)); end + + # List forks + # + # Requires authenticated client for private repos. + # + # @example + # Octokit.forks('octokit/octokit.rb') + # @example + # Octokit.network('octokit/octokit.rb') + # @example + # @client.forks('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of hashes representing repos. + # @see https://developer.github.com/v3/repos/forks/#list-forks + # + # source://octokit//lib/octokit/client/repositories.rb#508 + def forks(repo, options = T.unsafe(nil)); end + + # Get a single branch from a repository + # + # @example Get branch 'master` from octokit/octokit.rb + # Octokit.branch("octokit/octokit.rb", "master") + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param branch [String] Branch name + # @return [Sawyer::Resource] The branch requested, if it exists + # @see https://developer.github.com/v3/repos/#get-branch + # + # source://octokit//lib/octokit/client/repositories.rb#566 + def get_branch(repo, branch, options = T.unsafe(nil)); end + + # List languages of code in the repo. + # + # Requires authenticated client for private repos. + # + # @example + # Octokit.languages('octokit/octokit.rb') + # @example + # @client.languages('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of Hashes representing languages. + # @see https://developer.github.com/v3/repos/#list-languages + # + # source://octokit//lib/octokit/client/repositories.rb#524 + def languages(repo, options = T.unsafe(nil)); end + + # Get deploy keys on a repo + # + # Requires authenticated client. + # + # @example + # @client.deploy_keys('octokit/octokit.rb') + # @example + # @client.list_deploy_keys('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Array] Array of hashes representing deploy keys. + # @see https://developer.github.com/v3/repos/keys/#list-deploy-keys + # + # source://octokit//lib/octokit/client/repositories.rb#238 + def list_deploy_keys(repo, options = T.unsafe(nil)); end + + # List user repositories + # + # If user is not supplied, repositories for the current + # authenticated user are returned. + # + # @note If the user provided is a GitHub organization, only the + # organization's public repositories will be listed. For retrieving + # organization repositories the {Organizations#organization_repositories} + # method should be used instead. + # @param user [Integer, String] Optional GitHub user login or id for which + # to list repos. + # @return [Array] List of repositories + # @see https://developer.github.com/v3/repos/#list-your-repositories + # @see https://developer.github.com/v3/repos/#list-user-repositories + # + # source://octokit//lib/octokit/client/repositories.rb#69 + def list_repos(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # List user repositories + # + # If user is not supplied, repositories for the current + # authenticated user are returned. + # + # @note If the user provided is a GitHub organization, only the + # organization's public repositories will be listed. For retrieving + # organization repositories the {Organizations#organization_repositories} + # method should be used instead. + # @param user [Integer, String] Optional GitHub user login or id for which + # to list repos. + # @return [Array] List of repositories + # @see https://developer.github.com/v3/repos/#list-your-repositories + # @see https://developer.github.com/v3/repos/#list-user-repositories + # + # source://octokit//lib/octokit/client/repositories.rb#69 + def list_repositories(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # List forks + # + # Requires authenticated client for private repos. + # + # @example + # Octokit.forks('octokit/octokit.rb') + # @example + # Octokit.network('octokit/octokit.rb') + # @example + # @client.forks('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of hashes representing repos. + # @see https://developer.github.com/v3/repos/forks/#list-forks + # + # source://octokit//lib/octokit/client/repositories.rb#508 + def network(repo, options = T.unsafe(nil)); end + + # Get a user's permission level for a repo. + # + # Requires authenticated client + # + # @example + # @client.permission_level('octokit/octokit.rb', 'lizzhale') + # @return [Sawyer::Resource] Hash representing the user's permission level for the given repository + # @see https://developer.github.com/v3/repos/collaborators/#review-a-users-permission-level + # + # source://octokit//lib/octokit/client/repositories.rb#389 + def permission_level(repo, collaborator, options = T.unsafe(nil)); end + + # Lock a single branch from a repository + # + # Requires authenticated client + # + # @example + # @client.protect_branch('octokit/octokit.rb', 'master', foo) + # @option options + # @option options + # @param branch [String] Branch name + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] The protected branch + # @see https://developer.github.com/v3/repos/#enabling-and-disabling-branch-protection + # + # source://octokit//lib/octokit/client/repositories.rb#591 + def protect_branch(repo, branch, options = T.unsafe(nil)); end + + # Remove collaborator from repo. + # + # Requires authenticated client. + # + # @example + # @client.remove_collaborator('octokit/octokit.rb', 'holman') + # @example + # @client.remove_collab('octokit/octokit.rb', 'holman') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param collaborator [String] Collaborator GitHub username to remove. + # @return [Boolean] True if collaborator removed, false otherwise. + # @see https://developer.github.com/v3/repos/collaborators/#remove-user-as-a-collaborator + # + # source://octokit//lib/octokit/client/repositories.rb#362 + def remove_collab(repo, collaborator, options = T.unsafe(nil)); end + + # Remove collaborator from repo. + # + # Requires authenticated client. + # + # @example + # @client.remove_collaborator('octokit/octokit.rb', 'holman') + # @example + # @client.remove_collab('octokit/octokit.rb', 'holman') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param collaborator [String] Collaborator GitHub username to remove. + # @return [Boolean] True if collaborator removed, false otherwise. + # @see https://developer.github.com/v3/repos/collaborators/#remove-user-as-a-collaborator + # + # source://octokit//lib/octokit/client/repositories.rb#362 + def remove_collaborator(repo, collaborator, options = T.unsafe(nil)); end + + # Remove deploy key from a repo + # + # Requires authenticated client. + # + # @example + # @client.remove_deploy_key('octokit/octokit.rb', 100000) + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param id [Integer] Id of the deploy key to remove. + # @return [Boolean] True if key removed, false otherwise. + # @see https://developer.github.com/v3/repos/keys/#remove-a-deploy-key + # + # source://octokit//lib/octokit/client/repositories.rb#300 + def remove_deploy_key(repo, id, options = T.unsafe(nil)); end + + # Rename a single branch from a repository + # + # Requires authenticated client + # + # @example + # @client.rename_branch('octokit/octokit.rb', 'master', 'main') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param branch [String] Current branch name + # @param new_name [String] New branch name + # @return [Sawyer::Resource] The renamed branch + # @see https://developer.github.com/v3/repos/#rename-a-branch + # + # source://octokit//lib/octokit/client/repositories.rb#637 + def rename_branch(repo, branch, new_name, options = T.unsafe(nil)); end + + # Replace all topics for a repository + # + # Requires authenticated client. + # + # @example Replace topics for octokit/octokit.rb + # client.replace_all_topics('octokit/octokit.rb', ['octocat', 'atom', 'electron', 'API']) + # @example Clear all topics for octokit/octokit.rb + # client.replace_all_topics('octokit/octokit.rb', []) + # @param repo [Integer, String, Repository, Hash] A Github repository + # @param names [Array] An array of topics to add to the repository. + # @return [Sawyer::Resource] representing the replaced topics for given repo + # @see https://developer.github.com/v3/repos/#replace-all-topics-for-a-repository + # + # source://octokit//lib/octokit/client/repositories.rb#439 + def replace_all_topics(repo, names, options = T.unsafe(nil)); end + + # Get a single repository + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Sawyer::Resource] Repository information + # @see https://developer.github.com/v3/repos/#get + # @see https://developer.github.com/v3/licenses/#get-a-repositorys-license + # + # source://octokit//lib/octokit/client/repositories.rb#26 + def repo(repo, options = T.unsafe(nil)); end + + # List users available for assigning to issues. + # + # Requires authenticated client for private repos. + # + # @example + # Octokit.repository_assignees('octokit/octokit.rb') + # @example + # Octokit.repo_assignees('octokit/octokit.rb') + # @example + # @client.repository_assignees('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/issues/assignees/#list-assignees + # + # source://octokit//lib/octokit/client/repositories.rb#657 + def repo_assignees(repo, options = T.unsafe(nil)); end + + # List teams for a repo + # + # Requires authenticated client that is an owner or collaborator of the repo. + # + # @example + # @client.repository_teams('octokit/pengwynn') + # @example + # @client.repo_teams('octokit/pengwynn') + # @example + # @client.teams('octokit/pengwynn') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of hashes representing teams. + # @see https://developer.github.com/v3/repos/#list-teams + # + # source://octokit//lib/octokit/client/repositories.rb#406 + def repo_teams(repo, options = T.unsafe(nil)); end + + # List user repositories + # + # If user is not supplied, repositories for the current + # authenticated user are returned. + # + # @note If the user provided is a GitHub organization, only the + # organization's public repositories will be listed. For retrieving + # organization repositories the {Organizations#organization_repositories} + # method should be used instead. + # @param user [Integer, String] Optional GitHub user login or id for which + # to list repos. + # @return [Array] List of repositories + # @see https://developer.github.com/v3/repos/#list-your-repositories + # @see https://developer.github.com/v3/repos/#list-user-repositories + # + # source://octokit//lib/octokit/client/repositories.rb#69 + def repos(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # List user repositories + # + # If user is not supplied, repositories for the current + # authenticated user are returned. + # + # @note If the user provided is a GitHub organization, only the + # organization's public repositories will be listed. For retrieving + # organization repositories the {Organizations#organization_repositories} + # method should be used instead. + # @param user [Integer, String] Optional GitHub user login or id for which + # to list repos. + # @return [Array] List of repositories + # @see https://developer.github.com/v3/repos/#list-your-repositories + # @see https://developer.github.com/v3/repos/#list-user-repositories + # + # source://octokit//lib/octokit/client/repositories.rb#69 + def repositories(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # Get a single repository + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Sawyer::Resource] Repository information + # @see https://developer.github.com/v3/repos/#get + # @see https://developer.github.com/v3/licenses/#get-a-repositorys-license + # + # source://octokit//lib/octokit/client/repositories.rb#26 + def repository(repo, options = T.unsafe(nil)); end + + # Check if a repository exists + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Boolean] + # @see https://developer.github.com/v3/repos/#get + # + # source://octokit//lib/octokit/client/repositories.rb#14 + def repository?(repo, options = T.unsafe(nil)); end + + # List users available for assigning to issues. + # + # Requires authenticated client for private repos. + # + # @example + # Octokit.repository_assignees('octokit/octokit.rb') + # @example + # Octokit.repo_assignees('octokit/octokit.rb') + # @example + # @client.repository_assignees('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/issues/assignees/#list-assignees + # + # source://octokit//lib/octokit/client/repositories.rb#657 + def repository_assignees(repo, options = T.unsafe(nil)); end + + # List teams for a repo + # + # Requires authenticated client that is an owner or collaborator of the repo. + # + # @example + # @client.repository_teams('octokit/pengwynn') + # @example + # @client.repo_teams('octokit/pengwynn') + # @example + # @client.teams('octokit/pengwynn') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of hashes representing teams. + # @see https://developer.github.com/v3/repos/#list-teams + # + # source://octokit//lib/octokit/client/repositories.rb#406 + def repository_teams(repo, options = T.unsafe(nil)); end + + # Hide a public repository + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Sawyer::Resource] Updated repository info + # + # source://octokit//lib/octokit/client/repositories.rb#213 + def set_private(repo, options = T.unsafe(nil)); end + + # Unhide a private repository + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Sawyer::Resource] Updated repository info + # + # source://octokit//lib/octokit/client/repositories.rb#222 + def set_public(repo, options = T.unsafe(nil)); end + + # Star a repository + # + # @param repo [String, Hash, Repository] A GitHub repository + # @return [Boolean] `true` if successfully starred + # @see https://developer.github.com/v3/activity/starring/#star-a-repository + # + # source://octokit//lib/octokit/client/repositories.rb#96 + def star(repo, options = T.unsafe(nil)); end + + # List stargazers of a repo + # + # Requires authenticated client for private repos. + # + # @example + # Octokit.stargazers('octokit/octokit.rb') + # @example + # @client.stargazers('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/activity/starring/#list-stargazers + # + # source://octokit//lib/octokit/client/repositories.rb#474 + def stargazers(repo, options = T.unsafe(nil)); end + + # List watchers subscribing to notifications for a repo + # + # @example + # @client.subscribers("octokit/octokit.rb") + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of users watching. + # @see https://developer.github.com/v3/activity/watching/#list-watchers + # + # source://octokit//lib/octokit/client/repositories.rb#681 + def subscribers(repo, options = T.unsafe(nil)); end + + # Get a repository subscription + # + # @example + # @client.subscription("octokit/octokit.rb") + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Sawyer::Resource] Repository subscription. + # @see https://developer.github.com/v3/activity/watching/#get-a-repository-subscription + # + # source://octokit//lib/octokit/client/repositories.rb#692 + def subscription(repo, options = T.unsafe(nil)); end + + # List tags + # + # Requires authenticated client for private repos. + # + # @example + # Octokit.tags('octokit/octokit.rb') + # @example + # @client.tags('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of hashes representing tags. + # @see https://developer.github.com/v3/repos/#list-tags + # + # source://octokit//lib/octokit/client/repositories.rb#539 + def tags(repo, options = T.unsafe(nil)); end + + # List teams for a repo + # + # Requires authenticated client that is an owner or collaborator of the repo. + # + # @example + # @client.repository_teams('octokit/pengwynn') + # @example + # @client.repo_teams('octokit/pengwynn') + # @example + # @client.teams('octokit/pengwynn') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of hashes representing teams. + # @see https://developer.github.com/v3/repos/#list-teams + # + # source://octokit//lib/octokit/client/repositories.rb#406 + def teams(repo, options = T.unsafe(nil)); end + + # List all topics for a repository + # + # Requires authenticated client for private repos. + # + # @example List topics for octokit/octokit.rb + # Octokit.topics('octokit/octokit.rb') + # @example List topics for octokit/octokit.rb + # client.topics('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Sawyer::Resource] representing the topics for given repo + # @see https://developer.github.com/v3/repos/#list-all-topics-for-a-repository + # + # source://octokit//lib/octokit/client/repositories.rb#423 + def topics(repo, options = T.unsafe(nil)); end + + # Transfer repository + # + # Transfer a repository owned by your organization + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param new_owner [String] The username or organization name the repository will be transferred to. + # @param options [Array] :team_ids ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. + # @return [Sawyer::Resource] Repository info for the transferred repository + # @see https://developer.github.com/v3/repos/#transfer-a-repository + # + # source://octokit//lib/octokit/client/repositories.rb#189 + def transfer_repo(repo, new_owner, options = T.unsafe(nil)); end + + # Transfer repository + # + # Transfer a repository owned by your organization + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param new_owner [String] The username or organization name the repository will be transferred to. + # @param options [Array] :team_ids ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. + # @return [Sawyer::Resource] Repository info for the transferred repository + # @see https://developer.github.com/v3/repos/#transfer-a-repository + # + # source://octokit//lib/octokit/client/repositories.rb#189 + def transfer_repository(repo, new_owner, options = T.unsafe(nil)); end + + # Unlock a single branch from a repository + # + # Requires authenticated client + # + # @example + # @client.unprotect_branch('octokit/octokit.rb', 'master') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param branch [String] Branch name + # @return [Sawyer::Resource] The unprotected branch + # @see https://developer.github.com/v3/repos/#enabling-and-disabling-branch-protection + # + # source://octokit//lib/octokit/client/repositories.rb#622 + def unprotect_branch(repo, branch, options = T.unsafe(nil)); end + + # Unstar a repository + # + # @param repo [String, Hash, Repository] A GitHub repository + # @return [Boolean] `true` if successfully unstarred + # @see https://developer.github.com/v3/activity/starring/#unstar-a-repository + # + # source://octokit//lib/octokit/client/repositories.rb#105 + def unstar(repo, options = T.unsafe(nil)); end + + # Unwatch a repository + # + # @deprecated Use #unstar instead + # @param repo [String, Hash, Repository] A GitHub repository + # @return [Boolean] `true` if successfully unwatched + # @see https://developer.github.com/v3/activity/watching/#stop-watching-a-repository-legacy + # + # source://octokit//lib/octokit/client/repositories.rb#125 + def unwatch(repo, options = T.unsafe(nil)); end + + # Edit a repository + # + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param repo [String, Hash, Repository] A GitHub repository + # @param options [Hash] Repository information to update + # @return [Sawyer::Resource] Repository information + # @see https://developer.github.com/v3/repos/#update-a-repository + # + # source://octokit//lib/octokit/client/repositories.rb#46 + def update(repo, options = T.unsafe(nil)); end + + # Edit a deploy key + # + # @deprecated This method is no longer supported in the API + # @example Update the key for a deploy key. + # @client.edit_deploy_key('octokit/octokit.rb', 8675309, :key => 'ssh-rsa BBB...') + # @example + # @client.update_deploy_key('octokit/octokit.rb', 8675309, :title => 'Uber', :key => 'ssh-rsa BBB...')) + # @option title + # @option key + # @param id [Integer] Deploy key ID. + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param options [Hash] Attributes to edit. + # @param title [Hash] a customizable set of options + # @param key [Hash] a customizable set of options + # @return [Sawyer::Resource] Updated deploy key. + # @see https://developer.github.com/changes/2014-02-24-finer-grained-scopes-for-ssh-keys/ + # @see https://developer.github.com/v3/repos/keys/#edit-a-deploy-key + # + # source://octokit//lib/octokit/client/repositories.rb#285 + def update_deploy_key(repo, id, options); end + + # Edit a repository + # + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param repo [String, Hash, Repository] A GitHub repository + # @param options [Hash] Repository information to update + # @return [Sawyer::Resource] Repository information + # @see https://developer.github.com/v3/repos/#update-a-repository + # + # source://octokit//lib/octokit/client/repositories.rb#46 + def update_repository(repo, options = T.unsafe(nil)); end + + # Update repository subscription + # + # @example Subscribe to notifications for a repository + # @client.update_subscription("octokit/octokit.rb", {subscribed: true}) + # @option options + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param options [Hash] + # @return [Sawyer::Resource] Updated repository subscription. + # @see https://developer.github.com/v3/activity/watching/#set-a-repository-subscription + # + # source://octokit//lib/octokit/client/repositories.rb#709 + def update_subscription(repo, options = T.unsafe(nil)); end + + # Check to see if vulnerability alerts are enabled for a repository + # + # The authenticated user must have admin access to the repository. + # + # @example + # @client.vulnerability_alerts_enabled?("octokit/octokit.rb") + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Boolean] True if vulnerability alerts are enabled, false otherwise. + # @see https://docs.github.com/en/rest/reference/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository + # + # source://octokit//lib/octokit/client/repositories.rb#748 + def vulnerability_alerts_enabled?(repo, options = T.unsafe(nil)); end + + # Watch a repository + # + # @deprecated Use #star instead + # @param repo [String, Hash, Repository] A GitHub repository + # @return [Boolean] `true` if successfully watched + # @see https://developer.github.com/v3/activity/watching/#watch-a-repository-legacy + # + # source://octokit//lib/octokit/client/repositories.rb#115 + def watch(repo, options = T.unsafe(nil)); end + + # List watchers of repo. + # + # Requires authenticated client for private repos. + # + # @deprecated Use {#stargazers} instead + # @example + # Octokit.watchers('octokit/octokit.rb') + # @example + # @client.watchers('octokit/octokit.rb') + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Array] Array of hashes representing users. + # @see https://developer.github.com/v3/repos/watching/#list-watchers + # + # source://octokit//lib/octokit/client/repositories.rb#491 + def watchers(repo, options = T.unsafe(nil)); end +end + +# Methods for the Repository Invitations API +# +# @see https://developer.github.com/v3/repos/invitations/ +# +# source://octokit//lib/octokit/client/repository_invitations.rb#8 +module Octokit::Client::RepositoryInvitations + # Accept a repository invitation + # + # Requires authenticated client + # + # @param invitation_id [Integer] The id of the invitation + # @return [Boolean] True if the acceptance of the invitation was successful + # @see https://developer.github.com/v3/repos/invitations/#accept-a-repository-invitation + # + # source://octokit//lib/octokit/client/repository_invitations.rb#78 + def accept_repo_invitation(invitation_id, options = T.unsafe(nil)); end + + # Accept a repository invitation + # + # Requires authenticated client + # + # @param invitation_id [Integer] The id of the invitation + # @return [Boolean] True if the acceptance of the invitation was successful + # @see https://developer.github.com/v3/repos/invitations/#accept-a-repository-invitation + # + # source://octokit//lib/octokit/client/repository_invitations.rb#78 + def accept_repository_invitation(invitation_id, options = T.unsafe(nil)); end + + # Decline a repository invitation + # + # Requires authenticated client + # + # @param invitation_id [Integer] The id of the invitation + # @return [Boolean] True if the acceptance of the invitation was successful + # @see https://developer.github.com/v3/repos/invitations/#decline-a-repository-invitation + # + # source://octokit//lib/octokit/client/repository_invitations.rb#90 + def decline_invitation(invitation_id, options = T.unsafe(nil)); end + + # Decline a repository invitation + # + # Requires authenticated client + # + # @param invitation_id [Integer] The id of the invitation + # @return [Boolean] True if the acceptance of the invitation was successful + # @see https://developer.github.com/v3/repos/invitations/#decline-a-repository-invitation + # + # source://octokit//lib/octokit/client/repository_invitations.rb#90 + def decline_repository_invitation(invitation_id, options = T.unsafe(nil)); end + + # Delete an invitation for a repository + # + # Requires authenticated client + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param invitation_id [Integer] The id of the invitation + # @return [Boolean] True if the invitation was successfully deleted + # @see https://developer.github.com/v3/repos/invitations/#delete-a-repository-invitation + # + # source://octokit//lib/octokit/client/repository_invitations.rb#42 + def delete_repo_invitation(repo, invitation_id, options = T.unsafe(nil)); end + + # Delete an invitation for a repository + # + # Requires authenticated client + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param invitation_id [Integer] The id of the invitation + # @return [Boolean] True if the invitation was successfully deleted + # @see https://developer.github.com/v3/repos/invitations/#delete-a-repository-invitation + # + # source://octokit//lib/octokit/client/repository_invitations.rb#42 + def delete_repository_invitation(repo, invitation_id, options = T.unsafe(nil)); end + + # Invite a user to a repository + # + # Requires authenticated client + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param user [String] User GitHub username to add + # @return [Sawyer::Resource] The repository invitation + # @see https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator + # + # source://octokit//lib/octokit/client/repository_invitations.rb#17 + def invite_user_to_repo(repo, user, options = T.unsafe(nil)); end + + # Invite a user to a repository + # + # Requires authenticated client + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param user [String] User GitHub username to add + # @return [Sawyer::Resource] The repository invitation + # @see https://developer.github.com/v3/repos/collaborators/#add-user-as-a-collaborator + # + # source://octokit//lib/octokit/client/repository_invitations.rb#17 + def invite_user_to_repository(repo, user, options = T.unsafe(nil)); end + + # List all invitations for a repository + # + # Requires authenticated client + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] A list of invitations + # @see https://developer.github.com/v3/repos/invitations/#list-invitations-for-a-repository + # + # source://octokit//lib/octokit/client/repository_invitations.rb#29 + def repo_invitations(repo, options = T.unsafe(nil)); end + + # List all invitations for a repository + # + # Requires authenticated client + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] A list of invitations + # @see https://developer.github.com/v3/repos/invitations/#list-invitations-for-a-repository + # + # source://octokit//lib/octokit/client/repository_invitations.rb#29 + def repository_invitations(repo, options = T.unsafe(nil)); end + + # Update an invitation for a repository + # + # Requires authenticated client + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param invitation_id [Integer] The id of the invitation + # @return [Sawyer::Resource] The updated repository invitation + # @see https://developer.github.com/v3/repos/invitations/#update-a-repository-invitation + # + # source://octokit//lib/octokit/client/repository_invitations.rb#55 + def update_repo_invitation(repo, invitation_id, options = T.unsafe(nil)); end + + # Update an invitation for a repository + # + # Requires authenticated client + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param invitation_id [Integer] The id of the invitation + # @return [Sawyer::Resource] The updated repository invitation + # @see https://developer.github.com/v3/repos/invitations/#update-a-repository-invitation + # + # source://octokit//lib/octokit/client/repository_invitations.rb#55 + def update_repository_invitation(repo, invitation_id, options = T.unsafe(nil)); end + + # List all repository invitations for the user + # + # Requires authenticated client + # + # @return [Array] The users repository invitations + # @see https://developer.github.com/v3/repos/invitations/#list-a-users-repository-invitations + # + # source://octokit//lib/octokit/client/repository_invitations.rb#66 + def user_repo_invitations(options = T.unsafe(nil)); end + + # List all repository invitations for the user + # + # Requires authenticated client + # + # @return [Array] The users repository invitations + # @see https://developer.github.com/v3/repos/invitations/#list-a-users-repository-invitations + # + # source://octokit//lib/octokit/client/repository_invitations.rb#66 + def user_repository_invitations(options = T.unsafe(nil)); end +end + +# Methods for the Reviews API +# +# @see https://developer.github.com/v3/pulls/reviews/ +# +# source://octokit//lib/octokit/client/reviews.rb#8 +module Octokit::Client::Reviews + # Create a pull request review + # + # @example + # comments = [ + # { path: '.travis.yml', position: 10, body: 'ruby-head is under development that is not stable.' }, + # { path: '.travis.yml', position: 32, body: 'ruby-head is also required in thervm section.' }, + # ] + # options = { event: 'REQUEST_CHANGES', comments: comments } + # @client.create_pull_request_review('octokit/octokit.rb', 844, options) + # @option options + # @option options + # @option options + # @option comments + # @option comments + # @option comments + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number ID of the pull request + # @param options [Hash] Method options + # @param comments [Hash] a customizable set of options + # @return [Sawyer::Resource] ] Hash respresenting the review + # @see https://developer.github.com/v3/pulls/reviews/#create-a-pull-request-review + # + # source://octokit//lib/octokit/client/reviews.rb#92 + def create_pull_request_review(repo, number, options = T.unsafe(nil)); end + + # Delete a pending review + # + # @example + # @client.delete_pull_request_review('octokit/octokit.rb', 825, 6505518) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number ID of the pull request + # @param review [Integer] The id of the review + # @return [Sawyer::Resource] Hash representing the deleted review + # @see https://developer.github.com/v3/pulls/reviews/#delete-a-pending-review + # + # source://octokit//lib/octokit/client/reviews.rb#49 + def delete_pull_request_review(repo, number, review, options = T.unsafe(nil)); end + + # Delete a review request + # + # @example + # options = { + # "reviewers" => [ "octocat", "hubot", "other_user" ], + # "team_reviewers" => [ "justice-league" ] + # } + # @client.delete_pull_request_review_request('octokit/octokit.rb', 2, options) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param id [Integer] The id of the pull request + # @param reviewers [Hash] :reviewers [Array] An array of user logins + # @param options [Hash] :team_reviewers [Array] An array of team slugs + # @return [Sawyer::Resource] ] Hash representing the pull request + # @see https://developer.github.com/v3/pulls/review_requests/#delete-a-review-request + # + # source://octokit//lib/octokit/client/reviews.rb#193 + def delete_pull_request_review_request(repo, id, reviewers = T.unsafe(nil), options = T.unsafe(nil)); end + + # Dismiss a pull request review + # + # @example + # @client.dismiss_pull_request_review('octokit/octokit.rb', 825, 6505518, 'The message.') + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number ID of the pull request + # @param review [Integer] The id of the review + # @param message [String] The message for the pull request review dismissal + # @return [Sawyer::Resource] Hash representing the dismissed review + # @see https://developer.github.com/v3/pulls/reviews/#dismiss-a-pull-request-review + # + # source://octokit//lib/octokit/client/reviews.rb#129 + def dismiss_pull_request_review(repo, number, review, message, options = T.unsafe(nil)); end + + # Get a single review + # + # @example + # @client.pull_request_review('octokit/octokit.rb', 825, 6505518) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number ID of the pull request + # @param review [Integer] The id of the review + # @return [Sawyer::Resource] Hash representing the review + # @see https://developer.github.com/v3/pulls/reviews/#get-a-single-review + # + # source://octokit//lib/octokit/client/reviews.rb#34 + def pull_request_review(repo, number, review, options = T.unsafe(nil)); end + + # Get comments for a single review + # + # @example + # @client.pull_request_review_comments('octokit/octokit.rb', 825, 6505518) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number ID of the pull request + # @param review [Integer] The id of the review + # @return [Array] Array of Hashes representing the review comments + # @see https://developer.github.com/v3/pulls/reviews/#get-comments-for-a-single-review + # + # source://octokit//lib/octokit/client/reviews.rb#64 + def pull_request_review_comments(repo, number, review, options = T.unsafe(nil)); end + + # List review requests + # + # @example + # @client.pull_request_review_requests('octokit/octokit.rb', 2) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number ID of the pull request + # @return [Array] Array of Hashes representing the review requests + # @see https://developer.github.com/v3/pulls/review_requests/#list-review-requests + # + # source://octokit//lib/octokit/client/reviews.rb#144 + def pull_request_review_requests(repo, number, options = T.unsafe(nil)); end + + # List reviews on a pull request + # + # @example + # @client.pull_request_reviews('octokit/octokit.rb', 2) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number ID of the pull request + # @return [Array] Array of Hashes representing the reviews + # @see https://developer.github.com/v3/pulls/reviews/#list-reviews-on-a-pull-request + # + # source://octokit//lib/octokit/client/reviews.rb#19 + def pull_request_reviews(repo, number, options = T.unsafe(nil)); end + + # Create a review request + # + # @example + # @client.request_pull_request_review('octokit/octokit.rb', 2, reviewers: ['soudy']) + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number ID of the pull request + # @param reviewers [Hash] :reviewers [Array] An array of user logins + # @param options [Hash] :team_reviewers [Array] An array of team slugs + # @return [Sawyer::Resource] ] Hash respresenting the pull request + # @see https://developer.github.com/v3/pulls/review_requests/#request-reviewers-for-a-pull-request + # + # source://octokit//lib/octokit/client/reviews.rb#160 + def request_pull_request_review(repo, number, reviewers = T.unsafe(nil), options = T.unsafe(nil)); end + + # Submit a pull request review + # + # @example + # @client.submit_pull_request_review('octokit/octokit.rb', 825, 6505518, + # 'APPROVE', body: 'LGTM!') + # @option options + # @param number [Integer] Number ID of the pull request + # @param event [String] The review action (event) to perform; can be one of + # APPROVE, REQUEST_CHANGES, or COMMENT. + # @param options [Hash] Method options + # @param review [Integer] The id of the review + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @return [Sawyer::Resource] Hash respresenting the review + # @see https://developer.github.com/v3/pulls/reviews/#submit-a-pull-request-review + # + # source://octokit//lib/octokit/client/reviews.rb#112 + def submit_pull_request_review(repo, number, review, event, options = T.unsafe(nil)); end + + # Update a review request comment + # + # @example + # @client.update_pull_request_review('octokit/octokit.rb', 825, 6505518, 'This is close to perfect! Please address the suggested inline change. And add more about this.') + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param number [Integer] Number ID of the pull request + # @param review [Integer] The id of the review + # @param options [Hash] Method options + # @param body [String] body text of the pull request review. + # @return [Sawyer::Resource] Hash representing the review comment + # @see https://developer.github.com/v3/pulls/reviews/#update-a-pull-request-review + # + # source://octokit//lib/octokit/client/reviews.rb#221 + def update_pull_request_review(repo, number, review, body, options = T.unsafe(nil)); end +end + +# Methods for the unpublished Octocat API +# +# source://octokit//lib/octokit/client/say.rb#6 +module Octokit::Client::Say + # Return a nifty ASCII Octocat with GitHub wisdom + # or your own + # + # @return [String] + # + # source://octokit//lib/octokit/client/say.rb#11 + def octocat(text = T.unsafe(nil), options = T.unsafe(nil)); end + + # Return a nifty ASCII Octocat with GitHub wisdom + # or your own + # + # @return [String] + # + # source://octokit//lib/octokit/client/say.rb#11 + def say(text = T.unsafe(nil), options = T.unsafe(nil)); end +end + +# Methods for the Search API +# +# @see https://developer.github.com/v3/search/ +# +# source://octokit//lib/octokit/client/search.rb#8 +module Octokit::Client::Search + # Search code + # + # @option options + # @option options + # @option options + # @option options + # @param query [String] Search term and qualifiers + # @param options [Hash] Sort and pagination options + # @return [Sawyer::Resource] Search results object + # @see https://developer.github.com/v3/search/#search-code + # + # source://octokit//lib/octokit/client/search.rb#19 + def search_code(query, options = T.unsafe(nil)); end + + # Search commits + # + # @option options + # @option options + # @option options + # @option options + # @param query [String] Search terms and qualifiers + # @param options [Hash] Sort and pagination options + # @return [Sawyer::Resource] Search results object + # @see https://developer.github.com/v3/search/#search-commits + # + # source://octokit//lib/octokit/client/search.rb#33 + def search_commits(query, options = T.unsafe(nil)); end + + # Search issues + # + # @option options + # @option options + # @option options + # @option options + # @param query [String] Search term and qualifiers + # @param options [Hash] Sort and pagination options + # @return [Sawyer::Resource] Search results object + # @see https://developer.github.com/v3/search/#search-issues-and-pull-requests + # @see https://docs.github.com/en/rest/search#limitations-on-query-length + # + # source://octokit//lib/octokit/client/search.rb#48 + def search_issues(query, options = T.unsafe(nil)); end + + # Search repositories + # + # @option options + # @option options + # @option options + # @option options + # @param query [String] Search term and qualifiers + # @param options [Hash] Sort and pagination options + # @return [Sawyer::Resource] Search results object + # @see https://developer.github.com/v3/search/#search-repositories + # + # source://octokit//lib/octokit/client/search.rb#62 + def search_repos(query, options = T.unsafe(nil)); end + + # Search repositories + # + # @option options + # @option options + # @option options + # @option options + # @param query [String] Search term and qualifiers + # @param options [Hash] Sort and pagination options + # @return [Sawyer::Resource] Search results object + # @see https://developer.github.com/v3/search/#search-repositories + # + # source://octokit//lib/octokit/client/search.rb#62 + def search_repositories(query, options = T.unsafe(nil)); end + + # Search topics + # + # @option options + # @option options + # @option options + # @option options + # @param query [String] Search term and qualifiers + # @param options [Hash] Sort and pagination options + # @return [Sawyer::Resource] Search results object + # @see https://developer.github.com/v3/search/#search-topics + # + # source://octokit//lib/octokit/client/search.rb#77 + def search_topics(query, options = T.unsafe(nil)); end + + # Search users + # + # @option options + # @option options + # @option options + # @option options + # @param query [String] Search term and qualifiers + # @param options [Hash] Sort and pagination options + # @return [Sawyer::Resource] Search results object + # @see https://developer.github.com/v3/search/#search-users + # + # source://octokit//lib/octokit/client/search.rb#91 + def search_users(query, options = T.unsafe(nil)); end + + private + + # source://octokit//lib/octokit/client/search.rb#97 + def search(path, query, options = T.unsafe(nil)); end +end + +# Methods for the GitHub Status API +# +# @see https://status.github.com/api +# +# source://octokit//lib/octokit/client/service_status.rb#8 +module Octokit::Client::ServiceStatus + # Returns the current system status + # + # @return [Sawyer::Resource] GitHub status + # @see https://www.githubstatus.com/api#status + # + # source://octokit//lib/octokit/client/service_status.rb#27 + def github_status; end + + # Returns the last human communication, status, and timestamp. + # + # @return [Sawyer::Resource] GitHub status last message + # @see https://www.githubstatus.com/api/#components + # + # source://octokit//lib/octokit/client/service_status.rb#35 + def github_status_last_message; end + + # Returns the most recent human communications with status and timestamp. + # + # @return [Array] GitHub status messages + # @see https://www.githubstatus.com/api#components + # + # source://octokit//lib/octokit/client/service_status.rb#43 + def github_status_messages; end + + # Returns a summary with the current status and the last status messages. + # + # @return [] GitHub status summary + # @see https://www.githubstatus.com/api#summory + # + # source://octokit//lib/octokit/client/service_status.rb#19 + def github_status_summary; end +end + +# source://octokit//lib/octokit/client/service_status.rb#13 +Octokit::Client::ServiceStatus::COMPONENTS_ROOT = T.let(T.unsafe(nil), String) + +# source://octokit//lib/octokit/client/service_status.rb#12 +Octokit::Client::ServiceStatus::STATUS_ROOT = T.let(T.unsafe(nil), String) + +# Root for status API +# +# @private +# +# source://octokit//lib/octokit/client/service_status.rb#11 +Octokit::Client::ServiceStatus::SUMMARY_ROOT = T.let(T.unsafe(nil), String) + +# Methods for the Source Import API +# +# @see https://developer.github.com/v3/migration/source_imports +# +# source://octokit//lib/octokit/client/source_import.rb#8 +module Octokit::Client::SourceImport + # Stop an import for a repository. + # + # @example + # @client.cancel_source_import("octokit/octokit.rb") + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Boolean] True if the import has been cancelled, false otherwise. + # @see https://developer.github.com/v3/migration/source_imports/#cancel-an-import + # + # source://octokit//lib/octokit/client/source_import.rb#123 + def cancel_source_import(repo, options = T.unsafe(nil)); end + + # Update an author's identity for the import. + # + # @example + # author_url = "https://api.github.com/repos/octokit/octokit.rb/import/authors/1" + # @client.map_source_import_commit_author(author_url, { + # :email => "hubot@github.com", + # :name => "Hubot the Robot" + # }) + # @option values + # @option values + # @param author_url [String] The source import API url for the commit author + # @param values [Hash] The updated author attributes + # @return [Sawyer::Resource] Hash representing the updated commit author + # @see https://developer.github.com/v3/migration/source_imports/#map-a-commit-author + # + # source://octokit//lib/octokit/client/source_import.rb#110 + def map_source_import_commit_author(author_url, values, options = T.unsafe(nil)); end + + # Set preference for using Git LFS to import files over 100MB + # + # @example + # @client.opt_in_source_import_lfs("octokit/octokit.rb", "opt_in") + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param use_lfs [String] Preference for using Git LFS to import large files. Can be one of "opt_in" or "opt_out" + # @return [Sawyer::Resource] Hash representing the repository import + # @see https://developer.github.com/v3/migration/source_imports/#set-git-lfs-preference + # + # source://octokit//lib/octokit/client/source_import.rb#150 + def set_source_import_lfs_preference(repo, use_lfs, options = T.unsafe(nil)); end + + # List source import commit authors + # + # @example + # @client.source_import_commit_authors("octokit/octokit.rb") + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param options [Hash] + # @return [Array] Array of hashes representing commit_authors. + # @see https://developer.github.com/v3/migration/source_imports/#get-commit-authors + # + # source://octokit//lib/octokit/client/source_import.rb#91 + def source_import_commit_authors(repo, options = T.unsafe(nil)); end + + # List source import large files + # + # @example + # @client.source_import_large_files("octokit/octokit.rb") + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param options [Hash] + # @return [Array] Array of hashes representing files over 100MB. + # @see https://developer.github.com/v3/migration/source_imports/#get-large-files + # + # source://octokit//lib/octokit/client/source_import.rb#137 + def source_import_large_files(repo, options = T.unsafe(nil)); end + + # View the progress of an import. + # + # @example + # @client.source_import_progress("octokit/octokit.rb") + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [Sawyer::Resource] Hash representing the progress of the import + # @see https://developer.github.com/v3/migration/source_imports/#get-import-progress + # + # source://octokit//lib/octokit/client/source_import.rb#57 + def source_import_progress(repo, options = T.unsafe(nil)); end + + # Start a source import to a GitHub repository using GitHub Importer. + # + # @example + # @client.start_source_import("octokit/octokit.rb", "http://svn.mycompany.com/svn/myproject", { + # :vcs => "subversion", + # :vcs_username" => "octocat", + # :vcs_password => "secret" + # }) + # @overload start_source_import + # @overload start_source_import + # @return [Sawyer::Resource] Hash representing the repository import + # @see https://developer.github.com/v3/migration/source_imports/#start-an-import + # + # source://octokit//lib/octokit/client/source_import.rb#37 + def start_source_import(*args); end + + # Update source import with authentication or project choice + # Restart source import if no options are passed + # + # https://developer.github.com/v3/migration/source_imports/#update-existing-import + # + # @example + # @client.update_source_import("octokit/octokit.rb", { + # :vcs_username" => "octocat", + # :vcs_password => "secret" + # }) + # @option options + # @option options + # @option options + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Hash representing the repository import + # @see https://developer.github.com/v3/migration/source_imports/#update-existing-import + # + # source://octokit//lib/octokit/client/source_import.rb#77 + def update_source_import(repo, options = T.unsafe(nil)); end +end + +# Methods for the Repository Statistics API +# +# @see https://developer.github.com/v3/repos/statistics/ +# +# source://octokit//lib/octokit/client/stats.rb#8 +module Octokit::Client::Stats + # Get the number of additions and deletions per week + # + # @example Get code frequency stats for octokit + # @client.code_frequency_stats('octokit/octokit.rb') + # @option retry_timeout + # @option retry_wait + # @param retry_timeout [Hash] a customizable set of options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param retry_wait [Hash] a customizable set of options + # @return [Array] Weekly aggregate of the number of additions + # and deletions pushed to a repository. + # @see https://developer.github.com/v3/repos/statistics/#get-the-number-of-additions-and-deletions-per-week + # + # source://octokit//lib/octokit/client/stats.rb#47 + def code_frequency_stats(repo, options = T.unsafe(nil)); end + + # Get the last year of commit activity data + # + # @example Get commit activity for octokit + # @client.commit_activity_stats('octokit/octokit.rb') + # @option retry_timeout + # @option retry_wait + # @param retry_timeout [Hash] a customizable set of options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param retry_wait [Hash] a customizable set of options + # @return [Array] The last year of commit activity grouped by + # week. The days array is a group of commits per day, starting on Sunday. + # @see https://developer.github.com/v3/repos/statistics/#get-the-last-year-of-commit-activity-data + # + # source://octokit//lib/octokit/client/stats.rb#33 + def commit_activity_stats(repo, options = T.unsafe(nil)); end + + # Get contributors list with additions, deletions, and commit counts + # + # @example Get contributor stats for octokit + # @client.contributors_stats('octokit/octokit.rb') + # @option retry_timeout + # @option retry_wait + # @param retry_timeout [Hash] a customizable set of options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param retry_wait [Hash] a customizable set of options + # @return [Array] Array of contributor stats + # @see https://developer.github.com/v3/repos/statistics/#get-contributors-list-with-additions-deletions-and-commit-counts + # + # source://octokit//lib/octokit/client/stats.rb#18 + def contributor_stats(repo, options = T.unsafe(nil)); end + + # Get contributors list with additions, deletions, and commit counts + # + # @example Get contributor stats for octokit + # @client.contributors_stats('octokit/octokit.rb') + # @option retry_timeout + # @option retry_wait + # @param retry_timeout [Hash] a customizable set of options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param retry_wait [Hash] a customizable set of options + # @return [Array] Array of contributor stats + # @see https://developer.github.com/v3/repos/statistics/#get-contributors-list-with-additions-deletions-and-commit-counts + # + # source://octokit//lib/octokit/client/stats.rb#18 + def contributors_stats(repo, options = T.unsafe(nil)); end + + # Get the weekly commit count for the repo owner and everyone else + # + # @example Get weekly commit counts for octokit + # @client.participation_stats("octokit/octokit.rb") + # @option retry_timeout + # @option retry_wait + # @param retry_timeout [Hash] a customizable set of options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param retry_wait [Hash] a customizable set of options + # @return [Sawyer::Resource] Total commit counts for the owner and total commit + # counts in all. all is everyone combined, including the owner in the last + # 52 weeks. If you’d like to get the commit counts for non-owners, you can + # subtract all from owner. + # @see https://developer.github.com/v3/repos/statistics/#get-the-weekly-commit-count-for-the-repository-owner-and-everyone-else + # + # source://octokit//lib/octokit/client/stats.rb#63 + def participation_stats(repo, options = T.unsafe(nil)); end + + # Get the number of commits per hour in each day + # + # @example Get octokit punch card + # @octokit.punch_card_stats + # @option retry_timeout + # @option retry_wait + # @param retry_timeout [Hash] a customizable set of options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param retry_wait [Hash] a customizable set of options + # @return [Array] Arrays containing the day number, hour number, and + # number of commits + # @see https://developer.github.com/v3/repos/statistics/#get-the-number-of-commits-per-hour-in-each-day + # + # source://octokit//lib/octokit/client/stats.rb#77 + def punch_card(repo, options = T.unsafe(nil)); end + + # Get the number of commits per hour in each day + # + # @example Get octokit punch card + # @octokit.punch_card_stats + # @option retry_timeout + # @option retry_wait + # @param retry_timeout [Hash] a customizable set of options + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param retry_wait [Hash] a customizable set of options + # @return [Array] Arrays containing the day number, hour number, and + # number of commits + # @see https://developer.github.com/v3/repos/statistics/#get-the-number-of-commits-per-hour-in-each-day + # + # source://octokit//lib/octokit/client/stats.rb#77 + def punch_card_stats(repo, options = T.unsafe(nil)); end + + private + + # @param repo [Integer, String, Hash, Repository] A GitHub repository + # @param metric [String] The metrics you are looking for + # @private Get stats for a repository + # @return [Array or nil] Stats in metric-specific format, or nil if not yet calculated. + # @see https://developer.github.com/v3/repos/statistics/ + # + # source://octokit//lib/octokit/client/stats.rb#90 + def get_stats(repo, metric, options = T.unsafe(nil)); end +end + +# Methods for the Commit Statuses API +# +# @see https://developer.github.com/v3/repos/statuses/ +# +# source://octokit//lib/octokit/client/statuses.rb#8 +module Octokit::Client::Statuses + # Get the combined status for a ref + # + # @param repo [Integer, String, Repository, Hash] a GitHub repository + # @param ref [String] A Sha or Ref to fetch the status of + # @return [Sawyer::Resource] The combined status for the commit + # @see https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref + # + # source://octokit//lib/octokit/client/statuses.rb#26 + def combined_status(repo, ref, options = T.unsafe(nil)); end + + # Create status for a commit + # + # @option options + # @option options + # @option options + # @param options [Hash] a customizable set of options + # @param sha [String] The SHA1 for the commit + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param state [String] The state: pending, success, failure, error + # @return [Sawyer::Resource] A status + # @see https://developer.github.com/v3/repos/statuses/#create-a-status + # + # source://octokit//lib/octokit/client/statuses.rb#41 + def create_status(repo, sha, state, options = T.unsafe(nil)); end + + # List all statuses for a given commit + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param sha [String] The SHA1 for the commit + # @return [Array] A list of statuses + # @see https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref + # + # source://octokit//lib/octokit/client/statuses.rb#15 + def list_statuses(repo, sha, options = T.unsafe(nil)); end + + # Get the combined status for a ref + # + # @param repo [Integer, String, Repository, Hash] a GitHub repository + # @param ref [String] A Sha or Ref to fetch the status of + # @return [Sawyer::Resource] The combined status for the commit + # @see https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref + # + # source://octokit//lib/octokit/client/statuses.rb#26 + def status(repo, ref, options = T.unsafe(nil)); end + + # List all statuses for a given commit + # + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @param sha [String] The SHA1 for the commit + # @return [Array] A list of statuses + # @see https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref + # + # source://octokit//lib/octokit/client/statuses.rb#15 + def statuses(repo, sha, options = T.unsafe(nil)); end +end + +# Method to check scopes +# +# @see https://developer.github.com/v3/oauth_authorizations/#oauth-authorizations-api +# +# source://octokit//lib/octokit/client/tokens.rb#8 +module Octokit::Client::Tokens + # Check scopes for a token + # + # @param token [String] GitHub OAuth token + # @param options [Hash] Header params for request + # @raise [ArgumentError] + # @return [Array] OAuth scopes + # @see https://developer.github.com/v3/oauth/#scopes + # + # source://octokit//lib/octokit/client/tokens.rb#15 + def scopes(token = T.unsafe(nil), options = T.unsafe(nil)); end +end + +# Methods for the Traffic API +# +# @see https://developer.github.com/v3/repos/traffic/ +# +# source://octokit//lib/octokit/client/traffic.rb#8 +module Octokit::Client::Traffic + # Get the total number of clones and breakdown per day or week for the + # last 14 days + # + # @example Clones per day + # @client.clones('octokit/octokit.rb') + # @example Clones per week + # @client.clones('octokit/octokit.rb', per: 'week') + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub Repository + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Breakdown of clone stats + # @see https://developer.github.com/v3/repos/traffic/#clones + # + # source://octokit//lib/octokit/client/traffic.rb#59 + def clones(repo, options = T.unsafe(nil)); end + + # Get the top 10 popular contents over the last 14 days + # + # @example + # @client.top_paths('octokit/octokit.rb') + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] List of popular contents + # @see https://developer.github.com/v3/repos/traffic/#list-paths + # + # source://octokit//lib/octokit/client/traffic.rb#27 + def top_paths(repo, options = T.unsafe(nil)); end + + # Get the top 10 referrers over the last 14 days + # + # @example + # @client.top_referrers('octokit/octokit.rb') + # @param repo [Integer, String, Repository, Hash] A GitHub repository + # @return [Array] List of referrers and stats + # @see https://developer.github.com/v3/repos/traffic/#list-referrers + # + # source://octokit//lib/octokit/client/traffic.rb#16 + def top_referrers(repo, options = T.unsafe(nil)); end + + # Get the total number of views and breakdown per day or week for the + # last 14 days + # + # @example Views per day + # @client.views('octokit/octokit.rb') + # @example Views per week + # @client.views('octokit/octokit.rb', per: 'week') + # @option options + # @param repo [Integer, String, Repository, Hash] A GitHub Repository + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Breakdown of view stats + # @see https://developer.github.com/v3/repos/traffic/#views + # + # source://octokit//lib/octokit/client/traffic.rb#43 + def views(repo, options = T.unsafe(nil)); end +end + +# Methods for the Users API +# +# @see https://developer.github.com/v3/users/ +# +# source://octokit//lib/octokit/client/users.rb#8 +module Octokit::Client::Users + # Add email address to user. + # + # Requires authenticated client. + # + # @example + # @client.add_email('new_email@user.com') + # @param email [String] Email address to add to the user. + # @return [Array] Array of all email addresses of the user. + # @see https://developer.github.com/v3/users/emails/#add-email-addresses + # + # source://octokit//lib/octokit/client/users.rb#339 + def add_email(email, _options = T.unsafe(nil)); end + + # Add public key to user account. + # + # Requires authenticated client. + # + # @example + # @client.add_key('Personal projects key', 'ssh-rsa AAA...') + # @param title [String] Title to give reference to the public key. + # @param key [String] Public key. + # @return [Sawyer::Resource] Hash representing the newly added public key. + # @see https://developer.github.com/v3/users/keys/#create-a-public-key + # + # source://octokit//lib/octokit/client/users.rb#282 + def add_key(title, key, options = T.unsafe(nil)); end + + # List all GitHub users + # + # This provides a list of every user, in the order that they signed up + # for GitHub. + # + # @option options + # @param options [Hash] Optional options. + # @return [Array] List of GitHub users. + # @see https://developer.github.com/v3/users/#get-all-users + # + # source://octokit//lib/octokit/client/users.rb#21 + def all_users(options = T.unsafe(nil)); end + + # Deletes a previous migration archive. + # + # Requires authenticated user. + # + # @param id [Integer] ID number of the migration. + # @see https://docs.github.com/en/rest/reference/migrations#delete-a-user-migration-archive + # + # source://octokit//lib/octokit/client/users.rb#425 + def delete_user_migration_archive(id, options = T.unsafe(nil)); end + + # List email addresses for a user. + # + # Requires authenticated client. + # + # @example + # @client.emails + # @return [Array] Array of email addresses. + # @see https://developer.github.com/v3/users/emails/#list-email-addresses-for-a-user + # + # source://octokit//lib/octokit/client/users.rb#326 + def emails(options = T.unsafe(nil)); end + + # Retrieve the access_token. + # + # @example + # Octokit.exchange_code_for_token('aaaa', 'xxxx', 'yyyy', {:accept => 'application/json'}) + # @param code [String] Authorization code generated by GitHub. + # @param app_id [String] Client Id we received when our application was registered with GitHub. Defaults to client_id. + # @param app_secret [String] Client Secret we received when our application was registered with GitHub. Defaults to client_secret. + # @return [Sawyer::Resource] Hash holding the access token. + # @see https://developer.github.com/v3/oauth/#web-application-flow + # + # source://octokit//lib/octokit/client/users.rb#46 + def exchange_code_for_token(code, app_id = T.unsafe(nil), app_secret = T.unsafe(nil), options = T.unsafe(nil)); end + + # Follow a user. + # + # Requires authenticatied client. + # + # @example + # @client.follow('holman') + # @param user [String] Username of the user to follow. + # @return [Boolean] True if follow was successful, false otherwise. + # @see https://developer.github.com/v3/users/followers/#follow-a-user + # + # source://octokit//lib/octokit/client/users.rb#176 + def follow(user, options = T.unsafe(nil)); end + + # Get a user's followers. + # + # @example + # Octokit.followers('pengwynn') + # @param user [Integer, String] GitHub user login or id of the user whose + # list of followers you are getting. + # @return [Array] Array of hashes representing users + # followers. + # @see https://developer.github.com/v3/users/followers/#list-followers-of-a-user + # + # source://octokit//lib/octokit/client/users.rb#126 + def followers(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # Get list of users a user is following. + # + # @example + # Octokit.following('pengwynn') + # @param user [Intger, String] GitHub user login or id of the user who you + # are getting the list of the people they follow. + # @return [Array] Array of hashes representing users a + # user is following. + # @see https://developer.github.com/v3/users/followers/#list-users-followed-by-another-user + # + # source://octokit//lib/octokit/client/users.rb#139 + def following(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # Check if you are following a user. Alternatively, check if a given user + # is following a target user. + # + # Requries an authenticated client. + # + # @example + # @client.follows?('pengwynn') + # @example + # @client.follows?('catsby', 'pengwynn') + # @overload follows? + # @overload follows? + # @return [Boolean] True following target user, false otherwise. + # @see https://developer.github.com/v3/users/followers/#check-if-you-are-following-a-user + # @see https://developer.github.com/v3/users/followers/#check-if-one-user-follows-another + # + # source://octokit//lib/octokit/client/users.rb#161 + def follows?(*args); end + + # Get a public key. + # + # Note, when using dot notation to retrieve the values, ruby will return + # the hash key for the public keys value instead of the actual value, use + # symbol or key string to retrieve the value. See example. + # + # Requires authenticated client. + # + # @example + # @client.key(1) + # @example Retrieve public key contents + # public_key = @client.key(1) + # public_key.key + # # => Error + # + # public_key[:key] + # # => "ssh-rsa AAA..." + # + # public_key['key'] + # # => "ssh-rsa AAA..." + # @param key_id [Integer] Key to retreive. + # @return [Sawyer::Resource] Hash representing the key. + # @see https://developer.github.com/v3/users/keys/#get-a-single-public-key + # + # source://octokit//lib/octokit/client/users.rb#244 + def key(key_id, options = T.unsafe(nil)); end + + # Get list of public keys for user. + # + # Requires authenticated client. + # + # @example + # @client.keys + # @return [Array] Array of hashes representing public keys. + # @see https://developer.github.com/v3/users/keys/#list-your-public-keys + # + # source://octokit//lib/octokit/client/users.rb#256 + def keys(options = T.unsafe(nil)); end + + # Refresh a user's access token with a refresh token. + # + # Applications can refresh an access token without requiring a user to re-authorize using refresh access token. + # + # @example + # client = Octokit::Client.new(:client_id => 'abcdefg12345', :client_secret => 'secret') + # client.refresh_access_token('40-character-refresh-token') + # @param code [String] 40 character GitHub OAuth refresh access token + # @return [Sawyer::Resource] + # @see https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/refreshing-user-access-tokens#refreshing-a-user-access-token-with-a-refresh-token + # + # source://octokit//lib/octokit/client/users.rb#72 + def refresh_access_token(code, app_id = T.unsafe(nil), app_secret = T.unsafe(nil), options = T.unsafe(nil)); end + + # Remove email from user. + # + # Requires authenticated client. + # + # @example + # @client.remove_email('old_email@user.com') + # @param email [String] Email address to remove. + # @return [Array] Array of all email addresses of the user. + # @see https://developer.github.com/v3/users/emails/#delete-email-addresses + # + # source://octokit//lib/octokit/client/users.rb#353 + def remove_email(email); end + + # Remove a public key from user account. + # + # Requires authenticated client. + # + # @example + # @client.remove_key(1) + # @param id [String] Id of the public key to remove. + # @return [Boolean] True if removal was successful, false otherwise. + # @see https://developer.github.com/v3/users/keys/#delete-a-public-key + # + # source://octokit//lib/octokit/client/users.rb#314 + def remove_key(id, options = T.unsafe(nil)); end + + # Get list of repos starred by a user. + # + # @example + # Octokit.starred('pengwynn') + # @option options + # @option options + # @param user [Integer, String] GitHub user login of the user to get the + # list of their starred repositories. + # @param options [Hash] Optional options + # @return [Array] Array of hashes representing repositories starred by user. + # @see https://developer.github.com/v3/activity/starring/#list-repositories-being-starred + # + # source://octokit//lib/octokit/client/users.rb#204 + def starred(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # Check if you are starring a repo. + # + # Requires authenticated client. + # + # @example + # @client.starred?('pengwynn/octokit') + # @param repo [String, Hash, Repository] A GitHub repository + # @return [Boolean] True if you are following the repo, false otherwise. + # @see https://developer.github.com/v3/activity/starring/#check-if-you-are-starring-a-repository + # + # source://octokit//lib/octokit/client/users.rb#217 + def starred?(repo, options = T.unsafe(nil)); end + + # Initiates the generation of a migration archive. + # + # Requires authenticated user. + # + # @example + # @client.start_migration(['octocat/hello-world']) + # @option options + # @option options + # @param repositories [Array] :repositories Repositories for the organization. + # @param options [Hash] a customizable set of options + # @return [Sawyer::Resource] Hash representing the new migration. + # @see https://docs.github.com/en/rest/reference/migrations#start-a-user-migration + # + # source://octokit//lib/octokit/client/users.rb#381 + def start_user_migration(repositories, options = T.unsafe(nil)); end + + # List repositories being watched by a user. + # + # @example + # @client.subscriptions("pengwynn") + # @param user [Integer, String] GitHub user login or id. + # @return [Array] Array of repositories. + # @see https://developer.github.com/v3/activity/watching/#list-repositories-being-watched + # + # source://octokit//lib/octokit/client/users.rb#365 + def subscriptions(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # Unfollow a user. + # + # Requires authenticated client. + # + # @example + # @client.unfollow('holman') + # @param user [String] Username of the user to unfollow. + # @return [Boolean] True if unfollow was successful, false otherwise. + # @see https://developer.github.com/v3/users/followers/#unfollow-a-user + # + # source://octokit//lib/octokit/client/users.rb#189 + def unfollow(user, options = T.unsafe(nil)); end + + # Unlock a user repository which has been locked by a migration. + # + # Requires authenticated user. + # + # @param id [Integer] ID number of the migration. + # @param repo [String] Name of the repository. + # @see https://docs.github.com/en/rest/reference/migrations#unlock-a-user-repository + # + # source://octokit//lib/octokit/client/users.rb#446 + def unlock_user_repository(id, repo, options = T.unsafe(nil)); end + + # Update a public key + # + # Requires authenticated client + # + # @deprecated This method is no longer supported in the API + # @example + # @client.update_key(1, :title => 'new title', :key => "ssh-rsa BBB") + # @option options + # @option options + # @param key_id [Integer] Id of key to update. + # @param options [Hash] Hash containing attributes to update. + # @return [Sawyer::Resource] Hash representing the updated public key. + # @see https://developer.github.com/v3/users/keys/#update-a-public-key + # @see https://developer.github.com/changes/2014-02-24-finer-grained-scopes-for-ssh-keys/ + # + # source://octokit//lib/octokit/client/users.rb#301 + def update_key(key_id, options = T.unsafe(nil)); end + + # Update the authenticated user + # + # @example + # Octokit.update_user(:name => "Erik Michaels-Ober", :email => "sferik@gmail.com", :company => "Code for America", :location => "San Francisco", :hireable => false) + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @option options + # @param options [Hash] A customizable set of options. + # @return [Sawyer::Resource] + # @see https://developer.github.com/v3/users/#update-the-authenticated-user + # + # source://octokit//lib/octokit/client/users.rb#113 + def update_user(options); end + + # Get a single user + # + # @example + # Octokit.user("sferik") + # @param user [Integer, String] GitHub user login or id. + # @return [Sawyer::Resource] + # @see https://developer.github.com/v3/users/#get-a-single-user + # @see https://developer.github.com/v3/users/#get-the-authenticated-user + # + # source://octokit//lib/octokit/client/users.rb#33 + def user(user = T.unsafe(nil), options = T.unsafe(nil)); end + + # Get list of public keys for user. + # + # @example + # @client.user_keys('pengwynn') + # @param user [Integer, String] GitHub user login or id. + # @return [Array] Array of hashes representing public keys. + # @see https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user + # + # source://octokit//lib/octokit/client/users.rb#267 + def user_keys(user, options = T.unsafe(nil)); end + + # Fetches the URL to a migration archive. + # + # Requires authenticated user. + # + # @param id [Integer] ID number of the migration. + # @see https://docs.github.com/en/rest/reference/migrations#download-a-user-migration-archive + # + # source://octokit//lib/octokit/client/users.rb#412 + def user_migration_archive_url(id, options = T.unsafe(nil)); end + + # List repositories for a user migration. + # + # Requires authenticated user. + # + # @param id [Integer] ID number of the migration. + # @see https://docs.github.com/en/rest/reference/migrations#list-repositories-for-a-user-migration + # + # source://octokit//lib/octokit/client/users.rb#435 + def user_migration_repositories(id, options = T.unsafe(nil)); end + + # Fetches the status of a migration. + # + # Requires authenticated user. + # + # @param id [Integer] ID number of the migration. + # @see https://docs.github.com/en/rest/reference/migrations#get-a-user-migration-status + # + # source://octokit//lib/octokit/client/users.rb#402 + def user_migration_status(id, options = T.unsafe(nil)); end + + # Lists the most recent migrations. + # + # Requires authenticated user. + # + # @return [Array] Array of migration resources. + # @see https://docs.github.com/en/rest/reference/migrations#list-user-migrations + # + # source://octokit//lib/octokit/client/users.rb#392 + def user_migrations(options = T.unsafe(nil)); end + + # Validate user username and password + # + # @option options + # @option options + # @param options [Hash] User credentials + # @return [Boolean] True if credentials are valid + # + # source://octokit//lib/octokit/client/users.rb#93 + def validate_credentials(options = T.unsafe(nil)); end + + # List repositories being watched by a user. + # + # @example + # @client.subscriptions("pengwynn") + # @param user [Integer, String] GitHub user login or id. + # @return [Array] Array of repositories. + # @see https://developer.github.com/v3/activity/watching/#list-repositories-being-watched + # + # source://octokit//lib/octokit/client/users.rb#365 + def watched(user = T.unsafe(nil), options = T.unsafe(nil)); end +end + +# Raised on errors in the 400-499 range +# +# source://octokit//lib/octokit/error.rb#229 +class Octokit::ClientError < ::Octokit::Error; end + +# Raised when GitHub returns a 422 HTTP status code +# and body matches 'PullRequestReviewComment' and 'commit_id (or end_commit_oid) is not part of the pull request' +# +# source://octokit//lib/octokit/error.rb#334 +class Octokit::CommitIsNotPartOfPullRequest < ::Octokit::UnprocessableEntity; end + +# Configuration options for {Client}, defaulting to values +# in {Default} +# +# source://octokit//lib/octokit/configurable.rb#6 +module Octokit::Configurable + # Returns the value of attribute access_token. + # + # source://octokit//lib/octokit/configurable.rb#63 + def access_token; end + + # @return [String] OAuth2 access token for authentication + # @see https://developer.github.com/v3/oauth/ + # + # source://octokit//lib/octokit/configurable.rb#63 + def access_token=(_arg0); end + + # @return [String] Base URL for API requests. default: https://api.github.com/ + # + # source://octokit//lib/octokit/configurable.rb#133 + def api_endpoint; end + + # @return [String] Base URL for API requests. default: https://api.github.com/ + # + # source://octokit//lib/octokit/configurable.rb#67 + def api_endpoint=(_arg0); end + + # @return [Boolean] Auto fetch next page of results until rate limit reached + # + # source://octokit//lib/octokit/configurable.rb#63 + def auto_paginate; end + + # @return [Boolean] Auto fetch next page of results until rate limit reached + # + # source://octokit//lib/octokit/configurable.rb#63 + def auto_paginate=(_arg0); end + + # Returns the value of attribute bearer_token. + # + # source://octokit//lib/octokit/configurable.rb#63 + def bearer_token; end + + # @return [String] JWT bearer token for authentication + # @see https://developer.github.com/early-access/integrations/authentication/#as-an-integration + # + # source://octokit//lib/octokit/configurable.rb#63 + def bearer_token=(_arg0); end + + # @return [String] Configure OAuth app key + # @see https://developer.github.com/v3/oauth/ + # + # source://octokit//lib/octokit/configurable.rb#63 + def client_id; end + + # @return [String] Configure OAuth app key + # @see https://developer.github.com/v3/oauth/ + # + # source://octokit//lib/octokit/configurable.rb#63 + def client_id=(_arg0); end + + # Returns the value of attribute client_secret. + # + # source://octokit//lib/octokit/configurable.rb#63 + def client_secret; end + + # @return [String] Configure OAuth app secret + # @see https://developer.github.com/v3/oauth/ + # + # source://octokit//lib/octokit/configurable.rb#63 + def client_secret=(_arg0); end + + # Set configuration options using a block + # + # @yield [_self] + # @yieldparam _self [Octokit::Configurable] the object that the method was called on + # + # source://octokit//lib/octokit/configurable.rb#106 + def configure; end + + # @return [Hash] Configure connection options for Faraday + # @see https://github.com/lostisland/faraday + # + # source://octokit//lib/octokit/configurable.rb#63 + def connection_options; end + + # @return [Hash] Configure connection options for Faraday + # @see https://github.com/lostisland/faraday + # + # source://octokit//lib/octokit/configurable.rb#63 + def connection_options=(_arg0); end + + # @return [String] Configure preferred media type (for API versioning, for example) + # @see https://developer.github.com/v3/media/ + # + # source://octokit//lib/octokit/configurable.rb#63 + def default_media_type; end + + # @return [String] Configure preferred media type (for API versioning, for example) + # @see https://developer.github.com/v3/media/ + # + # source://octokit//lib/octokit/configurable.rb#63 + def default_media_type=(_arg0); end + + # @return [String] GitHub username for Basic Authentication + # + # source://octokit//lib/octokit/configurable.rb#152 + def login; end + + # @return [String] GitHub username for Basic Authentication + # + # source://octokit//lib/octokit/configurable.rb#67 + def login=(_arg0); end + + # @return [String] Base URL for API requests to the GitHub Enterprise Server Manage API + # + # source://octokit//lib/octokit/configurable.rb#141 + def manage_ghes_endpoint; end + + # @return [String] Base URL for API requests to the GitHub Enterprise Server Manage API + # + # source://octokit//lib/octokit/configurable.rb#67 + def manage_ghes_endpoint=(_arg0); end + + # @return [String] API user password for requests to the GitHub Enterprise Server Manage API + # + # source://octokit//lib/octokit/configurable.rb#67 + def manage_ghes_password=(_arg0); end + + # @return [String] API username for requests to the GitHub Enterprise Server Manage API + # + # source://octokit//lib/octokit/configurable.rb#67 + def manage_ghes_username=(_arg0); end + + # @return [String] Base URL for API requests to the GitHub Enterprise management console + # + # source://octokit//lib/octokit/configurable.rb#137 + def management_console_endpoint; end + + # @return [String] Base URL for API requests to the GitHub Enterprise management console + # + # source://octokit//lib/octokit/configurable.rb#67 + def management_console_endpoint=(_arg0); end + + # @return [String] An admin password set up for your GitHub Enterprise management console + # + # source://octokit//lib/octokit/configurable.rb#67 + def management_console_password=(_arg0); end + + # @return [Faraday::Builder or Faraday::RackBuilder] Configure middleware for Faraday + # @see https://github.com/lostisland/faraday + # + # source://octokit//lib/octokit/configurable.rb#63 + def middleware; end + + # @return [Faraday::Builder or Faraday::RackBuilder] Configure middleware for Faraday + # @see https://github.com/lostisland/faraday + # + # source://octokit//lib/octokit/configurable.rb#63 + def middleware=(_arg0); end + + # @return [Boolean] Instruct Octokit to get credentials from .netrc file + # + # source://octokit//lib/octokit/configurable.rb#63 + def netrc; end + + # @return [Boolean] Instruct Octokit to get credentials from .netrc file + # + # source://octokit//lib/octokit/configurable.rb#63 + def netrc=(_arg0); end + + # @return [Boolean] + # + # source://octokit//lib/octokit/configurable.rb#156 + def netrc?; end + + # @return [String] Path to .netrc file. default: ~/.netrc + # + # source://octokit//lib/octokit/configurable.rb#63 + def netrc_file; end + + # @return [String] Path to .netrc file. default: ~/.netrc + # + # source://octokit//lib/octokit/configurable.rb#63 + def netrc_file=(_arg0); end + + # @return [String] GitHub password for Basic Authentication + # + # source://octokit//lib/octokit/configurable.rb#67 + def password=(_arg0); end + + # @return [String] Configure page size for paginated results. API default: 30 + # + # source://octokit//lib/octokit/configurable.rb#63 + def per_page; end + + # @return [String] Configure page size for paginated results. API default: 30 + # + # source://octokit//lib/octokit/configurable.rb#63 + def per_page=(_arg0); end + + # @return [String] URI for proxy server + # @see https://github.com/lostisland/faraday + # + # source://octokit//lib/octokit/configurable.rb#63 + def proxy; end + + # @return [String] URI for proxy server + # @see https://github.com/lostisland/faraday + # + # source://octokit//lib/octokit/configurable.rb#63 + def proxy=(_arg0); end + + # Reset configuration options to default values + # + # source://octokit//lib/octokit/configurable.rb#111 + def reset!; end + + # Compares client options to a Hash of requested options + # + # @param opts [Hash] Options to compare with current client options + # @return [Boolean] + # + # source://octokit//lib/octokit/configurable.rb#129 + def same_options?(opts); end + + # Reset configuration options to default values + # + # source://octokit//lib/octokit/configurable.rb#111 + def setup; end + + # @return [String] SSL verify mode for ssl connections + # @see https://github.com/lostisland/faraday + # + # source://octokit//lib/octokit/configurable.rb#63 + def ssl_verify_mode; end + + # @return [String] SSL verify mode for ssl connections + # @see https://github.com/lostisland/faraday + # + # source://octokit//lib/octokit/configurable.rb#63 + def ssl_verify_mode=(_arg0); end + + # @return [String] Configure User-Agent header for requests. + # + # source://octokit//lib/octokit/configurable.rb#63 + def user_agent; end + + # Sets the attribute user_agent + # + # @param value the value to set the attribute user_agent to. + # + # source://octokit//lib/octokit/configurable.rb#63 + def user_agent=(_arg0); end + + # Base URL for generated web URLs + # + # @return [String] Default: https://github.com/ + # + # source://octokit//lib/octokit/configurable.rb#148 + def web_endpoint; end + + # @return [String] Base URL for web URLs. default: https://github.com/ + # + # source://octokit//lib/octokit/configurable.rb#67 + def web_endpoint=(_arg0); end + + private + + # source://octokit//lib/octokit/configurable.rb#166 + def fetch_client_id_and_secret(overrides = T.unsafe(nil)); end + + # source://octokit//lib/octokit/configurable.rb#162 + def options; end + + class << self + # List of configurable keys for {Octokit::Client} + # + # @return [Array] of option keys + # + # source://octokit//lib/octokit/configurable.rb#76 + def keys; end + end +end + +# Raised when GitHub returns a 409 HTTP status code +# +# source://octokit//lib/octokit/error.rb#321 +class Octokit::Conflict < ::Octokit::ClientError; end + +# Network layer for API clients. +# +# source://octokit//lib/octokit/connection.rb#7 +module Octokit::Connection + include ::Octokit::Authentication + + # Hypermedia agent for the GitHub API + # + # @return [Sawyer::Agent] + # + # source://octokit//lib/octokit/connection.rb#104 + def agent; end + + # Make a HTTP DELETE request + # + # @param url [String] The path, relative to {#api_endpoint} + # @param options [Hash] Query and header params for request + # @return [Sawyer::Resource] + # + # source://octokit//lib/octokit/connection.rb#54 + def delete(url, options = T.unsafe(nil)); end + + # Make a HTTP GET request + # + # @param url [String] The path, relative to {#api_endpoint} + # @param options [Hash] Query and header params for request + # @return [Sawyer::Resource] + # + # source://octokit//lib/octokit/connection.rb#18 + def get(url, options = T.unsafe(nil)); end + + # Make a HTTP HEAD request + # + # @param url [String] The path, relative to {#api_endpoint} + # @param options [Hash] Query and header params for request + # @return [Sawyer::Resource] + # + # source://octokit//lib/octokit/connection.rb#63 + def head(url, options = T.unsafe(nil)); end + + # Response for last HTTP request + # + # @return [Sawyer::Response] + # + # source://octokit//lib/octokit/connection.rb#131 + def last_response; end + + # Make one or more HTTP GET requests, optionally fetching + # the next page of results from URL in Link response header based + # on value in {#auto_paginate}. + # + # @param url [String] The path, relative to {#api_endpoint} + # @param options [Hash] Query and header params for request + # @param block [Block] Block to perform the data concatination of the + # multiple requests. The block is called with two parameters, the first + # contains the contents of the requests so far and the second parameter + # contains the latest response. + # @return [Sawyer::Resource] + # + # source://octokit//lib/octokit/connection.rb#78 + def paginate(url, options = T.unsafe(nil)); end + + # Make a HTTP PATCH request + # + # @param url [String] The path, relative to {#api_endpoint} + # @param options [Hash] Body and header params for request + # @return [Sawyer::Resource] + # + # source://octokit//lib/octokit/connection.rb#45 + def patch(url, options = T.unsafe(nil)); end + + # Make a HTTP POST request + # + # @param url [String] The path, relative to {#api_endpoint} + # @param options [Hash] Body and header params for request + # @return [Sawyer::Resource] + # + # source://octokit//lib/octokit/connection.rb#27 + def post(url, options = T.unsafe(nil)); end + + # Make a HTTP PUT request + # + # @param url [String] The path, relative to {#api_endpoint} + # @param options [Hash] Body and header params for request + # @return [Sawyer::Resource] + # + # source://octokit//lib/octokit/connection.rb#36 + def put(url, options = T.unsafe(nil)); end + + # Fetch the root resource for the API + # + # @return [Sawyer::Resource] + # + # source://octokit//lib/octokit/connection.rb#124 + def root; end + + protected + + # source://octokit//lib/octokit/connection.rb#137 + def endpoint; end + + private + + # Executes the request, checking if it was successful + # + # @return [Boolean] True on success, false otherwise + # + # source://octokit//lib/octokit/connection.rb#166 + def boolean_from_response(method, path, options = T.unsafe(nil)); end + + # source://octokit//lib/octokit/connection.rb#194 + def parse_query_and_convenience_headers(options); end + + # source://octokit//lib/octokit/connection.rb#147 + def request(method, path, data, options = T.unsafe(nil)); end + + # source://octokit//lib/octokit/connection.rb#143 + def reset_agent; end + + # source://octokit//lib/octokit/connection.rb#210 + def response_data_correctly_encoded(response); end + + # source://octokit//lib/octokit/connection.rb#173 + def sawyer_options; end +end + +# Header keys that can be passed in options hash to {#get},{#head} +# +# source://octokit//lib/octokit/connection.rb#11 +Octokit::Connection::CONVENIENCE_HEADERS = T.let(T.unsafe(nil), Set) + +# Default configuration options for {Client} +# +# source://octokit//lib/octokit/default.rb#24 +module Octokit::Default + class << self + # Default access token from ENV + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#64 + def access_token; end + + # Default API endpoint from ENV or {API_ENDPOINT} + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#70 + def api_endpoint; end + + # Default pagination preference from ENV + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#76 + def auto_paginate; end + + # Default bearer token from ENV + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#82 + def bearer_token; end + + # Default OAuth app key from ENV + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#88 + def client_id; end + + # Default OAuth app secret from ENV + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#94 + def client_secret; end + + # Default options for Faraday::Connection + # + # @return [Hash] + # + # source://octokit//lib/octokit/default.rb#130 + def connection_options; end + + # Default media type from ENV or {MEDIA_TYPE} + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#141 + def default_media_type; end + + # Default GitHub username for Basic Auth from ENV + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#147 + def login; end + + # Default GHES Manage API endpoint from ENV + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#112 + def manage_ghes_endpoint; end + + # Default GHES Manage API password from ENV + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#124 + def manage_ghes_password; end + + # Default GHES Manage API username from ENV + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#118 + def manage_ghes_username; end + + # Default management console endpoint from ENV + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#106 + def management_console_endpoint; end + + # Default management console password from ENV + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#100 + def management_console_password; end + + # Default middleware stack for Faraday::Connection + # from {MIDDLEWARE} + # + # @return [Faraday::RackBuilder or Faraday::Builder] + # + # source://octokit//lib/octokit/default.rb#154 + def middleware; end + + # Default behavior for reading .netrc file + # + # @return [Boolean] + # + # source://octokit//lib/octokit/default.rb#201 + def netrc; end + + # Default path for .netrc file + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#207 + def netrc_file; end + + # Configuration options + # + # @return [Hash] + # + # source://octokit//lib/octokit/default.rb#58 + def options; end + + # Default GitHub password for Basic Auth from ENV + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#160 + def password; end + + # Default pagination page size from ENV + # + # @return [Integer] Page size + # + # source://octokit//lib/octokit/default.rb#166 + def per_page; end + + # Default proxy server URI for Faraday connection from ENV + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#174 + def proxy; end + + # Default SSL verify mode from ENV + # + # @return [Integer] + # + # source://octokit//lib/octokit/default.rb#180 + def ssl_verify_mode; end + + # Default User-Agent header string from ENV or {USER_AGENT} + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#189 + def user_agent; end + + # Default web endpoint from ENV or {WEB_ENDPOINT} + # + # @return [String] + # + # source://octokit//lib/octokit/default.rb#195 + def web_endpoint; end + end +end + +# Default API endpoint +# +# source://octokit//lib/octokit/default.rb#26 +Octokit::Default::API_ENDPOINT = T.let(T.unsafe(nil), String) + +# Default media type +# +# source://octokit//lib/octokit/default.rb#32 +Octokit::Default::MEDIA_TYPE = T.let(T.unsafe(nil), String) + +# Default Faraday middleware stack +# +# source://octokit//lib/octokit/default.rb#38 +Octokit::Default::MIDDLEWARE = T.let(T.unsafe(nil), Faraday::RackBuilder) + +# Default User Agent header string +# +# source://octokit//lib/octokit/default.rb#29 +Octokit::Default::USER_AGENT = T.let(T.unsafe(nil), String) + +# Default WEB endpoint +# +# source://octokit//lib/octokit/default.rb#35 +Octokit::Default::WEB_ENDPOINT = T.let(T.unsafe(nil), String) + +# Raised when GHES Manage return a 410 HTTP status code +# +# source://octokit//lib/octokit/error.rb#324 +class Octokit::Deprecated < ::Octokit::ClientError; end + +# EnterpriseAdminClient is only meant to be used by GitHub Enterprise Admins +# and provides access the Admin only API endpoints including Admin Stats, +# Management Console, and the Search Indexing API. +# +# @see Octokit::Client Use Octokit::Client for regular API use for GitHub +# and GitHub Enterprise. +# @see https://developer.github.com/v3/enterprise/ +# +# source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#4 +class Octokit::EnterpriseAdminClient + include ::Octokit::Configurable + include ::Octokit::Authentication + include ::Octokit::Connection + include ::Octokit::Warnable + include ::Octokit::EnterpriseAdminClient::AdminStats + include ::Octokit::EnterpriseAdminClient::License + include ::Octokit::EnterpriseAdminClient::Orgs + include ::Octokit::EnterpriseAdminClient::SearchIndexing + include ::Octokit::EnterpriseAdminClient::Users + + # @return [EnterpriseAdminClient] a new instance of EnterpriseAdminClient + # + # source://octokit//lib/octokit/enterprise_admin_client.rb#30 + def initialize(options = T.unsafe(nil)); end +end + +# Methods for the Enterprise Admin Stats API +# +# @see https://developer.github.com/v3/enterprise-admin/admin_stats/ +# +# source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#8 +module Octokit::EnterpriseAdminClient::AdminStats + # Get only comment-related stats + # + # @example Get only comment-related stats + # @client.admin_comments_stats + # @return [Sawyer::Resource] Only comment-related stats + # + # source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#104 + def admin_comments_stats; end + + # Get only gist-related stats + # + # @example Get only gist-related stats + # @client.admin_gits_stats + # @return [Sawyer::Resource] Only only gist-related stats + # + # source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#95 + def admin_gists_stats; end + + # Get only hooks-related stats + # + # @example Get only hooks-related stats + # @client.admin_hooks_stats + # @return [Sawyer::Resource] Only hooks-related stats + # + # source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#32 + def admin_hooks_stats; end + + # Get only issue-related stats + # + # @example Get only issue-related stats + # @client.admin_issues_stats + # @return [Sawyer::Resource] Only issue-related stats + # + # source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#77 + def admin_issues_stats; end + + # Get only milestone-related stats + # + # @example Get only milestone-related stats + # @client.admin_milestones_stats + # @return [Sawyer::Resource] Only milestone-related stats + # + # source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#86 + def admin_milestones_stats; end + + # Get only organization-related stats + # + # @example Get only organization-related stats + # @client.admin_organization_stats + # @return [Sawyer::Resource] Only organization-related stats + # + # source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#50 + def admin_organization_stats; end + + # Get only pages-related stats + # + # @example Get only pages-related stats + # @client.admin_pages_stats + # @return [Sawyer::Resource] Only pages-related stats + # + # source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#41 + def admin_pages_stats; end + + # Get only pull request-related stats + # + # @example Get only pull request-related stats + # @client.admin_pull_requests_stats + # @return [Sawyer::Resource] Only pull request-related stats + # + # source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#68 + def admin_pull_requests_stats; end + + # Get only repository-related stats + # + # @example Get only repository-related stats + # @client.admin_repository_stats + # @return [Sawyer::Resource] Only repository-related stats + # + # source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#23 + def admin_repository_stats; end + + # Get all available stats + # + # @example Get all available stats + # @client.admin_stats + # @return [Sawyer::Resource] All available stats + # + # source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#14 + def admin_stats; end + + # Get only user-related stats + # + # @example Get only user-related stats + # @client.admin_users_stats + # @return [Sawyer::Resource] Only user-related stats + # + # source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#59 + def admin_users_stats; end + + private + + # @param metric [String] The metrics you are looking for + # @private Get enterprise stats + # @return [Sawyer::Resource] Magical unicorn stats + # + # source://octokit//lib/octokit/enterprise_admin_client/admin_stats.rb#114 + def get_admin_stats(metric); end +end + +# source://octokit//lib/octokit/enterprise_admin_client/license.rb#8 +module Octokit::EnterpriseAdminClient::License + # source://octokit//lib/octokit/enterprise_admin_client/license.rb#12 + def license_info; end +end + +# Methods for the Enterprise Orgs API +# +# @see https://developer.github.com/v3/enterprise-admin/orgs/ +# +# source://octokit//lib/octokit/enterprise_admin_client/orgs.rb#8 +module Octokit::EnterpriseAdminClient::Orgs + # Create a new organization on the instance. + # + # @example + # @admin_client.create_organization('SuchAGreatOrg', 'gjtorikian') + # @option options + # @param login [String] The organization's username. + # @param admin [String] The login of the user who will manage this organization. + # @param options [Hash] A set of options. + # @return [nil] + # @see https://developer.github.com/v3/enterprise-admin/orgs/#create-an-organization + # + # source://octokit//lib/octokit/enterprise_admin_client/orgs.rb#19 + def create_organization(login, admin, options = T.unsafe(nil)); end +end + +# Methods for the Enterprise Search Indexing API +# +# @see https://developer.github.com/v3/enterprise-admin/search_indexing/ +# +# source://octokit//lib/octokit/enterprise_admin_client/search_indexing.rb#8 +module Octokit::EnterpriseAdminClient::SearchIndexing + # Queue a User or Organization to be indexed + # + # @param user [String] A GitHub Enterprise user or organization + # @return [Sawyer:Resource] Result of the queuing containing `:message` + # + # source://octokit//lib/octokit/enterprise_admin_client/search_indexing.rb#13 + def index_organization(user); end + + # Queue a user's or organization's repositories to be indexed + # + # @param user [String] A GitHub Enterprise user or organization + # @return [Sawyer:Resource] Result of the queuing containing `:message` + # + # source://octokit//lib/octokit/enterprise_admin_client/search_indexing.rb#46 + def index_organizations_repositories(user); end + + # Queue an index of all the code contained in all of a user's or + # organization's repositories + # + # @param user [String] A GitHub Enterprise user or organization + # @return [Sawyer:Resource] Result of the queuing containing `:message` + # + # source://octokit//lib/octokit/enterprise_admin_client/search_indexing.rb#66 + def index_organizations_repositories_code(user); end + + # Queue an index of all the issues across all of a user's or + # organization's repositories + # + # @param user [String] A GitHub Enterprise user or organization + # @return [Sawyer:Resource] Result of the queuing containing `:message` + # + # source://octokit//lib/octokit/enterprise_admin_client/search_indexing.rb#56 + def index_organizations_repositories_issues(user); end + + # Queue a Repository to be indexed + # + # @param repo [String, Hash, Repository] A GitHub repository + # @return [Sawyer:Resource] Result of the queuing containing `:message` + # + # source://octokit//lib/octokit/enterprise_admin_client/search_indexing.rb#22 + def index_repository(repo); end + + # Queue a repository's code to be indexed + # + # @param repo [String, Hash, Repository] A GitHub repository + # @return [Sawyer:Resource] Result of the queuing containing `:message` + # + # source://octokit//lib/octokit/enterprise_admin_client/search_indexing.rb#38 + def index_repository_code(repo); end + + # Queue a repository's Issues to be indexed + # + # @param repo [String, Hash, Repository] A GitHub repository + # @return [Sawyer:Resource] Result of the queuing containing `:message` + # + # source://octokit//lib/octokit/enterprise_admin_client/search_indexing.rb#30 + def index_repository_issues(repo); end + + # Queue a User or Organization to be indexed + # + # @param user [String] A GitHub Enterprise user or organization + # @return [Sawyer:Resource] Result of the queuing containing `:message` + # + # source://octokit//lib/octokit/enterprise_admin_client/search_indexing.rb#13 + def index_user(user); end + + # Queue a user's or organization's repositories to be indexed + # + # @param user [String] A GitHub Enterprise user or organization + # @return [Sawyer:Resource] Result of the queuing containing `:message` + # + # source://octokit//lib/octokit/enterprise_admin_client/search_indexing.rb#46 + def index_users_repositories(user); end + + # Queue an index of all the code contained in all of a user's or + # organization's repositories + # + # @param user [String] A GitHub Enterprise user or organization + # @return [Sawyer:Resource] Result of the queuing containing `:message` + # + # source://octokit//lib/octokit/enterprise_admin_client/search_indexing.rb#66 + def index_users_repositories_code(user); end + + # Queue an index of all the issues across all of a user's or + # organization's repositories + # + # @param user [String] A GitHub Enterprise user or organization + # @return [Sawyer:Resource] Result of the queuing containing `:message` + # + # source://octokit//lib/octokit/enterprise_admin_client/search_indexing.rb#56 + def index_users_repositories_issues(user); end + + private + + # @param target [String] Target to index + # @private Queue a target for indexing + # @return [Sawyer:Resource] Result of the queuing containing `:message` + # + # source://octokit//lib/octokit/enterprise_admin_client/search_indexing.rb#77 + def queue_index(target); end +end + +# Methods for the Enterprise User Administration API +# +# @see https://developer.github.com/enterprise/v3/enterprise-admin/users/ +# +# source://octokit//lib/octokit/enterprise_admin_client/users.rb#8 +module Octokit::EnterpriseAdminClient::Users + # Creates an impersonation OAuth token. + # + # @example + # @admin_client.create_impersonation_token('foobar', {:scopes => ['repo:write']}) + # @param login [String] The user to create a token for. + # @param options [Array] :scopes The scopes to apply. + # @see https://developer.github.com/enterprise/v3/enterprise-admin/users/#create-an-impersonation-oauth-token + # + # source://octokit//lib/octokit/enterprise_admin_client/users.rb#95 + def create_impersonation_token(login, options = T.unsafe(nil)); end + + # Create a new user. + # + # @example + # @admin_client.create_user('foobar', 'notreal@foo.bar') + # @param login [String] The user's username. + # @param email [String] The user's email address. + # @see https://developer.github.com/enterprise/v3/enterprise-admin/users#create-a-new-user + # + # source://octokit//lib/octokit/enterprise_admin_client/users.rb#16 + def create_user(login, email, options = T.unsafe(nil)); end + + # Deletes an impersonation OAuth token. + # + # @example + # @admin_client.delete_impersonation_token('foobar') + # @param login [String] The user whose token should be deleted. + # @see https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-an-impersonation-oauth-token + # + # source://octokit//lib/octokit/enterprise_admin_client/users.rb#105 + def delete_impersonation_token(login, options = T.unsafe(nil)); end + + # Deletes a public SSH keys. + # + # @example + # @admin_client.delete_key(1) + # @param id [Number] The ID of the key to delete. + # @see https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-a-public-key + # + # source://octokit//lib/octokit/enterprise_admin_client/users.rb#124 + def delete_key(id, options = T.unsafe(nil)); end + + # Deletes a user. + # + # @example + # @admin_client.delete_key(1) + # @param username [String] The username to delete. + # @see https://developer.github.com/enterprise/v3/enterprise-admin/users/#delete-a-user + # + # source://octokit//lib/octokit/enterprise_admin_client/users.rb#62 + def delete_user(username, options = T.unsafe(nil)); end + + # Demote a site administrator to an ordinary user + # + # @example + # @admin_client.demote('holman') + # @param user [String] Username of the user to demote. + # @return [Boolean] True if demote was successful, false otherwise. + # @see https://developer.github.com/enterprise/v3/enterprise-admin/users/#demote-a-site-administrator-to-an-ordinary-user + # + # source://octokit//lib/octokit/enterprise_admin_client/users.rb#40 + def demote(user, options = T.unsafe(nil)); end + + # Lists all the public SSH keys. + # + # @example + # @admin_client.list_all_keys + # @see https://developer.github.com/enterprise/v3/enterprise-admin/users/#list-all-public-keys + # + # source://octokit//lib/octokit/enterprise_admin_client/users.rb#114 + def list_all_keys(options = T.unsafe(nil)); end + + # Promote an ordinary user to a site administrator + # + # @example + # @admin_client.promote('holman') + # @param user [String] Username of the user to promote. + # @return [Boolean] True if promote was successful, false otherwise. + # @see https://developer.github.com/enterprise/v3/enterprise-admin/users/#promote-an-ordinary-user-to-a-site-administrator + # + # source://octokit//lib/octokit/enterprise_admin_client/users.rb#29 + def promote(user, options = T.unsafe(nil)); end + + # Rename a user. + # + # @example + # @admin_client.rename_user('foobar', 'foofoobar') + # @param old_login [String] The user's old username. + # @param new_login [String] The user's new username. + # @see https://developer.github.com/enterprise/v3/enterprise-admin/users/#rename-an-existing-user + # + # source://octokit//lib/octokit/enterprise_admin_client/users.rb#51 + def rename_user(old_login, new_login, options = T.unsafe(nil)); end + + # Suspend a user. + # + # @example + # @admin_client.suspend('holman') + # @param user [String] Username of the user to suspend. + # @return [Boolean] True if suspend was successful, false otherwise. + # @see https://developer.github.com/enterprise/v3/enterprise-admin/users/#suspend-a-user + # + # source://octokit//lib/octokit/enterprise_admin_client/users.rb#73 + def suspend(user, options = T.unsafe(nil)); end + + # Unsuspend a user. + # + # @example + # @admin_client.unsuspend('holman') + # @param user [String] Username of the user to unsuspend. + # @return [Boolean] True if unsuspend was successful, false otherwise. + # @see https://developer.github.com/enterprise/v3/enterprise-admin/users/#unsuspend-a-user + # + # source://octokit//lib/octokit/enterprise_admin_client/users.rb#84 + def unsuspend(user, options = T.unsafe(nil)); end +end + +# EnterpriseManagementConsoleClient is only meant to be used by GitHub Enterprise Admins +# and provides access to the management console API endpoints. +# +# @see Octokit::Client Use Octokit::Client for regular API use for GitHub +# and GitHub Enterprise. +# @see https://developer.github.com/v3/enterprise-admin/management_console/ +# +# source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#4 +class Octokit::EnterpriseManagementConsoleClient + include ::Octokit::Configurable + include ::Octokit::Authentication + include ::Octokit::Connection + include ::Octokit::Warnable + include ::Octokit::EnterpriseManagementConsoleClient::ManagementConsole + + # @return [EnterpriseManagementConsoleClient] a new instance of EnterpriseManagementConsoleClient + # + # source://octokit//lib/octokit/enterprise_management_console_client.rb#21 + def initialize(options = T.unsafe(nil)); end + + protected + + # source://octokit//lib/octokit/enterprise_management_console_client.rb#36 + def endpoint; end + + # Set Enterprise Management Console endpoint + # + # @param value [String] Management console endpoint + # + # source://octokit//lib/octokit/enterprise_management_console_client.rb#51 + def management_console_endpoint=(value); end + + # Set Enterprise Management Console password + # + # @param value [String] Management console admin password + # + # source://octokit//lib/octokit/enterprise_management_console_client.rb#43 + def management_console_password=(value); end + + private + + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#171 + def faraday_configuration; end + + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#165 + def password_hash; end +end + +# Methods for the Enterprise Management Console API +# +# @see https://developer.github.com/v3/enterprise-admin/management_console/ +# +# source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#8 +module Octokit::EnterpriseManagementConsoleClient::ManagementConsole + # Add an authorized SSH keys on the Enterprise install + # + # @param key Either the file path to a key, a File handler to the key, or the contents of the key itself + # @return [Sawyer::Resource] An array of authorized SSH keys + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#115 + def add_authorized_key(key); end + + # Fetch the authorized SSH keys on the Enterprise install + # + # @return [Sawyer::Resource] An array of authorized SSH keys + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#105 + def authorized_keys; end + + # Get information about the Enterprise installation + # + # @return [Sawyer::Resource] The installation information + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#54 + def config_check; end + + # Get information about the Enterprise installation + # + # @return [Sawyer::Resource] The installation information + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#54 + def config_status; end + + # Removes an authorized SSH keys from the Enterprise install + # + # @param key Either the file path to a key, a File handler to the key, or the contents of the key itself + # @return [Sawyer::Resource] An array of authorized SSH keys + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#140 + def delete_authorized_key(key); end + + # Start (or turn off) the Enterprise maintenance mode + # + # @param maintenance [Hash] A hash configuration of the maintenance settings + # @return [nil] + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#94 + def edit_maintenance_status(maintenance); end + + # Modify the Enterprise settings + # + # @param settings [Hash] A hash configuration of the new settings + # @return [nil] + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#74 + def edit_settings(settings); end + + # Fetch the authorized SSH keys on the Enterprise install + # + # @return [Sawyer::Resource] An array of authorized SSH keys + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#105 + def get_authorized_keys; end + + # Get information about the Enterprise maintenance status + # + # @return [Sawyer::Resource] The maintenance status + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#84 + def get_maintenance_status; end + + # Get information about the Enterprise installation + # + # @return [Sawyer::Resource] The settings + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#63 + def get_settings; end + + # Get information about the Enterprise maintenance status + # + # @return [Sawyer::Resource] The maintenance status + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#84 + def maintenance_status; end + + # Removes an authorized SSH keys from the Enterprise install + # + # @param key Either the file path to a key, a File handler to the key, or the contents of the key itself + # @return [Sawyer::Resource] An array of authorized SSH keys + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#140 + def remove_authorized_key(key); end + + # Start (or turn off) the Enterprise maintenance mode + # + # @param maintenance [Hash] A hash configuration of the maintenance settings + # @return [nil] + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#94 + def set_maintenance_status(maintenance); end + + # Get information about the Enterprise installation + # + # @return [Sawyer::Resource] The settings + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#63 + def settings; end + + # Start a configuration process. + # + # @return nil + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#31 + def start_configuration; end + + # Upgrade an Enterprise installation + # + # @param license [String] The path to your .ghl license file. + # @return nil + # + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#41 + def upgrade(license); end + + # source://octokit//lib/octokit/enterprise_management_console_client/management_console.rb#16 + def upload_license(license, settings = T.unsafe(nil)); end +end + +# Custom error class for rescuing from all GitHub errors +# +# source://octokit//lib/octokit/error.rb#5 +class Octokit::Error < ::StandardError + # @return [Error] a new instance of Error + # + # source://octokit//lib/octokit/error.rb#49 + def initialize(response = T.unsafe(nil)); end + + # source://octokit//lib/octokit/error.rb#43 + def build_error_context; end + + # Returns the value of attribute context. + # + # source://octokit//lib/octokit/error.rb#6 + def context; end + + # Documentation URL returned by the API for some errors + # + # @return [String] + # + # source://octokit//lib/octokit/error.rb#58 + def documentation_url; end + + # Array of validation errors + # + # @return [Array] Error info + # + # source://octokit//lib/octokit/error.rb#132 + def errors; end + + # Body returned by the GitHub server. + # + # @return [String] + # + # source://octokit//lib/octokit/error.rb#157 + def response_body; end + + # Headers returned by the GitHub server. + # + # @return [Hash] + # + # source://octokit//lib/octokit/error.rb#150 + def response_headers; end + + # Status code returned by the GitHub server. + # + # @return [Integer] + # + # source://octokit//lib/octokit/error.rb#143 + def response_status; end + + private + + # source://octokit//lib/octokit/error.rb#205 + def build_error_message; end + + # source://octokit//lib/octokit/error.rb#163 + def data; end + + # source://octokit//lib/octokit/error.rb#218 + def redact_url(url_string); end + + # source://octokit//lib/octokit/error.rb#186 + def response_error; end + + # source://octokit//lib/octokit/error.rb#190 + def response_error_summary; end + + # source://octokit//lib/octokit/error.rb#177 + def response_message; end + + class << self + # Returns most appropriate error for 401 HTTP status code + # + # @private + # + # source://octokit//lib/octokit/error.rb#65 + def error_for_401(headers); end + + # Returns most appropriate error for 403 HTTP status code + # + # @private + # + # source://octokit//lib/octokit/error.rb#76 + def error_for_403(body); end + + # Return most appropriate error for 404 HTTP status code + # + # @private + # + # source://octokit//lib/octokit/error.rb#107 + def error_for_404(body); end + + # Return most appropriate error for 422 HTTP status code + # + # @private + # + # source://octokit//lib/octokit/error.rb#119 + def error_for_422(body); end + + # Returns the appropriate Octokit::Error subclass based + # on status and response message + # + # + # @param response [Hash] HTTP response + # @return [Octokit::Error] + # + # source://octokit//lib/octokit/error.rb#14 + def from_response(response); end + end +end + +# Raised when GitHub returns a 403 HTTP status code +# +# source://octokit//lib/octokit/error.rb#265 +class Octokit::Forbidden < ::Octokit::ClientError; end + +# Class to parse and create Gist URLs +# +# source://octokit//lib/octokit/gist.rb#5 +class Octokit::Gist + # @return [Gist] a new instance of Gist + # + # source://octokit//lib/octokit/gist.rb#16 + def initialize(gist); end + + # !@attribute id + # @return [String] Gist ID + # + # source://octokit//lib/octokit/gist.rb#8 + def id; end + + # !@attribute id + # @return [String] Gist ID + # + # source://octokit//lib/octokit/gist.rb#8 + def id=(_arg0); end + + # Gist ID + # + # @return [String] + # + # source://octokit//lib/octokit/gist.rb#25 + def to_s; end + + # Gist URL + # + # @return [String] + # + # source://octokit//lib/octokit/gist.rb#31 + def url; end + + class << self + # Instantiate {Gist} object from Gist URL + # @ return [Gist] + # + # source://octokit//lib/octokit/gist.rb#12 + def from_url(url); end + end +end + +# Raised when GitHub returns a 403 HTTP status code +# and body matches 'suspended your access' +# +# source://octokit//lib/octokit/error.rb#305 +class Octokit::InstallationSuspended < ::Octokit::Forbidden; end + +# Raised when GitHub returns a 500 HTTP status code +# +# source://octokit//lib/octokit/error.rb#347 +class Octokit::InternalServerError < ::Octokit::ServerError; end + +# Raised when a repository is created with an invalid format +# +# source://octokit//lib/octokit/error.rb#366 +class Octokit::InvalidRepository < ::ArgumentError; end + +# Current major release. +# +# @return [Integer] +# +# source://octokit//lib/octokit/version.rb#6 +Octokit::MAJOR = T.let(T.unsafe(nil), Integer) + +# Current minor release. +# +# @return [Integer] +# +# source://octokit//lib/octokit/version.rb#10 +Octokit::MINOR = T.let(T.unsafe(nil), Integer) + +# ManageGHESClient is only meant to be used by GitHub Enterprise Server (GHES) operators +# and provides access to the Manage GHES API endpoints. +# +# @see Octokit::Client Use Octokit::Client for regular API use for GitHub +# and GitHub Enterprise. +# @see https://developer.github.com/v3/enterprise-admin/manage-ghes/ +# +# source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#5 +class Octokit::ManageGHESClient + include ::Octokit::Configurable + include ::Octokit::Authentication + include ::Octokit::Connection + include ::Octokit::Warnable + include ::Octokit::ManageGHESClient::ManageAPI + + # @return [ManageGHESClient] a new instance of ManageGHESClient + # + # source://octokit//lib/octokit/manage_ghes_client.rb#21 + def initialize(options = T.unsafe(nil)); end + + # Add an authorized SSH keys on the Enterprise install + # + # @param key Either the file path to a key, a File handler to the key, or the contents of the key itself + # @return [nil] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#92 + def add_authorized_key(key); end + + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#82 + def authorized_keys; end + + # Get information about the Enterprise installation + # + # @return [nil] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#57 + def config_check; end + + # Get information about the Enterprise installation + # + # @return [nil] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#57 + def config_status; end + + # Removes an authorized SSH keys from the Enterprise install + # + # @param key Either the file path to a key, a File handler to the key, or the contents of the key itself + # @return [nil] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#117 + def delete_authorized_key(key); end + + # Modify the Enterprise settings + # + # @param settings [Hash] A hash configuration of the new settings + # @return [nil] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#77 + def edit_settings(settings); end + + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#82 + def get_authorized_keys; end + + # Get information about the Enterprise installation + # + # @return [nil] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#66 + def get_settings; end + + # Removes an authorized SSH keys from the Enterprise install + # + # @param key Either the file path to a key, a File handler to the key, or the contents of the key itself + # @return [nil] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#117 + def remove_authorized_key(key); end + + # Get information about the Enterprise installation + # + # @return [nil] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#66 + def settings; end + + # Start a configuration process. + # + # @return [nil] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#49 + def start_configuration; end + + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#37 + def upload_license(license); end + + protected + + # source://octokit//lib/octokit/manage_ghes_client.rb#36 + def endpoint; end + + # Set Manage GHES API endpoint + # + # @param value [String] Manage GHES API endpoint + # + # source://octokit//lib/octokit/manage_ghes_client.rb#43 + def manage_ghes_endpoint=(value); end + + # Set Manage GHES API password + # + # @param value [String] Manage GHES API password + # + # source://octokit//lib/octokit/manage_ghes_client.rb#59 + def manage_ghes_password=(value); end + + # Set Manage GHES API username + # + # @param value [String] Manage GHES API username + # + # source://octokit//lib/octokit/manage_ghes_client.rb#51 + def manage_ghes_username=(value); end + + private + + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#150 + def authenticated_client; end + + # @return [Boolean] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#141 + def basic_authenticated?; end + + # If no username is provided, we assume root site admin should be used + # + # @return [Boolean] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#146 + def root_site_admin_assumed?; end +end + +# Methods for the Manage GitHub Enterprise Server API +# +# @see https://developer.github.com/v3/enterprise-admin/manage-ghes +# +# source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#9 +module Octokit::ManageGHESClient::ManageAPI + # Configure the maintenance mode of the GHES instance + # + # @param maintenance [Hash] A hash configuration of the maintenance mode status + # @return [nil] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#23 + def configure_maintenance_mode(enabled, options = T.unsafe(nil)); end + + # Get information about the maintenance status of the GHES instance + # + # @return [nil] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#13 + def maintenance_mode; end + + # Configure the maintenance mode of the GHES instance + # + # @param maintenance [Hash] A hash configuration of the maintenance mode status + # @return [nil] + # + # source://octokit//lib/octokit/manage_ghes_client/manage_ghes.rb#23 + def set_maintenance_mode(enabled, options = T.unsafe(nil)); end +end + +# Raised when GitHub returns a 405 HTTP status code +# +# source://octokit//lib/octokit/error.rb#315 +class Octokit::MethodNotAllowed < ::Octokit::ClientError; end + +# source://octokit//lib/octokit/middleware/follow_redirects.rb#12 +module Octokit::Middleware; end + +# Public: Follow HTTP 301, 302, 303, and 307 redirects. +# +# For HTTP 303, the original GET, POST, PUT, DELETE, or PATCH request gets +# converted into a GET. For HTTP 301, 302, and 307, the HTTP method remains +# unchanged. +# +# This middleware currently only works with synchronous requests; i.e. it +# doesn't support parallelism. +# +# source://octokit//lib/octokit/middleware/follow_redirects.rb#31 +class Octokit::Middleware::FollowRedirects < ::Faraday::Middleware + # Public: Initialize the middleware. + # + # options - An options Hash (default: {}): + # :limit - A Integer redirect limit (default: 3). + # + # @return [FollowRedirects] a new instance of FollowRedirects + # + # source://octokit//lib/octokit/middleware/follow_redirects.rb#53 + def initialize(app, options = T.unsafe(nil)); end + + # source://octokit//lib/octokit/middleware/follow_redirects.rb#60 + def call(env); end + + private + + # @return [Boolean] + # + # source://octokit//lib/octokit/middleware/follow_redirects.rb#66 + def convert_to_get?(response); end + + # source://octokit//lib/octokit/middleware/follow_redirects.rb#113 + def follow_limit; end + + # @return [Boolean] + # + # source://octokit//lib/octokit/middleware/follow_redirects.rb#108 + def follow_redirect?(env, response); end + + # source://octokit//lib/octokit/middleware/follow_redirects.rb#71 + def perform_with_redirection(env, follows); end + + # Internal: Escapes unsafe characters from a URL which might be a path + # component only or a fully-qualified URI so that it can be joined onto a + # URI:HTTP using the `+` operator. Doesn't escape "%" characters so to not + # risk double-escaping. + # + # source://octokit//lib/octokit/middleware/follow_redirects.rb#128 + def safe_escape(uri); end + + # @return [Boolean] + # + # source://octokit//lib/octokit/middleware/follow_redirects.rb#117 + def same_host?(original_url, redirect_url); end + + # source://octokit//lib/octokit/middleware/follow_redirects.rb#86 + def update_env(env, request_body, response); end +end + +# HTTP methods for which 30x redirects can be followed +# +# source://octokit//lib/octokit/middleware/follow_redirects.rb#33 +Octokit::Middleware::FollowRedirects::ALLOWED_METHODS = T.let(T.unsafe(nil), Set) + +# Keys in env hash which will get cleared between requests +# +# source://octokit//lib/octokit/middleware/follow_redirects.rb#39 +Octokit::Middleware::FollowRedirects::ENV_TO_CLEAR = T.let(T.unsafe(nil), Set) + +# Default value for max redirects followed +# +# source://octokit//lib/octokit/middleware/follow_redirects.rb#42 +Octokit::Middleware::FollowRedirects::FOLLOW_LIMIT = T.let(T.unsafe(nil), Integer) + +# HTTP redirect status codes that this middleware implements +# +# source://octokit//lib/octokit/middleware/follow_redirects.rb#36 +Octokit::Middleware::FollowRedirects::REDIRECT_CODES = T.let(T.unsafe(nil), Set) + +# Regex that matches characters that need to be escaped in URLs, sans +# the "%" character which we assume already represents an escaped +# sequence. +# +# source://octokit//lib/octokit/middleware/follow_redirects.rb#47 +Octokit::Middleware::FollowRedirects::URI_UNSAFE = T.let(T.unsafe(nil), Regexp) + +# Public: Exception thrown when the maximum amount of requests is exceeded. +# +# source://octokit//lib/octokit/middleware/follow_redirects.rb#14 +class Octokit::Middleware::RedirectLimitReached < ::Faraday::ClientError + # @return [RedirectLimitReached] a new instance of RedirectLimitReached + # + # source://octokit//lib/octokit/middleware/follow_redirects.rb#17 + def initialize(response); end + + # Returns the value of attribute response. + # + # source://octokit//lib/octokit/middleware/follow_redirects.rb#15 + def response; end +end + +# Raised when client fails to provide valid Content-Type +# +# source://octokit//lib/octokit/error.rb#359 +class Octokit::MissingContentType < ::ArgumentError; end + +# Raised when GitHub returns a 406 HTTP status code +# +# source://octokit//lib/octokit/error.rb#318 +class Octokit::NotAcceptable < ::Octokit::ClientError; end + +# Raised when GitHub returns a 404 HTTP status code +# +# source://octokit//lib/octokit/error.rb#308 +class Octokit::NotFound < ::Octokit::ClientError; end + +# Raised when GitHub returns a 501 HTTP status code +# +# source://octokit//lib/octokit/error.rb#350 +class Octokit::NotImplemented < ::Octokit::ServerError; end + +# Raised when GitHub returns a 401 HTTP status code +# and headers include "X-GitHub-OTP" +# +# source://octokit//lib/octokit/error.rb#239 +class Octokit::OneTimePasswordRequired < ::Octokit::ClientError + # Delivery method for the user's OTP + # + # @return [String] + # + # source://octokit//lib/octokit/error.rb#251 + def password_delivery; end + + private + + # source://octokit//lib/octokit/error.rb#257 + def delivery_method_from_header; end + + class << self + # @private + # + # source://octokit//lib/octokit/error.rb#244 + def required_header(headers); end + end +end + +# @private +# +# source://octokit//lib/octokit/error.rb#241 +Octokit::OneTimePasswordRequired::OTP_DELIVERY_PATTERN = T.let(T.unsafe(nil), Regexp) + +# GitHub organization class to generate API path urls +# +# source://octokit//lib/octokit/organization.rb#5 +class Octokit::Organization + class << self + # Get the api path for an organization + # + # @param org [String, Integer] GitHub organization login or id + # @return [String] Organization Api path + # + # source://octokit//lib/octokit/organization.rb#10 + def path(org); end + end +end + +# Current patch level. +# +# @return [Integer] +# +# source://octokit//lib/octokit/version.rb#14 +Octokit::PATCH = T.let(T.unsafe(nil), Integer) + +# Raised when GitHub returns a 422 HTTP status code and body matches 'Path diff too large'. +# It could occur when attempting to post review comments on a "too large" file. +# +# source://octokit//lib/octokit/error.rb#338 +class Octokit::PathDiffTooLarge < ::Octokit::UnprocessableEntity; end + +# source://octokit//lib/octokit/error.rb#368 +Octokit::RATE_LIMITED_ERRORS = T.let(T.unsafe(nil), Array) + +# Class for API Rate Limit info +# +# @see https://developer.github.com/v3/#rate-limiting +# +# source://octokit//lib/octokit/rate_limit.rb#16 +class Octokit::RateLimit < ::Struct + class << self + # Get rate limit info from HTTP response + # + # @param response [#headers] HTTP response + # @return [RateLimit] + # + # source://octokit//lib/octokit/rate_limit.rb#21 + def from_response(response); end + end +end + +# Class to extract options from Ruby arguments for +# Repository-related methods +# +# source://octokit//lib/octokit/repo_arguments.rb#6 +class Octokit::RepoArguments < ::Octokit::Arguments + # @return [RepoArguments] a new instance of RepoArguments + # + # source://octokit//lib/octokit/repo_arguments.rb#11 + def initialize(args); end + + # !@attribute [r] repo + # @return [Repository] + # + # source://octokit//lib/octokit/repo_arguments.rb#9 + def repo; end +end + +# Class to parse GitHub repository owner and name from +# URLs and to generate URLs +# +# source://octokit//lib/octokit/repository.rb#6 +class Octokit::Repository + # @raise [Octokit::InvalidRepository] if the repository + # has an invalid format + # @return [Repository] a new instance of Repository + # + # source://octokit//lib/octokit/repository.rb#23 + def initialize(repo); end + + # Returns the value of attribute id. + # + # source://octokit//lib/octokit/repository.rb#7 + def id; end + + # Sets the attribute id + # + # @param value the value to set the attribute id to. + # + # source://octokit//lib/octokit/repository.rb#7 + def id=(_arg0); end + + # @return [String] Api path for id identified repos + # + # source://octokit//lib/octokit/repository.rb#68 + def id_api_path; end + + # Returns the value of attribute name. + # + # source://octokit//lib/octokit/repository.rb#7 + def name; end + + # Sets the attribute name + # + # @param value the value to set the attribute name to. + # + # source://octokit//lib/octokit/repository.rb#7 + def name=(_arg0); end + + # @return [String] Api path for owner/name identified repos + # + # source://octokit//lib/octokit/repository.rb#63 + def named_api_path; end + + # Returns the value of attribute owner. + # + # source://octokit//lib/octokit/repository.rb#7 + def owner; end + + # Sets the attribute owner + # + # @param value the value to set the attribute owner to. + # + # source://octokit//lib/octokit/repository.rb#7 + def owner=(_arg0); end + + # @return [String] Repository API path + # + # source://octokit//lib/octokit/repository.rb#49 + def path; end + + # Returns the value of attribute name. + # + # source://octokit//lib/octokit/repository.rb#7 + def repo; end + + # Repository owner/name + # + # @return [String] + # + # source://octokit//lib/octokit/repository.rb#43 + def slug; end + + # Repository owner/name + # + # @return [String] + # + # source://octokit//lib/octokit/repository.rb#43 + def to_s; end + + # Repository URL based on {Octokit::Client#web_endpoint} + # + # @return [String] + # + # source://octokit//lib/octokit/repository.rb#74 + def url; end + + # Returns the value of attribute owner. + # + # source://octokit//lib/octokit/repository.rb#7 + def user; end + + # Returns the value of attribute owner. + # + # source://octokit//lib/octokit/repository.rb#7 + def username; end + + private + + # @raise [Octokit::InvalidRepository] + # + # source://octokit//lib/octokit/repository.rb#90 + def raise_invalid_repository!(repo); end + + # source://octokit//lib/octokit/repository.rb#84 + def validate_owner_and_name!(repo); end + + class << self + # Instantiate from a GitHub repository URL + # + # @return [Repository] + # + # source://octokit//lib/octokit/repository.rb#14 + def from_url(url); end + + # Get the api path for a repo + # + # @param repo [Integer, String, Hash, Repository] A GitHub repository. + # @return [String] Api path. + # + # source://octokit//lib/octokit/repository.rb#58 + def path(repo); end + end +end + +# source://octokit//lib/octokit/repository.rb#9 +Octokit::Repository::NAME_WITH_OWNER_PATTERN = T.let(T.unsafe(nil), Regexp) + +# Raised when GitHub returns a 403 HTTP status code +# and body matches 'repository access blocked' +# +# source://octokit//lib/octokit/error.rb#285 +class Octokit::RepositoryUnavailable < ::Octokit::Forbidden; end + +# Faraday response middleware +# +# source://octokit//lib/octokit/response/base_middleware.rb#6 +module Octokit::Response; end + +# In Faraday 2.x, Faraday::Response::Middleware was removed +# +# source://octokit//lib/octokit/response/base_middleware.rb#8 +Octokit::Response::BaseMiddleware = Faraday::Middleware + +# Parses RSS and Atom feed responses. +# +# source://octokit//lib/octokit/response/feed_parser.rb#8 +class Octokit::Response::FeedParser < ::Faraday::Middleware + # source://octokit//lib/octokit/response/feed_parser.rb#9 + def on_complete(env); end +end + +# This class raises an Octokit-flavored exception based +# HTTP status codes returned by the API +# +# source://octokit//lib/octokit/response/raise_error.rb#11 +class Octokit::Response::RaiseError < ::Faraday::Middleware + # source://octokit//lib/octokit/response/raise_error.rb#12 + def on_complete(response); end +end + +# Raised when GitHub returns a 403 HTTP status code +# and body matches 'Resource protected by organization SAML enforcement' +# +# source://octokit//lib/octokit/error.rb#301 +class Octokit::SAMLProtected < ::Octokit::Forbidden; end + +# Raised on errors in the 500-599 range +# +# source://octokit//lib/octokit/error.rb#344 +class Octokit::ServerError < ::Octokit::Error; end + +# Raised when GitHub returns a 503 HTTP status code +# +# source://octokit//lib/octokit/error.rb#356 +class Octokit::ServiceUnavailable < ::Octokit::ServerError; end + +# Raised when GitHub returns a 403 HTTP status code +# and body matches 'returns blobs up to [0-9]+ MB' +# +# source://octokit//lib/octokit/error.rb#277 +class Octokit::TooLargeContent < ::Octokit::Forbidden; end + +# Raised when GitHub returns a 403 HTTP status code +# and body matches 'login attempts exceeded' +# +# source://octokit//lib/octokit/error.rb#273 +class Octokit::TooManyLoginAttempts < ::Octokit::Forbidden; end + +# Raised when GitHub returns a 403 HTTP status code +# and body matches 'rate limit exceeded' +# +# source://octokit//lib/octokit/error.rb#269 +class Octokit::TooManyRequests < ::Octokit::Forbidden; end + +# Raised when GitHub returns a 401 HTTP status code +# +# source://octokit//lib/octokit/error.rb#235 +class Octokit::Unauthorized < ::Octokit::ClientError; end + +# Raised when GitHub returns a 451 HTTP status code +# +# source://octokit//lib/octokit/error.rb#341 +class Octokit::UnavailableForLegalReasons < ::Octokit::ClientError; end + +# Raised when GitHub returns a 422 HTTP status code +# +# source://octokit//lib/octokit/error.rb#330 +class Octokit::UnprocessableEntity < ::Octokit::ClientError; end + +# Raised when GitHub returns a 414 HTTP status code +# +# source://octokit//lib/octokit/error.rb#327 +class Octokit::UnsupportedMediaType < ::Octokit::ClientError; end + +# Raised when GitHub returns a 403 HTTP status code +# and body matches 'email address must be verified' +# +# source://octokit//lib/octokit/error.rb#289 +class Octokit::UnverifiedEmail < ::Octokit::Forbidden; end + +# GitHub user class to generate API path urls +# +# source://octokit//lib/octokit/user.rb#5 +class Octokit::User + class << self + # Get the api path for a user + # + # @param user [String, Integer] GitHub user login or id + # @return [String] User Api path + # + # source://octokit//lib/octokit/user.rb#10 + def path(user); end + end +end + +# Full release version. +# +# @return [String] +# +# source://octokit//lib/octokit/version.rb#18 +Octokit::VERSION = T.let(T.unsafe(nil), String) + +# Allows warnings to be suppressed via environment variable. +# +# source://octokit//lib/octokit/warnable.rb#5 +module Octokit::Warnable + private + + # Wrapper around Kernel#warn to print warnings unless + # OCTOKIT_SILENT is set to true. + # + # @return [nil] + # + # source://octokit//lib/octokit/warnable.rb#12 + def octokit_warn(*message); end + + class << self + # Wrapper around Kernel#warn to print warnings unless + # OCTOKIT_SILENT is set to true. + # + # @return [nil] + # + # source://octokit//lib/octokit/warnable.rb#12 + def octokit_warn(*message); end + end +end diff --git a/sorbet/rbi/gems/rack-session@2.0.0.rbi b/sorbet/rbi/gems/rack-session@2.0.0.rbi new file mode 100644 index 0000000..560a8d9 --- /dev/null +++ b/sorbet/rbi/gems/rack-session@2.0.0.rbi @@ -0,0 +1,781 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rack-session` gem. +# Please instead update this file by running `bin/tapioca gem rack-session`. + + +# source://rack-session//lib/rack/session.rb#7 +module Rack + class << self + # source://rack/3.1.7/lib/rack/version.rb#18 + def release; end + end +end + +# source://rack-session//lib/rack/session.rb#8 +module Rack::Session; end + +# source://rack-session//lib/rack/session/abstract/id.rb#47 +module Rack::Session::Abstract; end + +# source://rack-session//lib/rack/session/abstract/id.rb#497 +class Rack::Session::Abstract::ID < ::Rack::Session::Abstract::Persisted + # All thread safety and session destroy procedures should occur here. + # Should return a new session id or nil if options[:drop] + # + # source://rack-session//lib/rack/session/abstract/id.rb#527 + def delete_session(req, sid, options); end + + # All thread safety and session retrieval procedures should occur here. + # Should return [session_id, session]. + # If nil is provided as the session id, generation of a new valid id + # should occur within. + # + # source://rack-session//lib/rack/session/abstract/id.rb#512 + def find_session(req, sid); end + + # All thread safety and session storage procedures should occur here. + # Must return the session id if the session was saved successfully, or + # false if the session could not be saved. + # + # source://rack-session//lib/rack/session/abstract/id.rb#520 + def write_session(req, sid, session, options); end + + class << self + # @private + # + # source://rack-session//lib/rack/session/abstract/id.rb#498 + def inherited(klass); end + end +end + +# ID sets up a basic framework for implementing an id based sessioning +# service. Cookies sent to the client for maintaining sessions will only +# contain an id reference. Only #find_session, #write_session and +# #delete_session are required to be overwritten. +# +# All parameters are optional. +# * :key determines the name of the cookie, by default it is +# 'rack.session' +# * :path, :domain, :expire_after, :secure, :httponly, and :same_site set +# the related cookie options as by Rack::Response#set_cookie +# * :skip will not a set a cookie in the response nor update the session state +# * :defer will not set a cookie in the response but still update the session +# state if it is used with a backend +# * :renew (implementation dependent) will prompt the generation of a new +# session id, and migration of data to be referenced at the new id. If +# :defer is set, it will be overridden and the cookie will be set. +# * :sidbits sets the number of bits in length that a generated session +# id will be. +# +# These options can be set on a per request basis, at the location of +# env['rack.session.options']. Additionally the id of the +# session can be found within the options hash at the key :id. It is +# highly not recommended to change its value. +# +# Is Rack::Utils::Context compatible. +# +# Not included by default; you must require 'rack/session/abstract/id' +# to use. +# +# source://rack-session//lib/rack/session/abstract/id.rb#239 +class Rack::Session::Abstract::Persisted + # @return [Persisted] a new instance of Persisted + # + # source://rack-session//lib/rack/session/abstract/id.rb#256 + def initialize(app, options = T.unsafe(nil)); end + + # source://rack-session//lib/rack/session/abstract/id.rb#265 + def call(env); end + + # Acquires the session from the environment and the session id from + # the session options and passes them to #write_session. If successful + # and the :defer option is not true, a cookie will be added to the + # response with the session's id. + # + # source://rack-session//lib/rack/session/abstract/id.rb#379 + def commit_session(req, res); end + + # source://rack-session//lib/rack/session/abstract/id.rb#269 + def context(env, app = T.unsafe(nil)); end + + # Returns the value of attribute default_options. + # + # source://rack-session//lib/rack/session/abstract/id.rb#254 + def default_options; end + + # Returns the value of attribute key. + # + # source://rack-session//lib/rack/session/abstract/id.rb#254 + def key; end + + # Returns the value of attribute same_site. + # + # source://rack-session//lib/rack/session/abstract/id.rb#254 + def same_site; end + + # Returns the value of attribute sid_secure. + # + # source://rack-session//lib/rack/session/abstract/id.rb#254 + def sid_secure; end + + private + + # Session should be committed if it was loaded, any of specific options like :renew, :drop + # or :expire_after was given and the security permissions match. Skips if skip is given. + # + # @return [Boolean] + # + # source://rack-session//lib/rack/session/abstract/id.rb#348 + def commit_session?(req, session, options); end + + # source://rack-session//lib/rack/session/abstract/id.rb#414 + def cookie_value(data); end + + # Returns the current session id from the SessionHash. + # + # source://rack-session//lib/rack/session/abstract/id.rb#334 + def current_session_id(req); end + + # All thread safety and session destroy procedures should occur here. + # Should return a new session id or nil if options[:drop] + # + # source://rack-session//lib/rack/session/abstract/id.rb#453 + def delete_session(req, sid, options); end + + # Extract session id from request object. + # + # source://rack-session//lib/rack/session/abstract/id.rb#326 + def extract_session_id(request); end + + # All thread safety and session retrieval procedures should occur here. + # Should return [session_id, session]. + # If nil is provided as the session id, generation of a new valid id + # should occur within. + # + # source://rack-session//lib/rack/session/abstract/id.rb#438 + def find_session(env, sid); end + + # @return [Boolean] + # + # source://rack-session//lib/rack/session/abstract/id.rb#365 + def force_options?(options); end + + # @return [Boolean] + # + # source://rack-session//lib/rack/session/abstract/id.rb#361 + def forced_session_update?(session, options); end + + # Generate a new session id using Ruby #rand. The size of the + # session id is controlled by the :sidbits option. + # Monkey patch this to use custom methods for session id generation. + # + # source://rack-session//lib/rack/session/abstract/id.rb#294 + def generate_sid(secure = T.unsafe(nil)); end + + # source://rack-session//lib/rack/session/abstract/id.rb#284 + def initialize_sid; end + + # Extracts the session id from provided cookies and passes it and the + # environment to #find_session. + # + # source://rack-session//lib/rack/session/abstract/id.rb#318 + def load_session(req); end + + # @return [Boolean] + # + # source://rack-session//lib/rack/session/abstract/id.rb#357 + def loaded_session?(session); end + + # source://rack-session//lib/rack/session/abstract/id.rb#280 + def make_request(env); end + + # Sets the lazy session at 'rack.session' and places options and session + # metadata into 'rack.session.options'. + # + # source://rack-session//lib/rack/session/abstract/id.rb#307 + def prepare_session(req); end + + # @return [Boolean] + # + # source://rack-session//lib/rack/session/abstract/id.rb#369 + def security_matches?(request, options); end + + # Allow subclasses to prepare_session for different Session classes + # + # source://rack-session//lib/rack/session/abstract/id.rb#429 + def session_class; end + + # Check if the session exists or not. + # + # @return [Boolean] + # + # source://rack-session//lib/rack/session/abstract/id.rb#340 + def session_exists?(req); end + + # Sets the cookie back to the client with session id. We skip the cookie + # setting if the value didn't change (sid is the same) or expires was given. + # + # source://rack-session//lib/rack/session/abstract/id.rb#421 + def set_cookie(request, response, cookie); end + + # All thread safety and session storage procedures should occur here. + # Must return the session id if the session was saved successfully, or + # false if the session could not be saved. + # + # source://rack-session//lib/rack/session/abstract/id.rb#446 + def write_session(req, sid, session, options); end +end + +# source://rack-session//lib/rack/session/abstract/id.rb#240 +Rack::Session::Abstract::Persisted::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://rack-session//lib/rack/session/abstract/id.rb#458 +class Rack::Session::Abstract::PersistedSecure < ::Rack::Session::Abstract::Persisted + # source://rack-session//lib/rack/session/abstract/id.rb#481 + def extract_session_id(*_arg0); end + + # source://rack-session//lib/rack/session/abstract/id.rb#475 + def generate_sid(*_arg0); end + + private + + # source://rack-session//lib/rack/session/abstract/id.rb#492 + def cookie_value(data); end + + # source://rack-session//lib/rack/session/abstract/id.rb#488 + def session_class; end +end + +# source://rack-session//lib/rack/session/abstract/id.rb#459 +class Rack::Session::Abstract::PersistedSecure::SecureSessionHash < ::Rack::Session::Abstract::SessionHash + # source://rack-session//lib/rack/session/abstract/id.rb#460 + def [](key); end +end + +# SessionHash is responsible to lazily load the session from store. +# +# source://rack-session//lib/rack/session/abstract/id.rb#50 +class Rack::Session::Abstract::SessionHash + include ::Enumerable + + # @return [SessionHash] a new instance of SessionHash + # + # source://rack-session//lib/rack/session/abstract/id.rb#68 + def initialize(store, req); end + + # source://rack-session//lib/rack/session/abstract/id.rb#88 + def [](key); end + + # source://rack-session//lib/rack/session/abstract/id.rb#114 + def []=(key, value); end + + # source://rack-session//lib/rack/session/abstract/id.rb#120 + def clear; end + + # source://rack-session//lib/rack/session/abstract/id.rb#146 + def delete(key); end + + # source://rack-session//lib/rack/session/abstract/id.rb#125 + def destroy; end + + # source://rack-session//lib/rack/session/abstract/id.rb#93 + def dig(key, *keys); end + + # source://rack-session//lib/rack/session/abstract/id.rb#83 + def each(&block); end + + # @return [Boolean] + # + # source://rack-session//lib/rack/session/abstract/id.rb#169 + def empty?; end + + # @return [Boolean] + # + # source://rack-session//lib/rack/session/abstract/id.rb#159 + def exists?; end + + # source://rack-session//lib/rack/session/abstract/id.rb#98 + def fetch(key, default = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://rack-session//lib/rack/session/abstract/id.rb#107 + def has_key?(key); end + + # source://rack-session//lib/rack/session/abstract/id.rb#74 + def id; end + + # Sets the attribute id + # + # @param value the value to set the attribute id to. + # + # source://rack-session//lib/rack/session/abstract/id.rb#52 + def id=(_arg0); end + + # @return [Boolean] + # + # source://rack-session//lib/rack/session/abstract/id.rb#107 + def include?(key); end + + # source://rack-session//lib/rack/session/abstract/id.rb#151 + def inspect; end + + # @return [Boolean] + # + # source://rack-session//lib/rack/session/abstract/id.rb#107 + def key?(key); end + + # source://rack-session//lib/rack/session/abstract/id.rb#174 + def keys; end + + # @return [Boolean] + # + # source://rack-session//lib/rack/session/abstract/id.rb#165 + def loaded?; end + + # source://rack-session//lib/rack/session/abstract/id.rb#135 + def merge!(hash); end + + # source://rack-session//lib/rack/session/abstract/id.rb#79 + def options; end + + # source://rack-session//lib/rack/session/abstract/id.rb#141 + def replace(hash); end + + # source://rack-session//lib/rack/session/abstract/id.rb#114 + def store(key, value); end + + # source://rack-session//lib/rack/session/abstract/id.rb#130 + def to_hash; end + + # source://rack-session//lib/rack/session/abstract/id.rb#135 + def update(hash); end + + # source://rack-session//lib/rack/session/abstract/id.rb#179 + def values; end + + private + + # source://rack-session//lib/rack/session/abstract/id.rb#194 + def load!; end + + # source://rack-session//lib/rack/session/abstract/id.rb#186 + def load_for_read!; end + + # source://rack-session//lib/rack/session/abstract/id.rb#190 + def load_for_write!; end + + # source://rack-session//lib/rack/session/abstract/id.rb#200 + def stringify_keys(other); end + + class << self + # source://rack-session//lib/rack/session/abstract/id.rb#56 + def find(req); end + + # source://rack-session//lib/rack/session/abstract/id.rb#60 + def set(req, session); end + + # source://rack-session//lib/rack/session/abstract/id.rb#64 + def set_options(req, options); end + end +end + +# source://rack-session//lib/rack/session/abstract/id.rb#54 +Rack::Session::Abstract::SessionHash::Unspecified = T.let(T.unsafe(nil), Object) + +# Rack::Session::Cookie provides simple cookie based session management. +# By default, the session is a Ruby Hash that is serialized and encoded as +# a cookie set to :key (default: rack.session). +# +# This middleware accepts a :secrets option which enables encryption of +# session cookies. This option should be one or more random "secret keys" +# that are each at least 64 bytes in length. Multiple secret keys can be +# supplied in an Array, which is useful when rotating secrets. +# +# Several options are also accepted that are passed to Rack::Session::Encryptor. +# These options include: +# * :serialize_json +# Use JSON for message serialization instead of Marshal. This can be +# viewed as a security enhancement. +# * :gzip_over +# For message data over this many bytes, compress it with the deflate +# algorithm. +# +# Refer to Rack::Session::Encryptor for more details on these options. +# +# Prior to version TODO, the session hash was stored as base64 encoded +# marshalled data. When a :secret option was supplied, the integrity of the +# encoded data was protected with HMAC-SHA1. This functionality is still +# supported using a set of a legacy options. +# +# Lastly, a :coder option is also accepted. When used, both encryption and +# the legacy HMAC will be skipped. This option could create security issues +# in your application! +# +# Example: +# +# use Rack::Session::Cookie, { +# key: 'rack.session', +# domain: 'foo.com', +# path: '/', +# expire_after: 2592000, +# secrets: 'a randomly generated, raw binary string 64 bytes in size', +# } +# +# Example using legacy HMAC options: +# +# Rack::Session:Cookie.new(application, { +# # The secret used for legacy HMAC cookies, this enables the functionality +# legacy_hmac_secret: 'legacy secret', +# # legacy_hmac_coder will default to Rack::Session::Cookie::Base64::Marshal +# legacy_hmac_coder: Rack::Session::Cookie::Identity.new, +# # legacy_hmac will default to OpenSSL::Digest::SHA1 +# legacy_hmac: OpenSSL::Digest::SHA256 +# }) +# +# +# Rack::Session::Cookie.new(application, { +# :coder => Rack::Session::Cookie::Identity.new +# }) +# +# +# Rack::Session::Cookie.new(application, { +# :coder => Class.new { +# def encode(str); str.reverse; end +# def decode(str); str.reverse; end +# }.new +# }) +# +# source://rack-session//lib/rack/session/cookie.rb#91 +class Rack::Session::Cookie < ::Rack::Session::Abstract::PersistedSecure + # @return [Cookie] a new instance of Cookie + # + # source://rack-session//lib/rack/session/cookie.rb#159 + def initialize(app, options = T.unsafe(nil)); end + + # Returns the value of attribute coder. + # + # source://rack-session//lib/rack/session/cookie.rb#157 + def coder; end + + # Returns the value of attribute encryptors. + # + # source://rack-session//lib/rack/session/cookie.rb#157 + def encryptors; end + + private + + # source://rack-session//lib/rack/session/cookie.rb#277 + def delete_session(req, session_id, options); end + + # source://rack-session//lib/rack/session/cookie.rb#292 + def encode_session_data(session); end + + # source://rack-session//lib/rack/session/cookie.rb#209 + def extract_session_id(request); end + + # source://rack-session//lib/rack/session/cookie.rb#203 + def find_session(req, sid); end + + # @return [Boolean] + # + # source://rack-session//lib/rack/session/cookie.rb#282 + def legacy_digest_match?(data, digest); end + + # source://rack-session//lib/rack/session/cookie.rb#288 + def legacy_generate_hmac(data); end + + # source://rack-session//lib/rack/session/cookie.rb#250 + def persistent_session_id!(data, sid = T.unsafe(nil)); end + + # Were consider "secure" if: + # * Encrypted cookies are enabled and one or more encryptor is + # initialized + # * The legacy HMAC option is enabled + # * Customer :coder is used, with :let_coder_handle_secure_encoding + # set to true + # + # @return [Boolean] + # + # source://rack-session//lib/rack/session/cookie.rb#306 + def secure?(options); end + + # source://rack-session//lib/rack/session/cookie.rb#213 + def unpacked_cookie_data(request); end + + # source://rack-session//lib/rack/session/cookie.rb#265 + def write_session(req, session_id, session, options); end +end + +# Encode session cookies as Base64 +# +# source://rack-session//lib/rack/session/cookie.rb#93 +class Rack::Session::Cookie::Base64 + # source://rack-session//lib/rack/session/cookie.rb#98 + def decode(str); end + + # source://rack-session//lib/rack/session/cookie.rb#94 + def encode(str); end +end + +# N.B. Unlike other encoding methods, the contained objects must be a +# valid JSON composite type, either a Hash or an Array. +# +# source://rack-session//lib/rack/session/cookie.rb#116 +class Rack::Session::Cookie::Base64::JSON < ::Rack::Session::Cookie::Base64 + # source://rack-session//lib/rack/session/cookie.rb#121 + def decode(str); end + + # source://rack-session//lib/rack/session/cookie.rb#117 + def encode(obj); end +end + +# Encode session cookies as Marshaled Base64 data +# +# source://rack-session//lib/rack/session/cookie.rb#103 +class Rack::Session::Cookie::Base64::Marshal < ::Rack::Session::Cookie::Base64 + # source://rack-session//lib/rack/session/cookie.rb#108 + def decode(str); end + + # source://rack-session//lib/rack/session/cookie.rb#104 + def encode(str); end +end + +# source://rack-session//lib/rack/session/cookie.rb#127 +class Rack::Session::Cookie::Base64::ZipJSON < ::Rack::Session::Cookie::Base64 + # source://rack-session//lib/rack/session/cookie.rb#132 + def decode(str); end + + # source://rack-session//lib/rack/session/cookie.rb#128 + def encode(obj); end +end + +# Use no encoding for session cookies +# +# source://rack-session//lib/rack/session/cookie.rb#142 +class Rack::Session::Cookie::Identity + # source://rack-session//lib/rack/session/cookie.rb#144 + def decode(str); end + + # source://rack-session//lib/rack/session/cookie.rb#143 + def encode(str); end +end + +# source://rack-session//lib/rack/session/cookie.rb#147 +class Rack::Session::Cookie::Marshal + # source://rack-session//lib/rack/session/cookie.rb#152 + def decode(str); end + + # source://rack-session//lib/rack/session/cookie.rb#148 + def encode(str); end +end + +# source://rack-session//lib/rack/session/cookie.rb#256 +class Rack::Session::Cookie::SessionId + # @return [SessionId] a new instance of SessionId + # + # source://rack-session//lib/rack/session/cookie.rb#259 + def initialize(session_id, cookie_value); end + + # Returns the value of attribute cookie_value. + # + # source://rack-session//lib/rack/session/cookie.rb#257 + def cookie_value; end +end + +# source://rack-session//lib/rack/session/encryptor.rb#16 +class Rack::Session::Encryptor + # The secret String must be at least 64 bytes in size. The first 32 bytes + # will be used for the encryption cipher key. The remainder will be used + # for an HMAC key. + # + # Options may include: + # * :serialize_json + # Use JSON for message serialization instead of Marshal. This can be + # viewed as a security enhancement. + # * :pad_size + # Pad encrypted message data, to a multiple of this many bytes + # (default: 32). This can be between 2-4096 bytes, or +nil+ to disable + # padding. + # * :purpose + # Limit messages to a specific purpose. This can be viewed as a + # security enhancement to prevent message reuse from different contexts + # if keys are reused. + # + # Cryptography and Output Format: + # + # urlsafe_encode64(version + random_data + IV + encrypted data + HMAC) + # + # Where: + # * version - 1 byte and is currently always 0x01 + # * random_data - 32 bytes used for generating the per-message secret + # * IV - 16 bytes random initialization vector + # * HMAC - 32 bytes HMAC-SHA-256 of all preceding data, plus the purpose + # value + # + # @raise [ArgumentError] + # @return [Encryptor] a new instance of Encryptor + # + # source://rack-session//lib/rack/session/encryptor.rb#53 + def initialize(secret, opts = T.unsafe(nil)); end + + # source://rack-session//lib/rack/session/encryptor.rb#77 + def decrypt(base64_data); end + + # source://rack-session//lib/rack/session/encryptor.rb#102 + def encrypt(message); end + + private + + # source://rack-session//lib/rack/session/encryptor.rb#139 + def cipher_secret_from_message_secret(message_secret); end + + # source://rack-session//lib/rack/session/encryptor.rb#151 + def compute_signature(data); end + + # Return the deserialized message. The first 2 bytes will be read as the + # amount of padding. + # + # source://rack-session//lib/rack/session/encryptor.rb#182 + def deserialized_message(data); end + + # source://rack-session//lib/rack/session/encryptor.rb#129 + def new_cipher; end + + # source://rack-session//lib/rack/session/encryptor.rb#133 + def new_message_and_cipher_secret; end + + # Returns a serialized payload of the message. If a :pad_size is supplied, + # the message will be padded. The first 2 bytes of the returned string will + # indicating the amount of padding. + # + # source://rack-session//lib/rack/session/encryptor.rb#169 + def serialize_payload(message); end + + # source://rack-session//lib/rack/session/encryptor.rb#147 + def serializer; end + + # source://rack-session//lib/rack/session/encryptor.rb#143 + def set_cipher_key(cipher, key); end + + # @raise [InvalidMessage] + # + # source://rack-session//lib/rack/session/encryptor.rb#158 + def verify_authenticity!(data, signature); end +end + +# source://rack-session//lib/rack/session/encryptor.rb#17 +class Rack::Session::Encryptor::Error < ::StandardError; end + +# source://rack-session//lib/rack/session/encryptor.rb#23 +class Rack::Session::Encryptor::InvalidMessage < ::Rack::Session::Encryptor::Error; end + +# source://rack-session//lib/rack/session/encryptor.rb#20 +class Rack::Session::Encryptor::InvalidSignature < ::Rack::Session::Encryptor::Error; end + +# Rack::Session::Pool provides simple cookie based session management. +# Session data is stored in a hash held by @pool. +# In the context of a multithreaded environment, sessions being +# committed to the pool is done in a merging manner. +# +# The :drop option is available in rack.session.options if you wish to +# explicitly remove the session from the session cache. +# +# Example: +# myapp = MyRackApp.new +# sessioned = Rack::Session::Pool.new(myapp, +# :domain => 'foo.com', +# :expire_after => 2592000 +# ) +# Rack::Handler::WEBrick.run sessioned +# +# source://rack-session//lib/rack/session/pool.rb#26 +class Rack::Session::Pool < ::Rack::Session::Abstract::PersistedSecure + # @return [Pool] a new instance of Pool + # + # source://rack-session//lib/rack/session/pool.rb#30 + def initialize(app, options = T.unsafe(nil)); end + + # source://rack-session//lib/rack/session/pool.rb#61 + def delete_session(req, session_id, options); end + + # source://rack-session//lib/rack/session/pool.rb#44 + def find_session(req, sid); end + + # source://rack-session//lib/rack/session/pool.rb#37 + def generate_sid(*args, use_mutex: T.unsafe(nil)); end + + # Returns the value of attribute mutex. + # + # source://rack-session//lib/rack/session/pool.rb#27 + def mutex; end + + # Returns the value of attribute pool. + # + # source://rack-session//lib/rack/session/pool.rb#27 + def pool; end + + # source://rack-session//lib/rack/session/pool.rb#54 + def write_session(req, session_id, new_session, options); end + + private + + # source://rack-session//lib/rack/session/pool.rb#71 + def get_session_with_fallback(sid); end +end + +# source://rack-session//lib/rack/session/pool.rb#28 +Rack::Session::Pool::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) + +# source://rack-session//lib/rack/session/constants.rb#9 +Rack::Session::RACK_SESSION = T.let(T.unsafe(nil), String) + +# source://rack-session//lib/rack/session/constants.rb#10 +Rack::Session::RACK_SESSION_OPTIONS = T.let(T.unsafe(nil), String) + +# source://rack-session//lib/rack/session/constants.rb#11 +Rack::Session::RACK_SESSION_UNPACKED_COOKIE_DATA = T.let(T.unsafe(nil), String) + +# source://rack-session//lib/rack/session/abstract/id.rb#21 +class Rack::Session::SessionId + # @return [SessionId] a new instance of SessionId + # + # source://rack-session//lib/rack/session/abstract/id.rb#26 + def initialize(public_id); end + + # Returns the value of attribute public_id. + # + # source://rack-session//lib/rack/session/abstract/id.rb#24 + def cookie_value; end + + # @return [Boolean] + # + # source://rack-session//lib/rack/session/abstract/id.rb#37 + def empty?; end + + # source://rack-session//lib/rack/session/abstract/id.rb#38 + def inspect; end + + # source://rack-session//lib/rack/session/abstract/id.rb#30 + def private_id; end + + # Returns the value of attribute public_id. + # + # source://rack-session//lib/rack/session/abstract/id.rb#24 + def public_id; end + + # Returns the value of attribute public_id. + # + # source://rack-session//lib/rack/session/abstract/id.rb#24 + def to_s; end + + private + + # source://rack-session//lib/rack/session/abstract/id.rb#42 + def hash_sid(sid); end +end + +# source://rack-session//lib/rack/session/abstract/id.rb#22 +Rack::Session::SessionId::ID_VERSION = T.let(T.unsafe(nil), Integer) diff --git a/sorbet/rbi/gems/rack@3.1.7.rbi b/sorbet/rbi/gems/rack@3.1.7.rbi new file mode 100644 index 0000000..fe5f661 --- /dev/null +++ b/sorbet/rbi/gems/rack@3.1.7.rbi @@ -0,0 +1,4905 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `rack` gem. +# Please instead update this file by running `bin/tapioca gem rack`. + + +# The Rack main module, serving as a namespace for all core Rack +# modules and classes. +# +# All modules meant for use in your application are autoloaded here, +# so it should be enough just to require 'rack' in your code. +# +# source://rack//lib/rack/constants.rb#3 +module Rack + class << self + # Return the Rack release as a dotted string. + # + # source://rack//lib/rack/version.rb#18 + def release; end + end +end + +# source://rack//lib/rack.rb#60 +module Rack::Auth; end + +# Rack::Auth::AbstractHandler implements common authentication functionality. +# +# +realm+ should be set for all handlers. +# +# source://rack//lib/rack/auth/abstract/handler.rb#11 +class Rack::Auth::AbstractHandler + # @return [AbstractHandler] a new instance of AbstractHandler + # + # source://rack//lib/rack/auth/abstract/handler.rb#15 + def initialize(app, realm = T.unsafe(nil), &authenticator); end + + # Returns the value of attribute realm. + # + # source://rack//lib/rack/auth/abstract/handler.rb#13 + def realm; end + + # Sets the attribute realm + # + # @param value the value to set the attribute realm to. + # + # source://rack//lib/rack/auth/abstract/handler.rb#13 + def realm=(_arg0); end + + private + + # source://rack//lib/rack/auth/abstract/handler.rb#31 + def bad_request; end + + # source://rack//lib/rack/auth/abstract/handler.rb#22 + def unauthorized(www_authenticate = T.unsafe(nil)); end +end + +# source://rack//lib/rack/auth/abstract/request.rb#7 +class Rack::Auth::AbstractRequest + # @return [AbstractRequest] a new instance of AbstractRequest + # + # source://rack//lib/rack/auth/abstract/request.rb#9 + def initialize(env); end + + # source://rack//lib/rack/auth/abstract/request.rb#33 + def params; end + + # source://rack//lib/rack/auth/abstract/request.rb#25 + def parts; end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/abstract/request.rb#17 + def provided?; end + + # source://rack//lib/rack/auth/abstract/request.rb#13 + def request; end + + # source://rack//lib/rack/auth/abstract/request.rb#29 + def scheme; end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/abstract/request.rb#21 + def valid?; end + + private + + # source://rack//lib/rack/auth/abstract/request.rb#42 + def authorization_key; end +end + +# source://rack//lib/rack/auth/abstract/request.rb#40 +Rack::Auth::AbstractRequest::AUTHORIZATION_KEYS = T.let(T.unsafe(nil), Array) + +# Rack::Auth::Basic implements HTTP Basic Authentication, as per RFC 2617. +# +# Initialize with the Rack application that you want protecting, +# and a block that checks if a username and password pair are valid. +# +# source://rack//lib/rack/auth/basic.rb#13 +class Rack::Auth::Basic < ::Rack::Auth::AbstractHandler + # source://rack//lib/rack/auth/basic.rb#15 + def call(env); end + + private + + # source://rack//lib/rack/auth/basic.rb#34 + def challenge; end + + # @return [Boolean] + # + # source://rack//lib/rack/auth/basic.rb#38 + def valid?(auth); end +end + +# source://rack//lib/rack/auth/basic.rb#42 +class Rack::Auth::Basic::Request < ::Rack::Auth::AbstractRequest + # @return [Boolean] + # + # source://rack//lib/rack/auth/basic.rb#43 + def basic?; end + + # source://rack//lib/rack/auth/basic.rb#47 + def credentials; end + + # source://rack//lib/rack/auth/basic.rb#51 + def username; end +end + +# source://rack//lib/rack/builder.rb#6 +Rack::BUILDER_TOPLEVEL_BINDING = T.let(T.unsafe(nil), Proc) + +# Represents a 400 Bad Request error when input data fails to meet the +# requirements. +# +# source://rack//lib/rack/bad_request.rb#6 +module Rack::BadRequest; end + +# Proxy for response bodies allowing calling a block when +# the response body is closed (after the response has been fully +# sent to the client). +# +# source://rack//lib/rack/body_proxy.rb#7 +class Rack::BodyProxy + # Set the response body to wrap, and the block to call when the + # response has been fully sent. + # + # @return [BodyProxy] a new instance of BodyProxy + # + # source://rack//lib/rack/body_proxy.rb#10 + def initialize(body, &block); end + + # If not already closed, close the wrapped body and + # then call the block the proxy was initialized with. + # + # source://rack//lib/rack/body_proxy.rb#28 + def close; end + + # Whether the proxy is closed. The proxy starts as not closed, + # and becomes closed on the first call to close. + # + # @return [Boolean] + # + # source://rack//lib/rack/body_proxy.rb#40 + def closed?; end + + # Delegate missing methods to the wrapped body. + # + # source://rack//lib/rack/body_proxy.rb#45 + def method_missing(method_name, *args, **_arg2, &block); end + + private + + # Return whether the wrapped body responds to the method. + # + # @return [Boolean] + # + # source://rack//lib/rack/body_proxy.rb#17 + def respond_to_missing?(method_name, include_all = T.unsafe(nil)); end +end + +# Rack::Builder provides a domain-specific language (DSL) to construct Rack +# applications. It is primarily used to parse +config.ru+ files which +# instantiate several middleware and a final application which are hosted +# by a Rack-compatible web server. +# +# Example: +# +# app = Rack::Builder.new do +# use Rack::CommonLogger +# map "/ok" do +# run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] } +# end +# end +# +# run app +# +# Or +# +# app = Rack::Builder.app do +# use Rack::CommonLogger +# run lambda { |env| [200, {'content-type' => 'text/plain'}, ['OK']] } +# end +# +# run app +# +# +use+ adds middleware to the stack, +run+ dispatches to an application. +# You can use +map+ to construct a Rack::URLMap in a convenient way. +# +# source://rack//lib/rack/builder.rb#36 +class Rack::Builder + # Initialize a new Rack::Builder instance. +default_app+ specifies the + # default application if +run+ is not called later. If a block + # is given, it is evaluated in the context of the instance. + # + # @return [Builder] a new instance of Builder + # + # source://rack//lib/rack/builder.rb#116 + def initialize(default_app = T.unsafe(nil), **options, &block); end + + # Call the Rack application generated by this builder instance. Note that + # this rebuilds the Rack application and runs the warmup code (if any) + # every time it is called, so it should not be used if performance is important. + # + # source://rack//lib/rack/builder.rb#276 + def call(env); end + + # Freeze the app (set using run) and all middleware instances when building the application + # in to_app. + # + # source://rack//lib/rack/builder.rb#259 + def freeze_app; end + + # Creates a route within the application. Routes under the mapped path will be sent to + # the Rack application specified by run inside the block. Other requests will be sent to the + # default application specified by run outside the block. + # + # class App + # def call(env) + # [200, {'content-type' => 'text/plain'}, ["Hello World"]] + # end + # end + # + # class Heartbeat + # def call(env) + # [200, { "content-type" => "text/plain" }, ["OK"]] + # end + # end + # + # app = Rack::Builder.app do + # map '/heartbeat' do + # run Heartbeat.new + # end + # run App.new + # end + # + # run app + # + # The +use+ method can also be used inside the block to specify middleware to run under a specific path: + # + # app = Rack::Builder.app do + # map '/heartbeat' do + # use Middleware + # run Heartbeat.new + # end + # run App.new + # end + # + # This example includes a piece of middleware which will run before +/heartbeat+ requests hit +Heartbeat+. + # + # Note that providing a +path+ of +/+ will ignore any default application given in a +run+ statement + # outside the block. + # + # source://rack//lib/rack/builder.rb#252 + def map(path, &block); end + + # Any options provided to the Rack::Builder instance at initialization. + # These options can be server-specific. Some general options are: + # + # * +:isolation+: One of +process+, +thread+ or +fiber+. The execution + # isolation model to use. + # + # source://rack//lib/rack/builder.rb#132 + def options; end + + # Takes a block or argument that is an object that responds to #call and + # returns a Rack response. + # + # You can use a block: + # + # run do |env| + # [200, { "content-type" => "text/plain" }, ["Hello World!"]] + # end + # + # You can also provide a lambda: + # + # run lambda { |env| [200, { "content-type" => "text/plain" }, ["OK"]] } + # + # You can also provide a class instance: + # + # class Heartbeat + # def call(env) + # [200, { "content-type" => "text/plain" }, ["OK"]] + # end + # end + # + # run Heartbeat.new + # + # @raise [ArgumentError] + # + # source://rack//lib/rack/builder.rb#193 + def run(app = T.unsafe(nil), &block); end + + # Return the Rack application generated by this instance. + # + # source://rack//lib/rack/builder.rb#264 + def to_app; end + + # Specifies middleware to use in a stack. + # + # class Middleware + # def initialize(app) + # @app = app + # end + # + # def call(env) + # env["rack.some_header"] = "setting an example" + # @app.call(env) + # end + # end + # + # use Middleware + # run lambda { |env| [200, { "content-type" => "text/plain" }, ["OK"]] } + # + # All requests through to this application will first be processed by the middleware class. + # The +call+ method in this example sets an additional environment key which then can be + # referenced in the application if required. + # + # source://rack//lib/rack/builder.rb#159 + def use(middleware, *args, **_arg2, &block); end + + # Takes a lambda or block that is used to warm-up the application. This block is called + # before the Rack application is returned by to_app. + # + # warmup do |app| + # client = Rack::MockRequest.new(app) + # client.get('/') + # end + # + # use SomeMiddleware + # run MyApp + # + # source://rack//lib/rack/builder.rb#209 + def warmup(prc = T.unsafe(nil), &block); end + + private + + # Generate a URLMap instance by generating new Rack applications for each + # map block in this instance. + # + # source://rack//lib/rack/builder.rb#284 + def generate_map(default_app, mapping); end + + class << self + # Create a new Rack::Builder instance and return the Rack application + # generated from it. + # + # source://rack//lib/rack/builder.rb#136 + def app(default_app = T.unsafe(nil), &block); end + + # Load the given file as a rackup file, treating the + # contents as if specified inside a Rack::Builder block. + # + # Ignores content in the file after +__END__+, so that + # use of +__END__+ will not result in a syntax error. + # + # Example config.ru file: + # + # $ cat config.ru + # + # use Rack::ContentLength + # require './app.rb' + # run App + # + # source://rack//lib/rack/builder.rb#87 + def load_file(path, **options); end + + # Evaluate the given +builder_script+ string in the context of + # a Rack::Builder block, returning a Rack application. + # + # source://rack//lib/rack/builder.rb#102 + def new_from_string(builder_script, path = T.unsafe(nil), **options); end + + # Parse the given config file to get a Rack application. + # + # If the config file ends in +.ru+, it is treated as a + # rackup file and the contents will be treated as if + # specified inside a Rack::Builder block. + # + # If the config file does not end in +.ru+, it is + # required and Rack will use the basename of the file + # to guess which constant will be the Rack application to run. + # + # Examples: + # + # Rack::Builder.parse_file('config.ru') + # # Rack application built using Rack::Builder.new + # + # Rack::Builder.parse_file('app.rb') + # # requires app.rb, which can be anywhere in Ruby's + # # load path. After requiring, assumes App constant + # # is a Rack application + # + # Rack::Builder.parse_file('./my_app.rb') + # # requires ./my_app.rb, which should be in the + # # process's current directory. After requiring, + # # assumes MyApp constant is a Rack application + # + # source://rack//lib/rack/builder.rb#65 + def parse_file(path, **options); end + end +end + +# https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-without-bom +# +# source://rack//lib/rack/builder.rb#39 +Rack::Builder::UTF_8_BOM = T.let(T.unsafe(nil), String) + +# Response Header Keys +# +# source://rack//lib/rack/constants.rb#19 +Rack::CACHE_CONTROL = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#35 +Rack::CONNECT = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#20 +Rack::CONTENT_LENGTH = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#21 +Rack::CONTENT_TYPE = T.let(T.unsafe(nil), String) + +# Rack::Cascade tries a request on several apps, and returns the +# first response that is not 404 or 405 (or in a list of configured +# status codes). If all applications tried return one of the configured +# status codes, return the last response. +# +# source://rack//lib/rack/cascade.rb#11 +class Rack::Cascade + # Set the apps to send requests to, and what statuses result in + # cascading. Arguments: + # + # apps: An enumerable of rack applications. + # cascade_for: The statuses to use cascading for. If a response is received + # from an app, the next app is tried. + # + # @return [Cascade] a new instance of Cascade + # + # source://rack//lib/rack/cascade.rb#21 + def initialize(apps, cascade_for = T.unsafe(nil)); end + + # Append an app to the list of apps to cascade. This app will + # be tried last. + # + # source://rack//lib/rack/cascade.rb#56 + def <<(app); end + + # Append an app to the list of apps to cascade. This app will + # be tried last. + # + # source://rack//lib/rack/cascade.rb#56 + def add(app); end + + # An array of applications to try in order. + # + # source://rack//lib/rack/cascade.rb#13 + def apps; end + + # Call each app in order. If the responses uses a status that requires + # cascading, try the next app. If all responses require cascading, + # return the response from the last app. + # + # source://rack//lib/rack/cascade.rb#32 + def call(env); end + + # Whether the given app is one of the apps to cascade to. + # + # @return [Boolean] + # + # source://rack//lib/rack/cascade.rb#61 + def include?(app); end +end + +# Rack::CommonLogger forwards every request to the given +app+, and +# logs a line in the +# {Apache common log format}[http://httpd.apache.org/docs/1.3/logs.html#common] +# to the configured logger. +# +# source://rack//lib/rack/common_logger.rb#13 +class Rack::CommonLogger + # +logger+ can be any object that supports the +write+ or +<<+ methods, + # which includes the standard library Logger. These methods are called + # with a single string argument, the log message. + # If +logger+ is nil, CommonLogger will fall back env['rack.errors']. + # + # @return [CommonLogger] a new instance of CommonLogger + # + # source://rack//lib/rack/common_logger.rb#29 + def initialize(app, logger = T.unsafe(nil)); end + + # Log all requests in common_log format after a response has been + # returned. Note that if the app raises an exception, the request + # will not be logged, so if exception handling middleware are used, + # they should be loaded after this middleware. Additionally, because + # the logging happens after the request body has been fully sent, any + # exceptions raised during the sending of the response body will + # cause the request not to be logged. + # + # source://sinatra/4.0.0/lib/sinatra/base.rb#264 + def call(env); end + + # source://rack//lib/rack/common_logger.rb#41 + def call_without_check(env); end + + private + + # Attempt to determine the content length for the response to + # include it in the logged data. + # + # source://rack//lib/rack/common_logger.rb#83 + def extract_content_length(headers); end + + # Log the request to the configured logger. + # + # source://rack//lib/rack/common_logger.rb#52 + def log(env, status, response_headers, began_at); end +end + +# Common Log Format: http://httpd.apache.org/docs/1.3/logs.html#common +# +# lilith.local - - [07/Aug/2006 23:58:02 -0400] "GET / HTTP/1.1" 500 - +# +# %{%s - %s [%s] "%s %s%s %s" %d %s\n} % +# +# The actual format is slightly different than the above due to the +# separation of SCRIPT_NAME and PATH_INFO, and because the elapsed +# time in seconds is included at the end. +# +# source://rack//lib/rack/common_logger.rb#23 +Rack::CommonLogger::FORMAT = T.let(T.unsafe(nil), String) + +# Middleware that enables conditional GET using if-none-match and +# if-modified-since. The application should set either or both of the +# last-modified or etag response headers according to RFC 2616. When +# either of the conditions is met, the response body is set to be zero +# length and the response status is set to 304 Not Modified. +# +# Applications that defer response body generation until the body's each +# message is received will avoid response body generation completely when +# a conditional GET matches. +# +# Adapted from Michael Klishin's Merb implementation: +# https://github.com/wycats/merb/blob/master/merb-core/lib/merb-core/rack/middleware/conditional_get.rb +# +# source://rack//lib/rack/conditional_get.rb#21 +class Rack::ConditionalGet + # @return [ConditionalGet] a new instance of ConditionalGet + # + # source://rack//lib/rack/conditional_get.rb#22 + def initialize(app); end + + # Return empty 304 response if the response has not been + # modified since the last request. + # + # source://rack//lib/rack/conditional_get.rb#28 + def call(env); end + + private + + # Whether the etag response header matches the if-none-match request header. + # If so, the request has not been modified. + # + # @return [Boolean] + # + # source://rack//lib/rack/conditional_get.rb#62 + def etag_matches?(none_match, headers); end + + # Return whether the response has not been modified since the + # last request. + # + # @return [Boolean] + # + # source://rack//lib/rack/conditional_get.rb#51 + def fresh?(env, headers); end + + # Whether the last-modified response header matches the if-modified-since + # request header. If so, the request has not been modified. + # + # @return [Boolean] + # + # source://rack//lib/rack/conditional_get.rb#68 + def modified_since?(modified_since, headers); end + + # Return a Time object for the given string (which should be in RFC2822 + # format), or nil if the string cannot be parsed. + # + # source://rack//lib/rack/conditional_get.rb#75 + def to_rfc2822(since); end +end + +# Rack::Config modifies the environment using the block given during +# initialization. +# +# Example: +# use Rack::Config do |env| +# env['my-key'] = 'some-value' +# end +# +# source://rack//lib/rack/config.rb#11 +class Rack::Config + # @return [Config] a new instance of Config + # + # source://rack//lib/rack/config.rb#12 + def initialize(app, &block); end + + # source://rack//lib/rack/config.rb#17 + def call(env); end +end + +# Sets the content-length header on responses that do not specify +# a content-length or transfer-encoding header. Note that this +# does not fix responses that have an invalid content-length +# header specified. +# +# source://rack//lib/rack/content_length.rb#12 +class Rack::ContentLength + include ::Rack::Utils + + # @return [ContentLength] a new instance of ContentLength + # + # source://rack//lib/rack/content_length.rb#15 + def initialize(app); end + + # source://rack//lib/rack/content_length.rb#19 + def call(env); end +end + +# Sets the content-type header on responses which don't have one. +# +# Builder Usage: +# use Rack::ContentType, "text/plain" +# +# When no content type argument is provided, "text/html" is the +# default. +# +# source://rack//lib/rack/content_type.rb#15 +class Rack::ContentType + include ::Rack::Utils + + # @return [ContentType] a new instance of ContentType + # + # source://rack//lib/rack/content_type.rb#18 + def initialize(app, content_type = T.unsafe(nil)); end + + # source://rack//lib/rack/content_type.rb#23 + def call(env); end +end + +# source://rack//lib/rack/constants.rb#32 +Rack::DELETE = T.let(T.unsafe(nil), String) + +# This middleware enables content encoding of http responses, +# usually for purposes of compression. +# +# Currently supported encodings: +# +# * gzip +# * identity (no transformation) +# +# This middleware automatically detects when encoding is supported +# and allowed. For example no encoding is made when a cache +# directive of 'no-transform' is present, when the response status +# code is one that doesn't allow an entity body, or when the body +# is empty. +# +# Note that despite the name, Deflater does not support the +deflate+ +# encoding. +# +# source://rack//lib/rack/deflater.rb#28 +class Rack::Deflater + # Creates Rack::Deflater middleware. Options: + # + # :if :: a lambda enabling / disabling deflation based on returned boolean value + # (e.g use Rack::Deflater, :if => lambda { |*, body| sum=0; body.each { |i| sum += i.length }; sum > 512 }). + # However, be aware that calling `body.each` inside the block will break cases where `body.each` is not idempotent, + # such as when it is an +IO+ instance. + # :include :: a list of content types that should be compressed. By default, all content types are compressed. + # :sync :: determines if the stream is going to be flushed after every chunk. Flushing after every chunk reduces + # latency for time-sensitive streaming applications, but hurts compression and throughput. + # Defaults to +true+. + # + # @return [Deflater] a new instance of Deflater + # + # source://rack//lib/rack/deflater.rb#39 + def initialize(app, options = T.unsafe(nil)); end + + # source://rack//lib/rack/deflater.rb#46 + def call(env); end + + private + + # Whether the body should be compressed. + # + # @return [Boolean] + # + # source://rack//lib/rack/deflater.rb#136 + def should_deflate?(env, status, headers, body); end +end + +# Body class used for gzip encoded responses. +# +# source://rack//lib/rack/deflater.rb#83 +class Rack::Deflater::GzipStream + # Initialize the gzip stream. Arguments: + # body :: Response body to compress with gzip + # mtime :: The modification time of the body, used to set the + # modification time in the gzip header. + # sync :: Whether to flush each gzip chunk as soon as it is ready. + # + # @return [GzipStream] a new instance of GzipStream + # + # source://rack//lib/rack/deflater.rb#92 + def initialize(body, mtime, sync); end + + # Close the original body if possible. + # + # source://rack//lib/rack/deflater.rb#128 + def close; end + + # Yield gzip compressed strings to the given block. + # + # source://rack//lib/rack/deflater.rb#99 + def each(&block); end + + # Call the block passed to #each with the gzipped data. + # + # source://rack//lib/rack/deflater.rb#123 + def write(data); end +end + +# source://rack//lib/rack/deflater.rb#85 +Rack::Deflater::GzipStream::BUFFER_LENGTH = T.let(T.unsafe(nil), Integer) + +# Rack::Directory serves entries below the +root+ given, according to the +# path info of the Rack request. If a directory is found, the file's contents +# will be presented in an html based index. If a file is found, the env will +# be passed to the specified +app+. +# +# If +app+ is not specified, a Rack::Files of the same +root+ will be used. +# +# source://rack//lib/rack/directory.rb#19 +class Rack::Directory + # Set the root directory and application for serving files. + # + # @return [Directory] a new instance of Directory + # + # source://rack//lib/rack/directory.rb#83 + def initialize(root, app = T.unsafe(nil)); end + + # source://rack//lib/rack/directory.rb#89 + def call(env); end + + # Rack response to use for requests with invalid paths, or nil if path is valid. + # + # source://rack//lib/rack/directory.rb#109 + def check_bad_request(path_info); end + + # Rack response to use for requests with paths outside the root, or nil if path is inside the root. + # + # source://rack//lib/rack/directory.rb#119 + def check_forbidden(path_info); end + + # Rack response to use for unreadable and non-file, non-directory entries. + # + # source://rack//lib/rack/directory.rb#181 + def entity_not_found(path_info); end + + # Provide human readable file sizes + # + # source://rack//lib/rack/directory.rb#197 + def filesize_format(int); end + + # Internals of request handling. Similar to call but does + # not remove body for HEAD requests. + # + # source://rack//lib/rack/directory.rb#96 + def get(env); end + + # Rack response to use for directories under the root. + # + # source://rack//lib/rack/directory.rb#130 + def list_directory(path_info, path, script_name); end + + # Rack response to use for files and directories under the root. + # Unreadable and non-file, non-directory entries will get a 404 response. + # + # source://rack//lib/rack/directory.rb#171 + def list_path(env, path, path_info, script_name); end + + # The root of the directory hierarchy. Only requests for files and + # directories inside of the root directory are supported. + # + # source://rack//lib/rack/directory.rb#80 + def root; end + + # File::Stat for the given path, but return nil for missing/bad entries. + # + # source://rack//lib/rack/directory.rb#163 + def stat(path); end +end + +# source://rack//lib/rack/directory.rb#20 +Rack::Directory::DIR_FILE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/directory.rb#43 +Rack::Directory::DIR_PAGE_FOOTER = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/directory.rb#21 +Rack::Directory::DIR_PAGE_HEADER = T.let(T.unsafe(nil), String) + +# Body class for directory entries, showing an index page with links +# to each file. +# +# source://rack//lib/rack/directory.rb#51 +class Rack::Directory::DirectoryBody < ::Struct + # Yield strings for each part of the directory entry + # + # @yield [DIR_PAGE_HEADER % [ show_path, show_path ]] + # + # source://rack//lib/rack/directory.rb#53 + def each; end + + private + + # Escape each element in the array of html strings. + # + # source://rack//lib/rack/directory.rb#73 + def DIR_FILE_escape(htmls); end +end + +# Stolen from Ramaze +# +# source://rack//lib/rack/directory.rb#189 +Rack::Directory::FILESIZE_FORMAT = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/constants.rb#22 +Rack::ETAG = T.let(T.unsafe(nil), String) + +# Automatically sets the etag header on all String bodies. +# +# The etag header is skipped if etag or last-modified headers are sent or if +# a sendfile body (body.responds_to :to_path) is given (since such cases +# should be handled by apache/nginx). +# +# On initialization, you can pass two parameters: a cache-control directive +# used when etag is absent and a directive when it is present. The first +# defaults to nil, while the second defaults to "max-age=0, private, must-revalidate" +# +# source://rack//lib/rack/etag.rb#18 +class Rack::ETag + # @return [ETag] a new instance of ETag + # + # source://rack//lib/rack/etag.rb#22 + def initialize(app, no_cache_control = T.unsafe(nil), cache_control = T.unsafe(nil)); end + + # source://rack//lib/rack/etag.rb#28 + def call(env); end + + private + + # source://rack//lib/rack/etag.rb#58 + def digest_body(body); end + + # @return [Boolean] + # + # source://rack//lib/rack/etag.rb#50 + def etag_status?(status); end + + # @return [Boolean] + # + # source://rack//lib/rack/etag.rb#54 + def skip_caching?(headers); end +end + +# source://rack//lib/rack/etag.rb#20 +Rack::ETag::DEFAULT_CACHE_CONTROL = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/etag.rb#19 +Rack::ETag::ETAG_STRING = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#23 +Rack::EXPIRES = T.let(T.unsafe(nil), String) + +# This middleware provides hooks to certain places in the request / +# response lifecycle. This is so that middleware that don't need to filter +# the response data can safely leave it alone and not have to send messages +# down the traditional "rack stack". +# +# The events are: +# +# * on_start(request, response) +# +# This event is sent at the start of the request, before the next +# middleware in the chain is called. This method is called with a request +# object, and a response object. Right now, the response object is always +# nil, but in the future it may actually be a real response object. +# +# * on_commit(request, response) +# +# The response has been committed. The application has returned, but the +# response has not been sent to the webserver yet. This method is always +# called with a request object and the response object. The response +# object is constructed from the rack triple that the application returned. +# Changes may still be made to the response object at this point. +# +# * on_send(request, response) +# +# The webserver has started iterating over the response body and presumably +# has started sending data over the wire. This method is always called with +# a request object and the response object. The response object is +# constructed from the rack triple that the application returned. Changes +# SHOULD NOT be made to the response object as the webserver has already +# started sending data. Any mutations will likely result in an exception. +# +# * on_finish(request, response) +# +# The webserver has closed the response, and all data has been written to +# the response socket. The request and response object should both be +# read-only at this point. The body MAY NOT be available on the response +# object as it may have been flushed to the socket. +# +# * on_error(request, response, error) +# +# An exception has occurred in the application or an `on_commit` event. +# This method will get the request, the response (if available) and the +# exception that was raised. +# +# ## Order +# +# `on_start` is called on the handlers in the order that they were passed to +# the constructor. `on_commit`, on_send`, `on_finish`, and `on_error` are +# called in the reverse order. `on_finish` handlers are called inside an +# `ensure` block, so they are guaranteed to be called even if something +# raises an exception. If something raises an exception in a `on_finish` +# method, then nothing is guaranteed. +# +# source://rack//lib/rack/events.rb#61 +class Rack::Events + # @return [Events] a new instance of Events + # + # source://rack//lib/rack/events.rb#106 + def initialize(app, handlers); end + + # source://rack//lib/rack/events.rb#111 + def call(env); end + + private + + # source://rack//lib/rack/events.rb#149 + def make_request(env); end + + # source://rack//lib/rack/events.rb#153 + def make_response(status, headers, body); end + + # source://rack//lib/rack/events.rb#137 + def on_commit(request, response); end + + # source://rack//lib/rack/events.rb#133 + def on_error(request, response, e); end + + # source://rack//lib/rack/events.rb#145 + def on_finish(request, response); end + + # source://rack//lib/rack/events.rb#141 + def on_start(request, response); end +end + +# source://rack//lib/rack/events.rb#62 +module Rack::Events::Abstract + # source://rack//lib/rack/events.rb#66 + def on_commit(req, res); end + + # source://rack//lib/rack/events.rb#75 + def on_error(req, res, e); end + + # source://rack//lib/rack/events.rb#72 + def on_finish(req, res); end + + # source://rack//lib/rack/events.rb#69 + def on_send(req, res); end + + # source://rack//lib/rack/events.rb#63 + def on_start(req, res); end +end + +# source://rack//lib/rack/events.rb#95 +class Rack::Events::BufferedResponse < ::Rack::Response::Raw + # @return [BufferedResponse] a new instance of BufferedResponse + # + # source://rack//lib/rack/events.rb#98 + def initialize(status, headers, body); end + + # Returns the value of attribute body. + # + # source://rack//lib/rack/events.rb#96 + def body; end + + # source://rack//lib/rack/events.rb#103 + def to_a; end +end + +# source://rack//lib/rack/events.rb#79 +class Rack::Events::EventedBodyProxy < ::Rack::BodyProxy + # @return [EventedBodyProxy] a new instance of EventedBodyProxy + # + # source://rack//lib/rack/events.rb#82 + def initialize(body, request, response, handlers, &block); end + + # source://rack//lib/rack/events.rb#89 + def each; end + + # Returns the value of attribute request. + # + # source://rack//lib/rack/events.rb#80 + def request; end + + # Returns the value of attribute response. + # + # source://rack//lib/rack/events.rb#80 + def response; end +end + +# Rack::Files serves files below the +root+ directory given, according to the +# path info of the Rack request. +# e.g. when Rack::Files.new("/etc") is used, you can access 'passwd' file +# as http://localhost:9292/passwd +# +# Handlers can detect if bodies are a Rack::Files, and use mechanisms +# like sendfile on the +path+. +# +# source://rack//lib/rack/files.rb#20 +class Rack::Files + # @return [Files] a new instance of Files + # + # source://rack//lib/rack/files.rb#27 + def initialize(root, headers = T.unsafe(nil), default_mime = T.unsafe(nil)); end + + # source://rack//lib/rack/files.rb#34 + def call(env); end + + # source://rack//lib/rack/files.rb#39 + def get(env); end + + # Returns the value of attribute root. + # + # source://rack//lib/rack/files.rb#25 + def root; end + + # source://rack//lib/rack/files.rb#68 + def serving(request, path); end + + private + + # source://rack//lib/rack/files.rb#190 + def fail(status, body, headers = T.unsafe(nil)); end + + # source://rack//lib/rack/files.rb#209 + def filesize(path); end + + # The MIME type for the contents of the file located at @path + # + # source://rack//lib/rack/files.rb#205 + def mime_type(path, default_mime); end +end + +# source://rack//lib/rack/files.rb#21 +Rack::Files::ALLOWED_VERBS = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/files.rb#22 +Rack::Files::ALLOW_HEADER = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/files.rb#121 +class Rack::Files::BaseIterator + # @return [BaseIterator] a new instance of BaseIterator + # + # source://rack//lib/rack/files.rb#124 + def initialize(path, ranges, options); end + + # source://rack//lib/rack/files.rb#144 + def bytesize; end + + # source://rack//lib/rack/files.rb#153 + def close; end + + # source://rack//lib/rack/files.rb#130 + def each; end + + # Returns the value of attribute options. + # + # source://rack//lib/rack/files.rb#122 + def options; end + + # Returns the value of attribute path. + # + # source://rack//lib/rack/files.rb#122 + def path; end + + # Returns the value of attribute ranges. + # + # source://rack//lib/rack/files.rb#122 + def ranges; end + + private + + # source://rack//lib/rack/files.rb#171 + def each_range_part(file, range); end + + # @return [Boolean] + # + # source://rack//lib/rack/files.rb#157 + def multipart?; end + + # source://rack//lib/rack/files.rb#161 + def multipart_heading(range); end +end + +# source://rack//lib/rack/files.rb#184 +class Rack::Files::Iterator < ::Rack::Files::BaseIterator + # source://rack//lib/rack/files.rb#122 + def to_path; end +end + +# source://rack//lib/rack/files.rb#23 +Rack::Files::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String) + +# Rack::ForwardRequest gets caught by Rack::Recursive and redirects +# the current request to the app at +url+. +# +# raise ForwardRequest.new("/not-found") +# +# source://rack//lib/rack/recursive.rb#14 +class Rack::ForwardRequest < ::Exception + # @return [ForwardRequest] a new instance of ForwardRequest + # + # source://rack//lib/rack/recursive.rb#17 + def initialize(url, env = T.unsafe(nil)); end + + # Returns the value of attribute env. + # + # source://rack//lib/rack/recursive.rb#15 + def env; end + + # Returns the value of attribute url. + # + # source://rack//lib/rack/recursive.rb#15 + def url; end +end + +# HTTP method verbs +# +# source://rack//lib/rack/constants.rb#28 +Rack::GET = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#33 +Rack::HEAD = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#7 +Rack::HTTPS = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#16 +Rack::HTTP_COOKIE = T.let(T.unsafe(nil), String) + +# Request env keys +# +# source://rack//lib/rack/constants.rb#5 +Rack::HTTP_HOST = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#6 +Rack::HTTP_PORT = T.let(T.unsafe(nil), String) + +# Rack::Head returns an empty body for all HEAD requests. It leaves +# all other requests unchanged. +# +# source://rack//lib/rack/head.rb#9 +class Rack::Head + # @return [Head] a new instance of Head + # + # source://rack//lib/rack/head.rb#10 + def initialize(app); end + + # source://rack//lib/rack/head.rb#14 + def call(env); end +end + +# Rack::Headers is a Hash subclass that downcases all keys. It's designed +# to be used by rack applications that don't implement the Rack 3 SPEC +# (by using non-lowercase response header keys), automatically handling +# the downcasing of keys. +# +# source://rack//lib/rack/headers.rb#8 +class Rack::Headers < ::Hash + # source://rack//lib/rack/headers.rb#110 + def [](key); end + + # source://rack//lib/rack/headers.rb#114 + def []=(key, value); end + + # source://rack//lib/rack/headers.rb#119 + def assoc(key); end + + # @raise [TypeError] + # + # source://rack//lib/rack/headers.rb#123 + def compare_by_identity; end + + # source://rack//lib/rack/headers.rb#127 + def delete(key); end + + # source://rack//lib/rack/headers.rb#131 + def dig(key, *a); end + + # :nocov: + # + # source://rack//lib/rack/headers.rb#227 + def except(*a); end + + # source://rack//lib/rack/headers.rb#135 + def fetch(key, *default, &block); end + + # source://rack//lib/rack/headers.rb#140 + def fetch_values(*a); end + + # @return [Boolean] + # + # source://rack//lib/rack/headers.rb#144 + def has_key?(key); end + + # @return [Boolean] + # + # source://rack//lib/rack/headers.rb#144 + def include?(key); end + + # source://rack//lib/rack/headers.rb#151 + def invert; end + + # @return [Boolean] + # + # source://rack//lib/rack/headers.rb#144 + def key?(key); end + + # @return [Boolean] + # + # source://rack//lib/rack/headers.rb#144 + def member?(key); end + + # source://rack//lib/rack/headers.rb#157 + def merge(hash, &block); end + + # source://rack//lib/rack/headers.rb#186 + def merge!(hash, &block); end + + # source://rack//lib/rack/headers.rb#161 + def reject(&block); end + + # source://rack//lib/rack/headers.rb#167 + def replace(hash); end + + # source://rack//lib/rack/headers.rb#172 + def select(&block); end + + # :nocov: + # + # source://rack//lib/rack/headers.rb#205 + def slice(*a); end + + # source://rack//lib/rack/headers.rb#114 + def store(key, value); end + + # source://rack//lib/rack/headers.rb#178 + def to_proc; end + + # source://rack//lib/rack/headers.rb#211 + def transform_keys(&block); end + + # source://rack//lib/rack/headers.rb#215 + def transform_keys!; end + + # source://rack//lib/rack/headers.rb#182 + def transform_values(&block); end + + # source://rack//lib/rack/headers.rb#186 + def update(hash, &block); end + + # source://rack//lib/rack/headers.rb#198 + def values_at(*keys); end + + private + + # source://rack//lib/rack/headers.rb#234 + def downcase_key(key); end + + class << self + # source://rack//lib/rack/headers.rb#91 + def [](*items); end + end +end + +# source://rack//lib/rack/headers.rb#9 +Rack::Headers::KNOWN_HEADERS = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/constants.rb#36 +Rack::LINK = T.let(T.unsafe(nil), String) + +# Rack::Lint validates your application and the requests and +# responses according to the Rack spec. +# +# source://rack//lib/rack/lint.rb#13 +class Rack::Lint + # @return [Lint] a new instance of Lint + # + # source://rack//lib/rack/lint.rb#19 + def initialize(app); end + + # AUTHORS: n.b. The trailing whitespace between paragraphs is important and + # should not be removed. The whitespace creates paragraphs in the RDoc + # output. + # + # This specification aims to formalize the Rack protocol. You + # can (and should) use Rack::Lint to enforce it. + # + # When you develop middleware, be sure to add a Lint before and + # after to catch all mistakes. + # + # = Rack applications + # + # A Rack application is a Ruby object (not a class) that + # responds to +call+. + # + # source://rack//lib/rack/lint.rb#40 + def call(env = T.unsafe(nil)); end +end + +# :stopdoc: +# +# source://rack//lib/rack/lint.rb#25 +class Rack::Lint::LintError < ::RuntimeError; end + +# source://rack//lib/rack/lint.rb#15 +Rack::Lint::REQUEST_PATH_ABSOLUTE_FORM = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/lint.rb#17 +Rack::Lint::REQUEST_PATH_ASTERISK_FORM = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/lint.rb#16 +Rack::Lint::REQUEST_PATH_AUTHORITY_FORM = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/lint.rb#14 +Rack::Lint::REQUEST_PATH_ORIGIN_FORM = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/lint.rb#44 +class Rack::Lint::Wrapper + # @return [Wrapper] a new instance of Wrapper + # + # source://rack//lib/rack/lint.rb#45 + def initialize(app, env); end + + # ==== Streaming Body + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#939 + def call(stream); end + + # ==== The +content-length+ Header + # + # source://rack//lib/rack/lint.rb#757 + def check_content_length_header(status, headers); end + + # ==== The +content-type+ Header + # + # source://rack//lib/rack/lint.rb#741 + def check_content_type_header(status, headers); end + + # === Early Hints + # + # The application or any middleware may call the rack.early_hints + # with an object which would be valid as the headers of a Rack response. + # + # source://rack//lib/rack/lint.rb#657 + def check_early_hints(env); end + + # == The Environment + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#101 + def check_environment(env); end + + # === The Error Stream + # + # source://rack//lib/rack/lint.rb#531 + def check_error_stream(error); end + + # source://rack//lib/rack/lint.rb#731 + def check_header_value(key, value); end + + # === The Headers + # + # source://rack//lib/rack/lint.rb#691 + def check_headers(headers); end + + # === Hijacking + # + # The hijacking interfaces provides a means for an application to take + # control of the HTTP connection. There are two distinct hijack + # interfaces: full hijacking where the application takes over the raw + # connection, and partial hijacking where the application takes over + # just the response body stream. In both cases, the application is + # responsible for closing the hijacked stream. + # + # Full hijacking only works with HTTP/1. Partial hijacking is functionally + # equivalent to streaming bodies, and is still optionally supported for + # backwards compatibility with older Rack versions. + # + # ==== Full Hijack + # + # Full hijack is used to completely take over an HTTP/1 connection. It + # occurs before any headers are written and causes the request to + # ignores any response generated by the application. + # + # It is intended to be used when applications need access to raw HTTP/1 + # connection. + # + # source://rack//lib/rack/lint.rb#591 + def check_hijack(env); end + + # ==== Partial Hijack + # + # Partial hijack is used for bi-directional streaming of the request and + # response body. It occurs after the status and headers are written by + # the server and causes the server to ignore the Body of the response. + # + # It is intended to be used when applications need bi-directional + # streaming. + # + # source://rack//lib/rack/lint.rb#619 + def check_hijack_response(headers, env); end + + # === The Input Stream + # + # The input stream is an IO-like object which contains the raw HTTP + # POST data. + # + # source://rack//lib/rack/lint.rb#427 + def check_input_stream(input); end + + # ==== The +rack.protocol+ Header + # + # source://rack//lib/rack/lint.rb#785 + def check_rack_protocol_header(status, headers); end + + # == The Response + # + # === The Status + # + # source://rack//lib/rack/lint.rb#680 + def check_status(status); end + + # Setting this value informs the server that it should perform a + # connection upgrade. In HTTP/1, this is done using the +upgrade+ + # header. In HTTP/2, this is done by accepting the request. + # + # === The Body + # + # The Body is typically an +Array+ of +String+ instances, an enumerable + # that yields +String+ instances, a +Proc+ instance, or a File-like + # object. + # + # The Body must respond to +each+ or +call+. It may optionally respond + # to +to_path+ or +to_ary+. A Body that responds to +each+ is considered + # to be an Enumerable Body. A Body that responds to +call+ is considered + # to be a Streaming Body. + # + # A Body that responds to both +each+ and +call+ must be treated as an + # Enumerable Body, not a Streaming Body. If it responds to +each+, you + # must call +each+ and not +call+. If the Body doesn't respond to + # +each+, then you can assume it responds to +call+. + # + # The Body must either be consumed or returned. The Body is consumed by + # optionally calling either +each+ or +call+. + # Then, if the Body responds to +close+, it must be called to release + # any resources associated with the generation of the body. + # In other words, +close+ must always be called at least once; typically + # after the web server has sent the response to the client, but also in + # cases where the Rack application makes internal/virtual requests and + # discards the response. + # + # source://rack//lib/rack/lint.rb#831 + def close; end + + # ==== Enumerable Body + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#865 + def each; end + + # @return [Boolean] + # + # source://rack//lib/rack/lint.rb#910 + def respond_to?(name, *_arg1); end + + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#60 + def response; end + + # If the Body responds to +to_ary+, it must return an +Array+ whose + # contents are identical to that produced by calling +each+. + # Middleware may call +to_ary+ directly on the Body and return a new + # Body in its place. In other words, middleware can only process the + # Body directly if it responds to +to_ary+. If the Body responds to both + # +to_ary+ and +close+, its implementation of +to_ary+ must call + # +close+. + # + # source://rack//lib/rack/lint.rb#926 + def to_ary; end + + # source://rack//lib/rack/lint.rb#906 + def to_path; end + + # source://rack//lib/rack/lint.rb#770 + def verify_content_length(size); end + + # source://rack//lib/rack/lint.rb#847 + def verify_to_path; end +end + +# source://rack//lib/rack/lint.rb#904 +Rack::Lint::Wrapper::BODY_METHODS = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/lint.rb#540 +class Rack::Lint::Wrapper::ErrorWrapper + # @return [ErrorWrapper] a new instance of ErrorWrapper + # + # source://rack//lib/rack/lint.rb#541 + def initialize(error); end + + # * +close+ must never be called on the error stream. + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#563 + def close(*args); end + + # * +flush+ must be called without arguments and must be called + # in order to make the error appear for sure. + # + # source://rack//lib/rack/lint.rb#558 + def flush; end + + # * +puts+ must be called with a single argument that responds to +to_s+. + # + # source://rack//lib/rack/lint.rb#546 + def puts(str); end + + # * +write+ must be called with a single argument that is a String. + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#551 + def write(str); end +end + +# source://rack//lib/rack/lint.rb#445 +class Rack::Lint::Wrapper::InputWrapper + # @return [InputWrapper] a new instance of InputWrapper + # + # source://rack//lib/rack/lint.rb#446 + def initialize(input); end + + # * +close+ can be called on the input stream to indicate that + # any remaining input is not needed. + # + # source://rack//lib/rack/lint.rb#523 + def close(*args); end + + # * +each+ must be called without arguments and only yield Strings. + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#511 + def each(*args); end + + # * +gets+ must be called without arguments and return a string, + # or +nil+ on EOF. + # + # @raise [LintError] + # + # source://rack//lib/rack/lint.rb#452 + def gets(*args); end + + # * +read+ behaves like IO#read. + # Its signature is read([length, [buffer]]). + # + # If given, +length+ must be a non-negative Integer (>= 0) or +nil+, + # and +buffer+ must be a String and may not be nil. + # + # If +length+ is given and not nil, then this method reads at most + # +length+ bytes from the input stream. + # + # If +length+ is not given or nil, then this method reads + # all data until EOF. + # + # When EOF is reached, this method returns nil if +length+ is given + # and not nil, or "" if +length+ is not given or is nil. + # + # If +buffer+ is given, then the read data will be placed + # into +buffer+ instead of a newly created String object. + # + # source://rack//lib/rack/lint.rb#478 + def read(*args); end +end + +# source://rack//lib/rack/lint.rb#959 +class Rack::Lint::Wrapper::StreamWrapper + extend ::Forwardable + + # @return [StreamWrapper] a new instance of StreamWrapper + # + # source://rack//lib/rack/lint.rb#974 + def initialize(stream); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def <<(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def close(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def close_read(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def close_write(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def closed?(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def flush(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def read(*args, **_arg1, &block); end + + # source://forwardable/1.3.3/forwardable.rb#231 + def write(*args, **_arg1, &block); end +end + +# The semantics of these IO methods must be a best effort match to +# those of a normal Ruby IO or Socket object, using standard arguments +# and raising standard exceptions. Servers are encouraged to simply +# pass on real IO objects, although it is recognized that this approach +# is not directly compatible with HTTP/2. +# +# source://rack//lib/rack/lint.rb#967 +Rack::Lint::Wrapper::StreamWrapper::REQUIRED_METHODS = T.let(T.unsafe(nil), Array) + +# Rack::Lock locks every request inside a mutex, so that every request +# will effectively be executed synchronously. +# +# source://rack//lib/rack/lock.rb#8 +class Rack::Lock + # @return [Lock] a new instance of Lock + # + # source://rack//lib/rack/lock.rb#9 + def initialize(app, mutex = T.unsafe(nil)); end + + # source://rack//lib/rack/lock.rb#13 + def call(env); end + + private + + # source://rack//lib/rack/lock.rb#25 + def unlock; end +end + +# Sets up rack.logger to write to rack.errors stream +# +# source://rack//lib/rack/logger.rb#10 +class Rack::Logger + # @return [Logger] a new instance of Logger + # + # source://rack//lib/rack/logger.rb#11 + def initialize(app, level = T.unsafe(nil)); end + + # source://rack//lib/rack/logger.rb#15 + def call(env); end +end + +# Rack::MediaType parse media type and parameters out of content_type string +# +# source://rack//lib/rack/media_type.rb#6 +class Rack::MediaType + class << self + # The media type parameters provided in CONTENT_TYPE as a Hash, or + # an empty Hash if no CONTENT_TYPE or media-type parameters were + # provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8", + # this method responds with the following Hash: + # { 'charset' => 'utf-8' } + # + # source://rack//lib/rack/media_type.rb#30 + def params(content_type); end + + # The media type (type/subtype) portion of the CONTENT_TYPE header + # without any media type parameters. e.g., when CONTENT_TYPE is + # "text/plain;charset=utf-8", the media-type is "text/plain". + # + # For more information on the use of media types in HTTP, see: + # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 + # + # source://rack//lib/rack/media_type.rb#16 + def type(content_type); end + + private + + # source://rack//lib/rack/media_type.rb#43 + def strip_doublequotes(str); end + end +end + +# source://rack//lib/rack/media_type.rb#7 +Rack::MediaType::SPLIT_PATTERN = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/method_override.rb#8 +class Rack::MethodOverride + # @return [MethodOverride] a new instance of MethodOverride + # + # source://rack//lib/rack/method_override.rb#15 + def initialize(app); end + + # source://rack//lib/rack/method_override.rb#19 + def call(env); end + + # source://rack//lib/rack/method_override.rb#31 + def method_override(env); end + + private + + # source://rack//lib/rack/method_override.rb#44 + def allowed_methods; end + + # source://rack//lib/rack/method_override.rb#48 + def method_override_param(req); end +end + +# source://rack//lib/rack/method_override.rb#13 +Rack::MethodOverride::ALLOWED_METHODS = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/method_override.rb#9 +Rack::MethodOverride::HTTP_METHODS = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/method_override.rb#12 +Rack::MethodOverride::HTTP_METHOD_OVERRIDE_HEADER = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/method_override.rb#11 +Rack::MethodOverride::METHOD_OVERRIDE_PARAM_KEY = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/mime.rb#4 +module Rack::Mime + private + + # Returns true if the given value is a mime match for the given mime match + # specification, false otherwise. + # + # Rack::Mime.match?('text/html', 'text/*') => true + # Rack::Mime.match?('text/plain', '*') => true + # Rack::Mime.match?('text/html', 'application/json') => false + # + # @return [Boolean] + # + # source://rack//lib/rack/mime.rb#30 + def match?(value, matcher); end + + # Returns String with mime type if found, otherwise use +fallback+. + # +ext+ should be filename extension in the '.ext' format that + # File.extname(file) returns. + # +fallback+ may be any object + # + # Also see the documentation for MIME_TYPES + # + # Usage: + # Rack::Mime.mime_type('.foo') + # + # This is a shortcut for: + # Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream') + # + # source://rack//lib/rack/mime.rb#18 + def mime_type(ext, fallback = T.unsafe(nil)); end + + class << self + # Returns true if the given value is a mime match for the given mime match + # specification, false otherwise. + # + # Rack::Mime.match?('text/html', 'text/*') => true + # Rack::Mime.match?('text/plain', '*') => true + # Rack::Mime.match?('text/html', 'application/json') => false + # + # @return [Boolean] + # + # source://rack//lib/rack/mime.rb#30 + def match?(value, matcher); end + + # Returns String with mime type if found, otherwise use +fallback+. + # +ext+ should be filename extension in the '.ext' format that + # File.extname(file) returns. + # +fallback+ may be any object + # + # Also see the documentation for MIME_TYPES + # + # Usage: + # Rack::Mime.mime_type('.foo') + # + # This is a shortcut for: + # Rack::Mime::MIME_TYPES.fetch('.foo', 'application/octet-stream') + # + # source://rack//lib/rack/mime.rb#18 + def mime_type(ext, fallback = T.unsafe(nil)); end + end +end + +# List of most common mime-types, selected various sources +# according to their usefulness in a webserving scope for Ruby +# users. +# +# To amend this list with your local mime.types list you can use: +# +# require 'webrick/httputils' +# list = WEBrick::HTTPUtils.load_mime_types('/etc/mime.types') +# Rack::Mime::MIME_TYPES.merge!(list) +# +# N.B. On Ubuntu the mime.types file does not include the leading period, so +# users may need to modify the data before merging into the hash. +# +# source://rack//lib/rack/mime.rb#51 +Rack::Mime::MIME_TYPES = T.let(T.unsafe(nil), Hash) + +# Rack::MockRequest helps testing your Rack application without +# actually using HTTP. +# +# After performing a request on a URL with get/post/put/patch/delete, it +# returns a MockResponse with useful helper methods for effective +# testing. +# +# You can pass a hash with additional configuration to the +# get/post/put/patch/delete. +# :input:: A String or IO-like to be used as rack.input. +# :fatal:: Raise a FatalWarning if the app writes to rack.errors. +# :lint:: If true, wrap the application in a Rack::Lint. +# +# source://rack//lib/rack/mock_request.rb#23 +class Rack::MockRequest + # @return [MockRequest] a new instance of MockRequest + # + # source://rack//lib/rack/mock_request.rb#44 + def initialize(app); end + + # Make a DELETE request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock_request.rb#57 + def delete(uri, opts = T.unsafe(nil)); end + + # Make a GET request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock_request.rb#49 + def get(uri, opts = T.unsafe(nil)); end + + # Make a HEAD request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock_request.rb#59 + def head(uri, opts = T.unsafe(nil)); end + + # Make an OPTIONS request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock_request.rb#61 + def options(uri, opts = T.unsafe(nil)); end + + # Make a PATCH request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock_request.rb#55 + def patch(uri, opts = T.unsafe(nil)); end + + # Make a POST request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock_request.rb#51 + def post(uri, opts = T.unsafe(nil)); end + + # Make a PUT request and return a MockResponse. See #request. + # + # source://rack//lib/rack/mock_request.rb#53 + def put(uri, opts = T.unsafe(nil)); end + + # Make a request using the given request method for the given + # uri to the rack application and return a MockResponse. + # Options given are passed to MockRequest.env_for. + # + # source://rack//lib/rack/mock_request.rb#66 + def request(method = T.unsafe(nil), uri = T.unsafe(nil), opts = T.unsafe(nil)); end + + class << self + # Return the Rack environment used for a request to +uri+. + # All options that are strings are added to the returned environment. + # Options: + # :fatal :: Whether to raise an exception if request outputs to rack.errors + # :input :: The rack.input to set + # :http_version :: The SERVER_PROTOCOL to set + # :method :: The HTTP request method to use + # :params :: The params to use + # :script_name :: The SCRIPT_NAME to set + # + # source://rack//lib/rack/mock_request.rb#98 + def env_for(uri = T.unsafe(nil), opts = T.unsafe(nil)); end + + # For historical reasons, we're pinning to RFC 2396. + # URI::Parser = URI::RFC2396_Parser + # + # source://rack//lib/rack/mock_request.rb#84 + def parse_uri_rfc2396(uri); end + end +end + +# source://rack//lib/rack/mock_request.rb#27 +class Rack::MockRequest::FatalWarner + # source://rack//lib/rack/mock_request.rb#36 + def flush; end + + # @raise [FatalWarning] + # + # source://rack//lib/rack/mock_request.rb#28 + def puts(warning); end + + # source://rack//lib/rack/mock_request.rb#39 + def string; end + + # @raise [FatalWarning] + # + # source://rack//lib/rack/mock_request.rb#32 + def write(warning); end +end + +# source://rack//lib/rack/mock_request.rb#24 +class Rack::MockRequest::FatalWarning < ::RuntimeError; end + +# Rack::MockResponse provides useful helpers for testing your apps. +# Usually, you don't create the MockResponse on your own, but use +# MockRequest. +# +# source://rack//lib/rack/mock_response.rb#13 +class Rack::MockResponse < ::Rack::Response + # @return [MockResponse] a new instance of MockResponse + # + # source://rack//lib/rack/mock_response.rb#24 + def initialize(status, headers, body, errors = T.unsafe(nil)); end + + # source://rack//lib/rack/mock_response.rb#39 + def =~(other); end + + # source://rack//lib/rack/mock_response.rb#47 + def body; end + + # source://rack//lib/rack/mock_response.rb#73 + def cookie(name); end + + # Headers + # + # source://rack//lib/rack/mock_response.rb#19 + def cookies; end + + # @return [Boolean] + # + # source://rack//lib/rack/mock_response.rb#69 + def empty?; end + + # Errors + # + # source://rack//lib/rack/mock_response.rb#22 + def errors; end + + # Errors + # + # source://rack//lib/rack/mock_response.rb#22 + def errors=(_arg0); end + + # source://rack//lib/rack/mock_response.rb#43 + def match(other); end + + # Headers + # + # source://rack//lib/rack/mock_response.rb#19 + def original_headers; end + + private + + # source://rack//lib/rack/mock_response.rb#100 + def identify_cookie_attributes(cookie_filling); end + + # source://rack//lib/rack/mock_response.rb#79 + def parse_cookies_from_header; end + + class << self + def [](*_arg0); end + end +end + +# A multipart form data parser, adapted from IOWA. +# +# Usually, Rack::Request#POST takes care of calling this. +# +# source://rack//lib/rack/multipart/parser.rb#9 +module Rack::Multipart + class << self + # source://rack//lib/rack/multipart.rb#72 + def build_multipart(params, first = T.unsafe(nil)); end + + # source://rack//lib/rack/multipart.rb#68 + def extract_multipart(request, params = T.unsafe(nil)); end + + # source://rack//lib/rack/multipart.rb#48 + def parse_multipart(env, params = T.unsafe(nil)); end + end +end + +# Base class for multipart exceptions that do not subclass from +# other exception classes for backwards compatibility. +# +# source://rack//lib/rack/multipart/parser.rb#26 +class Rack::Multipart::BoundaryTooLongError < ::StandardError + include ::Rack::BadRequest +end + +# source://rack//lib/rack/multipart/parser.rb#33 +Rack::Multipart::EOL = T.let(T.unsafe(nil), String) + +# Use specific error class when parsing multipart request +# that ends early. +# +# source://rack//lib/rack/multipart/parser.rb#20 +class Rack::Multipart::EmptyContentError < ::EOFError + include ::Rack::BadRequest +end + +# Prefer to use the BoundaryTooLongError class or Rack::BadRequest. +# +# source://rack//lib/rack/multipart/parser.rb#31 +Rack::Multipart::Error = Rack::Multipart::BoundaryTooLongError + +# source://rack//lib/rack/multipart/generator.rb#7 +class Rack::Multipart::Generator + # @return [Generator] a new instance of Generator + # + # source://rack//lib/rack/multipart/generator.rb#8 + def initialize(params, first = T.unsafe(nil)); end + + # source://rack//lib/rack/multipart/generator.rb#16 + def dump; end + + private + + # source://rack//lib/rack/multipart/generator.rb#89 + def content_for_other(file, name); end + + # source://rack//lib/rack/multipart/generator.rb#77 + def content_for_tempfile(io, file, name); end + + # source://rack//lib/rack/multipart/generator.rb#52 + def flattened_params; end + + # @return [Boolean] + # + # source://rack//lib/rack/multipart/generator.rb#37 + def multipart?; end +end + +# source://rack//lib/rack/multipart/parser.rb#34 +Rack::Multipart::MULTIPART = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#16 +Rack::Multipart::MULTIPART_BOUNDARY = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/multipart/parser.rb#36 +Rack::Multipart::MULTIPART_CONTENT_DISPOSITION = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart/parser.rb#37 +Rack::Multipart::MULTIPART_CONTENT_ID = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart/parser.rb#35 +Rack::Multipart::MULTIPART_CONTENT_TYPE = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/multipart.rb#18 +class Rack::Multipart::MissingInputError < ::StandardError + include ::Rack::BadRequest +end + +# source://rack//lib/rack/multipart/parser.rb#10 +class Rack::Multipart::MultipartPartLimitError < ::Errno::EMFILE + include ::Rack::BadRequest +end + +# source://rack//lib/rack/multipart/parser.rb#14 +class Rack::Multipart::MultipartTotalPartLimitError < ::StandardError + include ::Rack::BadRequest +end + +# Accumulator for multipart form data, conforming to the QueryParser API. +# In future, the Parser could return the pair list directly, but that would +# change its API. +# +# source://rack//lib/rack/multipart.rb#25 +class Rack::Multipart::ParamList + # @return [ParamList] a new instance of ParamList + # + # source://rack//lib/rack/multipart.rb#34 + def initialize; end + + # source://rack//lib/rack/multipart.rb#38 + def <<(pair); end + + # source://rack//lib/rack/multipart.rb#42 + def to_params_hash; end + + class << self + # source://rack//lib/rack/multipart.rb#26 + def make_params; end + + # source://rack//lib/rack/multipart.rb#30 + def normalize_params(params, key, value); end + end +end + +# source://rack//lib/rack/multipart/parser.rb#39 +class Rack::Multipart::Parser + # @return [Parser] a new instance of Parser + # + # source://rack//lib/rack/multipart/parser.rb#200 + def initialize(boundary, tempfile, bufsize, query_parser); end + + # source://rack//lib/rack/multipart/parser.rb#217 + def parse(io); end + + # source://rack//lib/rack/multipart/parser.rb#240 + def result; end + + # Returns the value of attribute state. + # + # source://rack//lib/rack/multipart/parser.rb#198 + def state; end + + private + + # Scan until the we find the start or end of the boundary. + # If we find it, return the appropriate symbol for the start or + # end of the boundary. If we don't find the start or end of the + # boundary, clear the buffer and return nil. + # + # source://rack//lib/rack/multipart/parser.rb#434 + def consume_boundary; end + + # From WEBrick::HTTPUtils + # + # source://rack//lib/rack/multipart/parser.rb#252 + def dequote(str); end + + # Return the related Encoding object. However, because + # enc is submitted by the user, it may be invalid, so + # use a binary encoding in that case. + # + # source://rack//lib/rack/multipart/parser.rb#489 + def find_encoding(enc); end + + # source://rack//lib/rack/multipart/parser.rb#294 + def handle_consume_token; end + + # source://rack//lib/rack/multipart/parser.rb#495 + def handle_empty_content!(content); end + + # This handles the initial parser state. We read until we find the starting + # boundary, then we can transition to the next state. If we find the ending + # boundary, this is an invalid multipart upload, but keep scanning for opening + # boundary in that case. If no boundary found, we need to keep reading data + # and retry. It's highly unlikely the initial read will not consume the + # boundary. The client would have to deliberately craft a response + # with the opening boundary beyond the buffer size for that to happen. + # + # source://rack//lib/rack/multipart/parser.rb#271 + def handle_fast_forward; end + + # source://rack//lib/rack/multipart/parser.rb#411 + def handle_mime_body; end + + # source://rack//lib/rack/multipart/parser.rb#306 + def handle_mime_head; end + + # source://rack//lib/rack/multipart/parser.rb#443 + def normalize_filename(filename); end + + # source://rack//lib/rack/multipart/parser.rb#258 + def read_data(io, outbuf); end + + # source://rack//lib/rack/multipart/parser.rb#456 + def tag_multipart_encoding(filename, content_type, name, body); end + + class << self + # source://rack//lib/rack/multipart/parser.rb#87 + def parse(io, content_length, content_type, tmpfile, bufsize, qp); end + + # source://rack//lib/rack/multipart/parser.rb#80 + def parse_boundary(content_type); end + end +end + +# source://rack//lib/rack/multipart/parser.rb#40 +Rack::Multipart::Parser::BUFSIZE = T.let(T.unsafe(nil), Integer) + +# source://rack//lib/rack/multipart/parser.rb#48 +class Rack::Multipart::Parser::BoundedIO + # @return [BoundedIO] a new instance of BoundedIO + # + # source://rack//lib/rack/multipart/parser.rb#49 + def initialize(io, content_length); end + + # source://rack//lib/rack/multipart/parser.rb#55 + def read(size, outbuf = T.unsafe(nil)); end +end + +# source://rack//lib/rack/multipart/parser.rb#453 +Rack::Multipart::Parser::CHARSET = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/multipart/parser.rb#305 +Rack::Multipart::Parser::CONTENT_DISPOSITION_MAX_BYTES = T.let(T.unsafe(nil), Integer) + +# source://rack//lib/rack/multipart/parser.rb#304 +Rack::Multipart::Parser::CONTENT_DISPOSITION_MAX_PARAMS = T.let(T.unsafe(nil), Integer) + +# source://rack//lib/rack/multipart/parser.rb#107 +class Rack::Multipart::Parser::Collector + include ::Enumerable + + # @return [Collector] a new instance of Collector + # + # source://rack//lib/rack/multipart/parser.rb#143 + def initialize(tempfile); end + + # source://rack//lib/rack/multipart/parser.rb#149 + def each; end + + # source://rack//lib/rack/multipart/parser.rb#169 + def on_mime_body(mime_index, content); end + + # source://rack//lib/rack/multipart/parser.rb#173 + def on_mime_finish(mime_index); end + + # source://rack//lib/rack/multipart/parser.rb#153 + def on_mime_head(mime_index, head, filename, content_type, name); end + + private + + # source://rack//lib/rack/multipart/parser.rb#178 + def check_part_limits; end +end + +# source://rack//lib/rack/multipart/parser.rb#131 +class Rack::Multipart::Parser::Collector::BufferPart < ::Rack::Multipart::Parser::Collector::MimePart + # source://rack//lib/rack/multipart/parser.rb#133 + def close; end + + # @return [Boolean] + # + # source://rack//lib/rack/multipart/parser.rb#132 + def file?; end +end + +# source://rack//lib/rack/multipart/parser.rb#108 +class Rack::Multipart::Parser::Collector::MimePart < ::Struct + # @yield [data] + # + # source://rack//lib/rack/multipart/parser.rb#109 + def get_data; end +end + +# source://rack//lib/rack/multipart/parser.rb#136 +class Rack::Multipart::Parser::Collector::TempfilePart < ::Rack::Multipart::Parser::Collector::MimePart + # source://rack//lib/rack/multipart/parser.rb#138 + def close; end + + # @return [Boolean] + # + # source://rack//lib/rack/multipart/parser.rb#137 + def file?; end +end + +# source://rack//lib/rack/multipart/parser.rb#78 +Rack::Multipart::Parser::EMPTY = T.let(T.unsafe(nil), Rack::Multipart::Parser::MultipartInfo) + +# source://rack//lib/rack/multipart/parser.rb#77 +class Rack::Multipart::Parser::MultipartInfo < ::Struct + # Returns the value of attribute params + # + # @return [Object] the current value of params + def params; end + + # Sets the attribute params + # + # @param value [Object] the value to set the attribute params to. + # @return [Object] the newly set value + def params=(_); end + + # Returns the value of attribute tmp_files + # + # @return [Object] the current value of tmp_files + def tmp_files; end + + # Sets the attribute tmp_files + # + # @param value [Object] the value to set the attribute tmp_files to. + # @return [Object] the newly set value + def tmp_files=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://rack//lib/rack/multipart/parser.rb#42 +Rack::Multipart::Parser::TEMPFILE_FACTORY = T.let(T.unsafe(nil), Proc) + +# source://rack//lib/rack/multipart/parser.rb#41 +Rack::Multipart::Parser::TEXT_PLAIN = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/multipart/uploaded_file.rb#8 +class Rack::Multipart::UploadedFile + # @return [UploadedFile] a new instance of UploadedFile + # + # source://rack//lib/rack/multipart/uploaded_file.rb#16 + def initialize(filepath = T.unsafe(nil), ct = T.unsafe(nil), bin = T.unsafe(nil), path: T.unsafe(nil), content_type: T.unsafe(nil), binary: T.unsafe(nil), filename: T.unsafe(nil), io: T.unsafe(nil)); end + + # The content type of the "uploaded" file + # + # source://rack//lib/rack/multipart/uploaded_file.rb#14 + def content_type; end + + # The content type of the "uploaded" file + # + # source://rack//lib/rack/multipart/uploaded_file.rb#14 + def content_type=(_arg0); end + + # source://rack//lib/rack/multipart/uploaded_file.rb#31 + def local_path; end + + # source://rack//lib/rack/multipart/uploaded_file.rb#40 + def method_missing(method_name, *args, &block); end + + # The filename, *not* including the path, of the "uploaded" file + # + # source://rack//lib/rack/multipart/uploaded_file.rb#11 + def original_filename; end + + # source://rack//lib/rack/multipart/uploaded_file.rb#31 + def path; end + + # @return [Boolean] + # + # source://rack//lib/rack/multipart/uploaded_file.rb#36 + def respond_to?(*args); end +end + +# source://rack//lib/rack/null_logger.rb#6 +class Rack::NullLogger + # @return [NullLogger] a new instance of NullLogger + # + # source://rack//lib/rack/null_logger.rb#7 + def initialize(app); end + + # source://rack//lib/rack/null_logger.rb#45 + def <<(msg); end + + # source://rack//lib/rack/null_logger.rb#43 + def add(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end + + # source://rack//lib/rack/null_logger.rb#11 + def call(env); end + + # source://rack//lib/rack/null_logger.rb#42 + def close; end + + # source://rack//lib/rack/null_logger.rb#34 + def datetime_format; end + + # source://rack//lib/rack/null_logger.rb#39 + def datetime_format=(datetime_format); end + + # source://rack//lib/rack/null_logger.rb#17 + def debug(progname = T.unsafe(nil), &block); end + + # source://rack//lib/rack/null_logger.rb#27 + def debug!; end + + # @return [Boolean] + # + # source://rack//lib/rack/null_logger.rb#23 + def debug?; end + + # source://rack//lib/rack/null_logger.rb#19 + def error(progname = T.unsafe(nil), &block); end + + # source://rack//lib/rack/null_logger.rb#28 + def error!; end + + # @return [Boolean] + # + # source://rack//lib/rack/null_logger.rb#25 + def error?; end + + # source://rack//lib/rack/null_logger.rb#20 + def fatal(progname = T.unsafe(nil), &block); end + + # source://rack//lib/rack/null_logger.rb#29 + def fatal!; end + + # @return [Boolean] + # + # source://rack//lib/rack/null_logger.rb#26 + def fatal?; end + + # source://rack//lib/rack/null_logger.rb#35 + def formatter; end + + # source://rack//lib/rack/null_logger.rb#40 + def formatter=(formatter); end + + # source://rack//lib/rack/null_logger.rb#16 + def info(progname = T.unsafe(nil), &block); end + + # source://rack//lib/rack/null_logger.rb#30 + def info!; end + + # @return [Boolean] + # + # source://rack//lib/rack/null_logger.rb#22 + def info?; end + + # source://rack//lib/rack/null_logger.rb#32 + def level; end + + # source://rack//lib/rack/null_logger.rb#37 + def level=(level); end + + # source://rack//lib/rack/null_logger.rb#44 + def log(severity, message = T.unsafe(nil), progname = T.unsafe(nil), &block); end + + # source://rack//lib/rack/null_logger.rb#33 + def progname; end + + # source://rack//lib/rack/null_logger.rb#38 + def progname=(progname); end + + # source://rack//lib/rack/null_logger.rb#46 + def reopen(logdev = T.unsafe(nil)); end + + # source://rack//lib/rack/null_logger.rb#36 + def sev_threshold; end + + # source://rack//lib/rack/null_logger.rb#41 + def sev_threshold=(sev_threshold); end + + # source://rack//lib/rack/null_logger.rb#21 + def unknown(progname = T.unsafe(nil), &block); end + + # source://rack//lib/rack/null_logger.rb#18 + def warn(progname = T.unsafe(nil), &block); end + + # source://rack//lib/rack/null_logger.rb#31 + def warn!; end + + # @return [Boolean] + # + # source://rack//lib/rack/null_logger.rb#24 + def warn?; end +end + +# source://rack//lib/rack/constants.rb#34 +Rack::OPTIONS = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#31 +Rack::PATCH = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#8 +Rack::PATH_INFO = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#29 +Rack::POST = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#30 +Rack::PUT = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#12 +Rack::QUERY_STRING = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/query_parser.rb#7 +class Rack::QueryParser + # @return [QueryParser] a new instance of QueryParser + # + # source://rack//lib/rack/query_parser.rb#36 + def initialize(params_class, param_depth_limit); end + + # source://rack//lib/rack/query_parser.rb#166 + def make_params; end + + # source://rack//lib/rack/query_parser.rb#170 + def new_depth_limit(param_depth_limit); end + + # normalize_params recursively expands parameters into structural types. If + # the structural types represented by two different parameter names are in + # conflict, a ParameterTypeError is raised. The depth argument is deprecated + # and should no longer be used, it is kept for backwards compatibility with + # earlier versions of rack. + # + # source://rack//lib/rack/query_parser.rb#94 + def normalize_params(params, name, v, _depth = T.unsafe(nil)); end + + # Returns the value of attribute param_depth_limit. + # + # source://rack//lib/rack/query_parser.rb#34 + def param_depth_limit; end + + # parse_nested_query expands a query string into structural types. Supported + # types are Arrays, Hashes and basic value types. It is possible to supply + # query strings with parameters of conflicting types, in this case a + # ParameterTypeError is raised. Users are encouraged to return a 400 in this + # case. + # + # source://rack//lib/rack/query_parser.rb#73 + def parse_nested_query(qs, separator = T.unsafe(nil)); end + + # Stolen from Mongrel, with some small modifications: + # Parses a query string by breaking it up at the '&'. You can also use this + # to parse cookies by changing the characters used in the second parameter + # (which defaults to '&'). + # + # source://rack//lib/rack/query_parser.rb#45 + def parse_query(qs, separator = T.unsafe(nil), &unescaper); end + + private + + # @raise [ParamsTooDeepError] + # + # source://rack//lib/rack/query_parser.rb#98 + def _normalize_params(params, name, v, depth); end + + # @return [Boolean] + # + # source://rack//lib/rack/query_parser.rb#180 + def params_hash_has_key?(hash, key); end + + # @return [Boolean] + # + # source://rack//lib/rack/query_parser.rb#176 + def params_hash_type?(obj); end + + # source://rack//lib/rack/query_parser.rb#192 + def unescape(string, encoding = T.unsafe(nil)); end + + class << self + # source://rack//lib/rack/query_parser.rb#30 + def make_default(param_depth_limit); end + end +end + +# source://rack//lib/rack/query_parser.rb#9 +Rack::QueryParser::COMMON_SEP = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/query_parser.rb#8 +Rack::QueryParser::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp) + +# InvalidParameterError is the error that is raised when incoming structural +# parameters (parsed by parse_nested_query) contain invalid format or byte +# sequence. +# +# source://rack//lib/rack/query_parser.rb#20 +class Rack::QueryParser::InvalidParameterError < ::ArgumentError + include ::Rack::BadRequest +end + +# ParameterTypeError is the error that is raised when incoming structural +# parameters (parsed by parse_nested_query) contain conflicting types. +# +# source://rack//lib/rack/query_parser.rb#13 +class Rack::QueryParser::ParameterTypeError < ::TypeError + include ::Rack::BadRequest +end + +# source://rack//lib/rack/query_parser.rb#196 +class Rack::QueryParser::Params < ::Hash + def to_params_hash; end +end + +# ParamsTooDeepError is the error that is raised when params are recursively +# nested over the specified limit. +# +# source://rack//lib/rack/query_parser.rb#26 +class Rack::QueryParser::ParamsTooDeepError < ::RangeError + include ::Rack::BadRequest +end + +# source://rack//lib/rack/constants.rb#43 +Rack::RACK_EARLY_HINTS = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#44 +Rack::RACK_ERRORS = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#51 +Rack::RACK_HIJACK = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#46 +Rack::RACK_INPUT = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#52 +Rack::RACK_IS_HIJACK = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#45 +Rack::RACK_LOGGER = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#66 +Rack::RACK_METHODOVERRIDE_ORIGINAL_METHOD = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#54 +Rack::RACK_MULTIPART_BUFFER_SIZE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#55 +Rack::RACK_MULTIPART_TEMPFILE_FACTORY = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#53 +Rack::RACK_RECURSIVE_INCLUDE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#62 +Rack::RACK_REQUEST_COOKIE_HASH = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#63 +Rack::RACK_REQUEST_COOKIE_STRING = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#61 +Rack::RACK_REQUEST_FORM_ERROR = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#58 +Rack::RACK_REQUEST_FORM_HASH = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#57 +Rack::RACK_REQUEST_FORM_INPUT = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#59 +Rack::RACK_REQUEST_FORM_PAIRS = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#60 +Rack::RACK_REQUEST_FORM_VARS = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#64 +Rack::RACK_REQUEST_QUERY_HASH = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#65 +Rack::RACK_REQUEST_QUERY_STRING = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#56 +Rack::RACK_RESPONSE_FINISHED = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#47 +Rack::RACK_SESSION = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#48 +Rack::RACK_SESSION_OPTIONS = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#49 +Rack::RACK_SHOWSTATUS_DETAIL = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#42 +Rack::RACK_TEMPFILES = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#50 +Rack::RACK_URL_SCHEME = T.let(T.unsafe(nil), String) + +# Rack environment variables +# +# source://rack//lib/rack/constants.rb#41 +Rack::RACK_VERSION = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/version.rb#15 +Rack::RELEASE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#9 +Rack::REQUEST_METHOD = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#10 +Rack::REQUEST_PATH = T.let(T.unsafe(nil), String) + +# Rack::Recursive allows applications called down the chain to +# include data from other applications (by using +# rack['rack.recursive.include'][...] or raise a +# ForwardRequest to redirect internally. +# +# source://rack//lib/rack/recursive.rb#36 +class Rack::Recursive + # @return [Recursive] a new instance of Recursive + # + # source://rack//lib/rack/recursive.rb#37 + def initialize(app); end + + # source://rack//lib/rack/recursive.rb#45 + def _call(env); end + + # source://rack//lib/rack/recursive.rb#41 + def call(env); end + + # source://rack//lib/rack/recursive.rb#52 + def include(env, path); end +end + +# High performant source reloader +# +# This class acts as Rack middleware. +# +# What makes it especially suited for use in a production environment is that +# any file will only be checked once and there will only be made one system +# call stat(2). +# +# Please note that this will not reload files in the background, it does so +# only when actively called. +# +# It is performing a check/reload cycle at the start of every request, but +# also respects a cool down time, during which nothing will be done. +# +# source://rack//lib/rack/reloader.rb#24 +class Rack::Reloader + # @return [Reloader] a new instance of Reloader + # + # source://rack//lib/rack/reloader.rb#25 + def initialize(app, cooldown = T.unsafe(nil), backend = T.unsafe(nil)); end + + # source://rack//lib/rack/reloader.rb#36 + def call(env); end + + # source://rack//lib/rack/reloader.rb#50 + def reload!(stderr = T.unsafe(nil)); end + + # A safe Kernel::load, issuing the hooks depending on the results + # + # source://rack//lib/rack/reloader.rb#58 + def safe_load(file, mtime, stderr = T.unsafe(nil)); end +end + +# source://rack//lib/rack/reloader.rb#68 +module Rack::Reloader::Stat + # Takes a relative or absolute +file+ name, a couple possible +paths+ that + # the +file+ might reside in. Returns the full path and File::Stat for the + # path. + # + # source://rack//lib/rack/reloader.rb#88 + def figure_path(file, paths); end + + # source://rack//lib/rack/reloader.rb#69 + def rotation; end + + # source://rack//lib/rack/reloader.rb#103 + def safe_stat(file); end +end + +# Rack::Request provides a convenient interface to a Rack +# environment. It is stateless, the environment +env+ passed to the +# constructor will be directly modified. +# +# req = Rack::Request.new(env) +# req.post? +# req.params["data"] +# +# source://rack//lib/rack/request.rb#16 +class Rack::Request + include ::Rack::Request::Env + include ::Rack::Request::Helpers + + # @return [Request] a new instance of Request + # + # source://rack//lib/rack/request.rb#62 + def initialize(env); end + + # source://rack//lib/rack/request.rb#76 + def delete_param(k); end + + # source://rack//lib/rack/request.rb#67 + def params; end + + # source://rack//lib/rack/request.rb#67 + def query; end + + # source://rack//lib/rack/request.rb#71 + def update_param(k, v); end + + # source://yard/0.9.37/lib/yard/server/rack_adapter.rb#94 + def version_supplied; end + + # source://yard/0.9.37/lib/yard/server/rack_adapter.rb#94 + def version_supplied=(_arg0); end + + # source://yard/0.9.37/lib/yard/server/rack_adapter.rb#96 + def xhr?; end + + class << self + # The priority when checking forwarded headers. The default + # is [:forwarded, :x_forwarded], which means, check the + # +Forwarded+ header first, followed by the appropriate + # X-Forwarded-* header. You can revert the priority by + # reversing the priority, or remove checking of either + # or both headers by removing elements from the array. + # + # This should be set as appropriate in your environment + # based on what reverse proxies are in use. If you are not + # using reverse proxies, you should probably use an empty + # array. + # + # source://rack//lib/rack/request.rb#31 + def forwarded_priority; end + + # The priority when checking forwarded headers. The default + # is [:forwarded, :x_forwarded], which means, check the + # +Forwarded+ header first, followed by the appropriate + # X-Forwarded-* header. You can revert the priority by + # reversing the priority, or remove checking of either + # or both headers by removing elements from the array. + # + # This should be set as appropriate in your environment + # based on what reverse proxies are in use. If you are not + # using reverse proxies, you should probably use an empty + # array. + # + # source://rack//lib/rack/request.rb#31 + def forwarded_priority=(_arg0); end + + # Returns the value of attribute ip_filter. + # + # source://rack//lib/rack/request.rb#18 + def ip_filter; end + + # Sets the attribute ip_filter + # + # @param value the value to set the attribute ip_filter to. + # + # source://rack//lib/rack/request.rb#18 + def ip_filter=(_arg0); end + + # The priority when checking either the X-Forwarded-Proto + # or X-Forwarded-Scheme header for the forwarded protocol. + # The default is [:proto, :scheme], to try the + # X-Forwarded-Proto header before the + # X-Forwarded-Scheme header. Rack 2 had behavior + # similar to [:scheme, :proto]. You can remove either or + # both of the entries in array to ignore that respective header. + # + # source://rack//lib/rack/request.rb#40 + def x_forwarded_proto_priority; end + + # The priority when checking either the X-Forwarded-Proto + # or X-Forwarded-Scheme header for the forwarded protocol. + # The default is [:proto, :scheme], to try the + # X-Forwarded-Proto header before the + # X-Forwarded-Scheme header. Rack 2 had behavior + # similar to [:scheme, :proto]. You can remove either or + # both of the entries in array to ignore that respective header. + # + # source://rack//lib/rack/request.rb#40 + def x_forwarded_proto_priority=(_arg0); end + end +end + +# source://rack//lib/rack/request.rb#60 +Rack::Request::ALLOWED_SCHEMES = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/request.rb#82 +module Rack::Request::Env + # source://rack//lib/rack/request.rb#86 + def initialize(env); end + + # Add a header that may have multiple values. + # + # Example: + # request.add_header 'Accept', 'image/png' + # request.add_header 'Accept', '*/*' + # + # assert_equal 'image/png,*/*', request.get_header('Accept') + # + # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 + # + # source://rack//lib/rack/request.rb#129 + def add_header(key, v); end + + # Delete a request specific value for `name`. + # + # source://rack//lib/rack/request.rb#140 + def delete_header(name); end + + # Loops through each key / value pair in the request specific data. + # + # source://rack//lib/rack/request.rb#111 + def each_header(&block); end + + # The environment of the request. + # + # source://rack//lib/rack/request.rb#84 + def env; end + + # If a block is given, it yields to the block if the value hasn't been set + # on the request. + # + # source://rack//lib/rack/request.rb#106 + def fetch_header(name, &block); end + + # Get a request specific value for `name`. + # + # source://rack//lib/rack/request.rb#100 + def get_header(name); end + + # Predicate method to test to see if `name` has been set as request + # specific data + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#95 + def has_header?(name); end + + # Set a request specific value for `name` to `v` + # + # source://rack//lib/rack/request.rb#116 + def set_header(name, v); end + + private + + # source://rack//lib/rack/request.rb#144 + def initialize_copy(other); end +end + +# source://rack//lib/rack/request.rb#149 +module Rack::Request::Helpers + # Returns the data received in the query string. + # + # source://rack//lib/rack/request.rb#484 + def GET; end + + # Returns the data received in the request body. + # + # This method support both application/x-www-form-urlencoded and + # multipart/form-data. + # + # source://rack//lib/rack/request.rb#503 + def POST; end + + # source://rack//lib/rack/request.rb#607 + def accept_encoding; end + + # source://rack//lib/rack/request.rb#611 + def accept_language; end + + # The authority of the incoming request as defined by RFC3976. + # https://tools.ietf.org/html/rfc3986#section-3.2 + # + # In HTTP/1, this is the `host` header. + # In HTTP/2, this is the `:authority` pseudo-header. + # + # source://rack//lib/rack/request.rb#266 + def authority; end + + # source://rack//lib/rack/request.rb#590 + def base_url; end + + # source://rack//lib/rack/request.rb#190 + def body; end + + # The character set of the request body if a "charset" media type + # parameter was given, or nil if no "charset" was specified. Note + # that, per RFC2616, text/* media types that specify no explicit + # charset are to be considered ISO-8859-1. + # + # source://rack//lib/rack/request.rb#458 + def content_charset; end + + # source://rack//lib/rack/request.rb#199 + def content_length; end + + # source://rack//lib/rack/request.rb#308 + def content_type; end + + # source://rack//lib/rack/request.rb#293 + def cookies; end + + # Checks the HTTP request method (or verb) to see if it was of type DELETE + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#220 + def delete?; end + + # Destructively delete a parameter, whether it's in GET or POST. Returns the value of the deleted parameter. + # + # If the parameter is in both GET and POST, the POST value takes precedence since that's how #params works. + # + # env['rack.input'] is not touched. + # + # source://rack//lib/rack/request.rb#585 + def delete_param(k); end + + # Determine whether the request body contains form-data by checking + # the request content-type for one of the media-types: + # "application/x-www-form-urlencoded" or "multipart/form-data". The + # list of form-data media types can be modified through the + # +FORM_DATA_MEDIA_TYPES+ array. + # + # A request body is also assumed to contain form-data when no + # content-type header is provided and the request_method is POST. + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#470 + def form_data?; end + + # source://rack//lib/rack/request.rb#393 + def forwarded_authority; end + + # source://rack//lib/rack/request.rb#353 + def forwarded_for; end + + # source://rack//lib/rack/request.rb#374 + def forwarded_port; end + + # source://rack//lib/rack/request.rb#603 + def fullpath; end + + # Checks the HTTP request method (or verb) to see if it was of type GET + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#223 + def get?; end + + # Checks the HTTP request method (or verb) to see if it was of type HEAD + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#226 + def head?; end + + # Returns a formatted host, suitable for being used in a URI. + # + # source://rack//lib/rack/request.rb#333 + def host; end + + # The `HTTP_HOST` header. + # + # source://rack//lib/rack/request.rb#318 + def host_authority; end + + # source://rack//lib/rack/request.rb#322 + def host_with_port(authority = T.unsafe(nil)); end + + # Returns an address suitable for being to resolve to an address. + # In the case of a domain name or IPv4 address, the result is the same + # as +host+. In the case of IPv6 or future address formats, the square + # brackets are removed. + # + # source://rack//lib/rack/request.rb#341 + def hostname; end + + # source://rack//lib/rack/request.rb#414 + def ip; end + + # Checks the HTTP request method (or verb) to see if it was of type LINK + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#232 + def link?; end + + # source://rack//lib/rack/request.rb#200 + def logger; end + + # The media type (type/subtype) portion of the CONTENT_TYPE header + # without any media type parameters. e.g., when CONTENT_TYPE is + # "text/plain;charset=utf-8", the media-type is "text/plain". + # + # For more information on the use of media types in HTTP, see: + # http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7 + # + # source://rack//lib/rack/request.rb#441 + def media_type; end + + # The media type parameters provided in CONTENT_TYPE as a Hash, or + # an empty Hash if no CONTENT_TYPE or media-type parameters were + # provided. e.g., when the CONTENT_TYPE is "text/plain;charset=utf-8", + # this method responds with the following Hash: + # { 'charset' => 'utf-8' } + # + # source://rack//lib/rack/request.rb#450 + def media_type_params; end + + # Checks the HTTP request method (or verb) to see if it was of type OPTIONS + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#229 + def options?; end + + # The union of GET and POST data. + # + # Note that modifications will not be persisted in the env. Use update_param or delete_param if you want to destructively modify params. + # + # source://rack//lib/rack/request.rb#556 + def params; end + + # Determine whether the request body contains data by checking + # the request media_type against registered parse-data media-types + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#479 + def parseable_data?; end + + # Checks the HTTP request method (or verb) to see if it was of type PATCH + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#235 + def patch?; end + + # source://rack//lib/rack/request.rb#599 + def path; end + + # source://rack//lib/rack/request.rb#194 + def path_info; end + + # source://rack//lib/rack/request.rb#195 + def path_info=(s); end + + # source://rack//lib/rack/request.rb#345 + def port; end + + # Checks the HTTP request method (or verb) to see if it was of type POST + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#238 + def post?; end + + # Checks the HTTP request method (or verb) to see if it was of type PUT + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#241 + def put?; end + + # source://rack//lib/rack/request.rb#198 + def query_string; end + + # the referer of the client + # + # source://rack//lib/rack/request.rb#204 + def referer; end + + # the referer of the client + # + # source://rack//lib/rack/request.rb#204 + def referrer; end + + # source://rack//lib/rack/request.rb#197 + def request_method; end + + # source://rack//lib/rack/request.rb#249 + def scheme; end + + # source://rack//lib/rack/request.rb#191 + def script_name; end + + # source://rack//lib/rack/request.rb#192 + def script_name=(s); end + + # The authority as defined by the `SERVER_NAME` and `SERVER_PORT` + # variables. + # + # source://rack//lib/rack/request.rb#272 + def server_authority; end + + # source://rack//lib/rack/request.rb#285 + def server_name; end + + # source://rack//lib/rack/request.rb#289 + def server_port; end + + # source://rack//lib/rack/request.rb#207 + def session; end + + # source://rack//lib/rack/request.rb#213 + def session_options; end + + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#410 + def ssl?; end + + # Checks the HTTP request method (or verb) to see if it was of type TRACE + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#244 + def trace?; end + + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#615 + def trusted_proxy?(ip); end + + # Checks the HTTP request method (or verb) to see if it was of type UNLINK + # + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#247 + def unlink?; end + + # Destructively update a parameter, whether it's in GET and/or POST. Returns nil. + # + # The parameter is updated wherever it was previous defined, so GET, POST, or both. If it wasn't previously defined, it's inserted into GET. + # + # env['rack.input'] is not touched. + # + # source://rack//lib/rack/request.rb#565 + def update_param(k, v); end + + # Tries to return a remake of the original request URL as a string. + # + # source://rack//lib/rack/request.rb#595 + def url; end + + # source://rack//lib/rack/request.rb#201 + def user_agent; end + + # like Hash#values_at + # + # source://rack//lib/rack/request.rb#620 + def values_at(*keys); end + + # @return [Boolean] + # + # source://rack//lib/rack/request.rb#313 + def xhr?; end + + private + + # source://rack//lib/rack/request.rb#776 + def allowed_scheme(header); end + + # source://rack//lib/rack/request.rb#628 + def default_session; end + + # source://rack//lib/rack/request.rb#684 + def expand_param_pairs(pairs, query_parser = T.unsafe(nil)); end + + # source://rack//lib/rack/request.rb#780 + def forwarded_priority; end + + # source://rack//lib/rack/request.rb#752 + def forwarded_scheme; end + + # Get an array of values set in the RFC 7239 `Forwarded` request header. + # + # source://rack//lib/rack/request.rb#668 + def get_http_forwarded(token); end + + # source://rack//lib/rack/request.rb#644 + def parse_http_accept_header(header); end + + # source://rack//lib/rack/request.rb#680 + def parse_multipart; end + + # source://rack//lib/rack/request.rb#676 + def parse_query(qs, d = T.unsafe(nil)); end + + # source://rack//lib/rack/request.rb#672 + def query_parser; end + + # source://rack//lib/rack/request.rb#743 + def reject_trusted_ip_addresses(ip_addresses); end + + # source://rack//lib/rack/request.rb#737 + def split_authority(authority); end + + # source://rack//lib/rack/request.rb#694 + def split_header(value); end + + # Assist with compatibility when processing `X-Forwarded-For`. + # + # source://rack//lib/rack/request.rb#631 + def wrap_ipv6(host); end + + # source://rack//lib/rack/request.rb#784 + def x_forwarded_proto_priority; end +end + +# source://rack//lib/rack/request.rb#722 +Rack::Request::Helpers::AUTHORITY = T.let(T.unsafe(nil), Regexp) + +# Default ports depending on scheme. Used to decide whether or not +# to include the port in a generated URI. +# +# source://rack//lib/rack/request.rb#168 +Rack::Request::Helpers::DEFAULT_PORTS = T.let(T.unsafe(nil), Hash) + +# The set of form-data media-types. Requests that do not indicate +# one of the media types present in this list will not be eligible +# for form-data / param parsing. +# +# source://rack//lib/rack/request.rb#153 +Rack::Request::Helpers::FORM_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array) + +# source://rack//lib/rack/request.rb#747 +Rack::Request::Helpers::FORWARDED_SCHEME_HEADERS = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/request.rb#176 +Rack::Request::Helpers::HTTP_FORWARDED = T.let(T.unsafe(nil), String) + +# The address of the client which connected to the proxy. +# +# source://rack//lib/rack/request.rb#171 +Rack::Request::Helpers::HTTP_X_FORWARDED_FOR = T.let(T.unsafe(nil), String) + +# The contents of the host/:authority header sent to the proxy. +# +# source://rack//lib/rack/request.rb#174 +Rack::Request::Helpers::HTTP_X_FORWARDED_HOST = T.let(T.unsafe(nil), String) + +# The port used to connect to the proxy. +# +# source://rack//lib/rack/request.rb#185 +Rack::Request::Helpers::HTTP_X_FORWARDED_PORT = T.let(T.unsafe(nil), String) + +# The protocol used to connect to the proxy. +# +# source://rack//lib/rack/request.rb#182 +Rack::Request::Helpers::HTTP_X_FORWARDED_PROTO = T.let(T.unsafe(nil), String) + +# The value of the scheme sent to the proxy. +# +# source://rack//lib/rack/request.rb#179 +Rack::Request::Helpers::HTTP_X_FORWARDED_SCHEME = T.let(T.unsafe(nil), String) + +# Another way for specifying https scheme was used. +# +# source://rack//lib/rack/request.rb#188 +Rack::Request::Helpers::HTTP_X_FORWARDED_SSL = T.let(T.unsafe(nil), String) + +# The set of media-types. Requests that do not indicate +# one of the media types present in this list will not be eligible +# for param parsing like soap attachments or generic multiparts +# +# source://rack//lib/rack/request.rb#161 +Rack::Request::Helpers::PARSEABLE_DATA_MEDIA_TYPES = T.let(T.unsafe(nil), Array) + +# Rack::Response provides a convenient interface to create a Rack +# response. +# +# It allows setting of headers and cookies, and provides useful +# defaults (an OK response with empty headers and body). +# +# You can use Response#write to iteratively generate your response, +# but note that this is buffered by Rack::Response until you call +# +finish+. +finish+ however can take a block inside which calls to +# +write+ are synchronous with the Rack response. +# +# Your application's +call+ should end returning Response#finish. +# +# source://rack//lib/rack/response.rb#23 +class Rack::Response + include ::Rack::Response::Helpers + + # Initialize the response object with the specified +body+, +status+ + # and +headers+. + # + # If the +body+ is +nil+, construct an empty response object with internal + # buffering. + # + # If the +body+ responds to +to_str+, assume it's a string-like object and + # construct a buffered response object containing using that string as the + # initial contents of the buffer. + # + # Otherwise it is expected +body+ conforms to the normal requirements of a + # Rack response body, typically implementing one of +each+ (enumerable + # body) or +call+ (streaming body). + # + # The +status+ defaults to +200+ which is the "OK" HTTP status code. You + # can provide any other valid status code. + # + # The +headers+ must be a +Hash+ of key-value header pairs which conform to + # the Rack specification for response headers. The key must be a +String+ + # instance and the value can be either a +String+ or +Array+ instance. + # + # @return [Response] a new instance of Response + # @yield [_self] + # @yieldparam _self [Rack::Response] the object that the method was called on + # + # source://rack//lib/rack/response.rb#54 + def initialize(body = T.unsafe(nil), status = T.unsafe(nil), headers = T.unsafe(nil)); end + + # @raise [ArgumentError] + # + # source://rack//lib/rack/response.rb#164 + def [](key); end + + # @raise [ArgumentError] + # + # source://rack//lib/rack/response.rb#168 + def []=(key, value); end + + # Returns the value of attribute body. + # + # source://rack//lib/rack/response.rb#31 + def body; end + + # Sets the attribute body + # + # @param value the value to set the attribute body to. + # + # source://rack//lib/rack/response.rb#31 + def body=(_arg0); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#95 + def chunked?; end + + # source://rack//lib/rack/response.rb#152 + def close; end + + # @raise [ArgumentError] + # + # source://rack//lib/rack/response.rb#172 + def delete_header(key); end + + # source://rack//lib/rack/response.rb#130 + def each(&callback); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#156 + def empty?; end + + # Generate a response array consistent with the requirements of the SPEC. + # which is suitable to be returned from the middleware `#call(env)` method. + # + # @return [Array] a 3-tuple suitable of `[status, headers, body]` + # + # source://rack//lib/rack/response.rb#107 + def finish(&block); end + + # @raise [ArgumentError] + # + # source://rack//lib/rack/response.rb#164 + def get_header(key); end + + # @raise [ArgumentError] + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#160 + def has_header?(key); end + + # Returns the value of attribute headers. + # + # source://rack//lib/rack/response.rb#32 + def headers; end + + # Returns the value of attribute length. + # + # source://rack//lib/rack/response.rb#31 + def length; end + + # Sets the attribute length + # + # @param value the value to set the attribute length to. + # + # source://rack//lib/rack/response.rb#31 + def length=(_arg0); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#99 + def no_entity_body?; end + + # source://rack//lib/rack/response.rb#90 + def redirect(target, status = T.unsafe(nil)); end + + # @raise [ArgumentError] + # + # source://rack//lib/rack/response.rb#168 + def set_header(key, value); end + + # Returns the value of attribute status. + # + # source://rack//lib/rack/response.rb#31 + def status; end + + # Sets the attribute status + # + # @param value the value to set the attribute status to. + # + # source://rack//lib/rack/response.rb#31 + def status=(_arg0); end + + # Generate a response array consistent with the requirements of the SPEC. + # which is suitable to be returned from the middleware `#call(env)` method. + # For *response + # + # @return [Array] a 3-tuple suitable of `[status, headers, body]` + # + # source://rack//lib/rack/response.rb#107 + def to_a(&block); end + + # Append a chunk to the response body. + # + # Converts the response into a buffered response if it wasn't already. + # + # NOTE: Do not mix #write and direct #body access! + # + # source://rack//lib/rack/response.rb#146 + def write(chunk); end + + class << self + # source://rack//lib/rack/response.rb#24 + def [](status, headers, body); end + end +end + +# source://rack//lib/rack/response.rb#28 +Rack::Response::CHUNKED = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/response.rb#180 +module Rack::Response::Helpers + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#191 + def accepted?; end + + # Add a header that may have multiple values. + # + # Example: + # response.add_header 'vary', 'accept-encoding' + # response.add_header 'vary', 'cookie' + # + # assert_equal 'accept-encoding,cookie', response.get_header('vary') + # + # http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 + # + # @raise [ArgumentError] + # + # source://rack//lib/rack/response.rb#219 + def add_header(key, value); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#194 + def bad_request?; end + + # Specify that the content should be cached. + # + # @option directive + # @param duration [Integer] The number of seconds until the cache expires. + # @param directive [Hash] a customizable set of options + # + # source://rack//lib/rack/response.rb#307 + def cache!(duration = T.unsafe(nil), directive: T.unsafe(nil)); end + + # source://rack//lib/rack/response.rb#290 + def cache_control; end + + # source://rack//lib/rack/response.rb#294 + def cache_control=(value); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#186 + def client_error?; end + + # source://rack//lib/rack/response.rb#257 + def content_length; end + + # Get the content type of the response. + # + # source://rack//lib/rack/response.rb#240 + def content_type; end + + # Set the content type of the response. + # + # source://rack//lib/rack/response.rb#245 + def content_type=(content_type); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#190 + def created?; end + + # source://rack//lib/rack/response.rb#274 + def delete_cookie(key, value = T.unsafe(nil)); end + + # Specifies that the content shouldn't be cached. Overrides `cache!` if already called. + # + # source://rack//lib/rack/response.rb#299 + def do_not_cache!; end + + # source://rack//lib/rack/response.rb#314 + def etag; end + + # source://rack//lib/rack/response.rb#318 + def etag=(value); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#196 + def forbidden?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#206 + def include?(header); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#183 + def informational?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#181 + def invalid?; end + + # source://rack//lib/rack/response.rb#262 + def location; end + + # source://rack//lib/rack/response.rb#266 + def location=(location); end + + # source://rack//lib/rack/response.rb#249 + def media_type; end + + # source://rack//lib/rack/response.rb#253 + def media_type_params; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#198 + def method_not_allowed?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#193 + def moved_permanently?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#192 + def no_content?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#199 + def not_acceptable?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#197 + def not_found?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#189 + def ok?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#201 + def precondition_failed?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#204 + def redirect?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#185 + def redirection?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#200 + def request_timeout?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#187 + def server_error?; end + + # source://rack//lib/rack/response.rb#270 + def set_cookie(key, value); end + + # source://rack//lib/rack/response.rb#282 + def set_cookie_header; end + + # source://rack//lib/rack/response.rb#286 + def set_cookie_header=(value); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#184 + def successful?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#195 + def unauthorized?; end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#202 + def unprocessable?; end + + protected + + # source://rack//lib/rack/response.rb#359 + def append(chunk); end + + # Convert the body of this response into an internally buffered Array if possible. + # + # `@buffered` is a ternary value which indicates whether the body is buffered. It can be: + # * `nil` - The body has not been buffered yet. + # * `true` - The body is buffered as an Array instance. + # * `false` - The body is not buffered and cannot be buffered. + # + # @return [Boolean] whether the body is buffered as an Array instance. + # + # source://rack//lib/rack/response.rb#332 + def buffered_body!; end +end + +# source://rack//lib/rack/response.rb#375 +class Rack::Response::Raw + include ::Rack::Response::Helpers + + # @return [Raw] a new instance of Raw + # + # source://rack//lib/rack/response.rb#381 + def initialize(status, headers); end + + # source://rack//lib/rack/response.rb#398 + def delete_header(key); end + + # source://rack//lib/rack/response.rb#390 + def get_header(key); end + + # @return [Boolean] + # + # source://rack//lib/rack/response.rb#386 + def has_header?(key); end + + # Returns the value of attribute headers. + # + # source://rack//lib/rack/response.rb#378 + def headers; end + + # source://rack//lib/rack/response.rb#394 + def set_header(key, value); end + + # Returns the value of attribute status. + # + # source://rack//lib/rack/response.rb#379 + def status; end + + # Sets the attribute status + # + # @param value the value to set the attribute status to. + # + # source://rack//lib/rack/response.rb#379 + def status=(_arg0); end +end + +# source://rack//lib/rack/response.rb#29 +Rack::Response::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash) + +# Class which can make any IO object rewindable, including non-rewindable ones. It does +# this by buffering the data into a tempfile, which is rewindable. +# +# Don't forget to call #close when you're done. This frees up temporary resources that +# RewindableInput uses, though it does *not* close the original IO object. +# +# source://rack//lib/rack/rewindable_input.rb#14 +class Rack::RewindableInput + # @return [RewindableInput] a new instance of RewindableInput + # + # source://rack//lib/rack/rewindable_input.rb#29 + def initialize(io); end + + # Closes this RewindableInput object without closing the originally + # wrapped IO object. Cleans up any temporary resources that this RewindableInput + # has created. + # + # This method may be called multiple times. It does nothing on subsequent calls. + # + # source://rack//lib/rack/rewindable_input.rb#65 + def close; end + + # source://rack//lib/rack/rewindable_input.rb#45 + def each(&block); end + + # source://rack//lib/rack/rewindable_input.rb#35 + def gets; end + + # source://rack//lib/rack/rewindable_input.rb#40 + def read(*args); end + + # source://rack//lib/rack/rewindable_input.rb#50 + def rewind; end + + # source://rack//lib/rack/rewindable_input.rb#55 + def size; end + + private + + # @return [Boolean] + # + # source://rack//lib/rack/rewindable_input.rb#109 + def filesystem_has_posix_semantics?; end + + # source://rack//lib/rack/rewindable_input.rb#78 + def make_rewindable; end +end + +# Makes rack.input rewindable, for compatibility with applications and middleware +# designed for earlier versions of Rack (where rack.input was required to be +# rewindable). +# +# source://rack//lib/rack/rewindable_input.rb#18 +class Rack::RewindableInput::Middleware + # @return [Middleware] a new instance of Middleware + # + # source://rack//lib/rack/rewindable_input.rb#19 + def initialize(app); end + + # source://rack//lib/rack/rewindable_input.rb#23 + def call(env); end +end + +# Sets an "x-runtime" response header, indicating the response +# time of the request, in seconds +# +# You can put it right before the application to see the processing +# time, or before all the other middlewares to include time for them, +# too. +# +# source://rack//lib/rack/runtime.rb#12 +class Rack::Runtime + # @return [Runtime] a new instance of Runtime + # + # source://rack//lib/rack/runtime.rb#16 + def initialize(app, name = T.unsafe(nil)); end + + # source://rack//lib/rack/runtime.rb#22 + def call(env); end +end + +# source://rack//lib/rack/runtime.rb#13 +Rack::Runtime::FORMAT_STRING = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/runtime.rb#14 +Rack::Runtime::HEADER_NAME = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#11 +Rack::SCRIPT_NAME = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#14 +Rack::SERVER_NAME = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#15 +Rack::SERVER_PORT = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#13 +Rack::SERVER_PROTOCOL = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#24 +Rack::SET_COOKIE = T.let(T.unsafe(nil), String) + +# = Sendfile +# +# The Sendfile middleware intercepts responses whose body is being +# served from a file and replaces it with a server specific x-sendfile +# header. The web server is then responsible for writing the file contents +# to the client. This can dramatically reduce the amount of work required +# by the Ruby backend and takes advantage of the web server's optimized file +# delivery code. +# +# In order to take advantage of this middleware, the response body must +# respond to +to_path+ and the request must include an x-sendfile-type +# header. Rack::Files and other components implement +to_path+ so there's +# rarely anything you need to do in your application. The x-sendfile-type +# header is typically set in your web servers configuration. The following +# sections attempt to document +# +# === Nginx +# +# Nginx supports the x-accel-redirect header. This is similar to x-sendfile +# but requires parts of the filesystem to be mapped into a private URL +# hierarchy. +# +# The following example shows the Nginx configuration required to create +# a private "/files/" area, enable x-accel-redirect, and pass the special +# x-sendfile-type and x-accel-mapping headers to the backend: +# +# location ~ /files/(.*) { +# internal; +# alias /var/www/$1; +# } +# +# location / { +# proxy_redirect off; +# +# proxy_set_header Host $host; +# proxy_set_header X-Real-IP $remote_addr; +# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +# +# proxy_set_header x-sendfile-type x-accel-redirect; +# proxy_set_header x-accel-mapping /var/www/=/files/; +# +# proxy_pass http://127.0.0.1:8080/; +# } +# +# Note that the x-sendfile-type header must be set exactly as shown above. +# The x-accel-mapping header should specify the location on the file system, +# followed by an equals sign (=), followed name of the private URL pattern +# that it maps to. The middleware performs a simple substitution on the +# resulting path. +# +# See Also: https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile +# +# === lighttpd +# +# Lighttpd has supported some variation of the x-sendfile header for some +# time, although only recent version support x-sendfile in a reverse proxy +# configuration. +# +# $HTTP["host"] == "example.com" { +# proxy-core.protocol = "http" +# proxy-core.balancer = "round-robin" +# proxy-core.backends = ( +# "127.0.0.1:8000", +# "127.0.0.1:8001", +# ... +# ) +# +# proxy-core.allow-x-sendfile = "enable" +# proxy-core.rewrite-request = ( +# "x-sendfile-type" => (".*" => "x-sendfile") +# ) +# } +# +# See Also: http://redmine.lighttpd.net/wiki/lighttpd/Docs:ModProxyCore +# +# === Apache +# +# x-sendfile is supported under Apache 2.x using a separate module: +# +# https://tn123.org/mod_xsendfile/ +# +# Once the module is compiled and installed, you can enable it using +# XSendFile config directive: +# +# RequestHeader Set x-sendfile-type x-sendfile +# ProxyPassReverse / http://localhost:8001/ +# XSendFile on +# +# === Mapping parameter +# +# The third parameter allows for an overriding extension of the +# x-accel-mapping header. Mappings should be provided in tuples of internal to +# external. The internal values may contain regular expression syntax, they +# will be matched with case indifference. +# +# source://rack//lib/rack/sendfile.rb#104 +class Rack::Sendfile + # @return [Sendfile] a new instance of Sendfile + # + # source://rack//lib/rack/sendfile.rb#105 + def initialize(app, variation = T.unsafe(nil), mappings = T.unsafe(nil)); end + + # source://rack//lib/rack/sendfile.rb#113 + def call(env); end + + private + + # source://rack//lib/rack/sendfile.rb#154 + def map_accel_path(env, path); end + + # source://rack//lib/rack/sendfile.rb#148 + def variation(env); end +end + +# Rack::ShowExceptions catches all exceptions raised from the app it +# wraps. It shows a useful backtrace with the sourcefile and +# clickable context, the whole Rack environment and the request +# data. +# +# Be careful when you use this on public-facing sites as it could +# reveal information helpful to attackers. +# +# source://rack//lib/rack/show_exceptions.rb#18 +class Rack::ShowExceptions + # @return [ShowExceptions] a new instance of ShowExceptions + # + # source://rack//lib/rack/show_exceptions.rb#26 + def initialize(app); end + + # source://rack//lib/rack/show_exceptions.rb#30 + def call(env); end + + # source://rack//lib/rack/show_exceptions.rb#65 + def dump_exception(exception); end + + # source://rack//lib/rack/show_exceptions.rb#116 + def h(obj); end + + # @return [Boolean] + # + # source://rack//lib/rack/show_exceptions.rb#56 + def prefers_plaintext?(env); end + + # source://rack//lib/rack/show_exceptions.rb#76 + def pretty(env, exception); end + + # source://rack//lib/rack/show_exceptions.rb#112 + def template; end + + private + + # @return [Boolean] + # + # source://rack//lib/rack/show_exceptions.rb#60 + def accepts_html?(env); end +end + +# source://rack//lib/rack/show_exceptions.rb#19 +Rack::ShowExceptions::CONTEXT = T.let(T.unsafe(nil), Integer) + +# source://rack//lib/rack/show_exceptions.rb#21 +class Rack::ShowExceptions::Frame < ::Struct + # Returns the value of attribute context_line + # + # @return [Object] the current value of context_line + def context_line; end + + # Sets the attribute context_line + # + # @param value [Object] the value to set the attribute context_line to. + # @return [Object] the newly set value + def context_line=(_); end + + # Returns the value of attribute filename + # + # @return [Object] the current value of filename + def filename; end + + # Sets the attribute filename + # + # @param value [Object] the value to set the attribute filename to. + # @return [Object] the newly set value + def filename=(_); end + + # Returns the value of attribute function + # + # @return [Object] the current value of function + def function; end + + # Sets the attribute function + # + # @param value [Object] the value to set the attribute function to. + # @return [Object] the newly set value + def function=(_); end + + # Returns the value of attribute lineno + # + # @return [Object] the current value of lineno + def lineno; end + + # Sets the attribute lineno + # + # @param value [Object] the value to set the attribute lineno to. + # @return [Object] the newly set value + def lineno=(_); end + + # Returns the value of attribute post_context + # + # @return [Object] the current value of post_context + def post_context; end + + # Sets the attribute post_context + # + # @param value [Object] the value to set the attribute post_context to. + # @return [Object] the newly set value + def post_context=(_); end + + # Returns the value of attribute post_context_lineno + # + # @return [Object] the current value of post_context_lineno + def post_context_lineno; end + + # Sets the attribute post_context_lineno + # + # @param value [Object] the value to set the attribute post_context_lineno to. + # @return [Object] the newly set value + def post_context_lineno=(_); end + + # Returns the value of attribute pre_context + # + # @return [Object] the current value of pre_context + def pre_context; end + + # Sets the attribute pre_context + # + # @param value [Object] the value to set the attribute pre_context to. + # @return [Object] the newly set value + def pre_context=(_); end + + # Returns the value of attribute pre_context_lineno + # + # @return [Object] the current value of pre_context_lineno + def pre_context_lineno; end + + # Sets the attribute pre_context_lineno + # + # @param value [Object] the value to set the attribute pre_context_lineno to. + # @return [Object] the newly set value + def pre_context_lineno=(_); end + + class << self + def [](*_arg0); end + def inspect; end + def keyword_init?; end + def members; end + def new(*_arg0); end + end +end + +# source://rack//lib/rack/show_exceptions.rb#131 +Rack::ShowExceptions::TEMPLATE = T.let(T.unsafe(nil), ERB) + +# Rack::ShowStatus catches all empty responses and replaces them +# with a site explaining the error. +# +# Additional details can be put into rack.showstatus.detail +# and will be shown as HTML. If such details exist, the error page +# is always rendered, even if the reply was not empty. +# +# source://rack//lib/rack/show_status.rb#18 +class Rack::ShowStatus + # @return [ShowStatus] a new instance of ShowStatus + # + # source://rack//lib/rack/show_status.rb#19 + def initialize(app); end + + # source://rack//lib/rack/show_status.rb#24 + def call(env); end + + # source://rack//lib/rack/show_status.rb#54 + def h(obj); end +end + +# source://rack//lib/rack/show_status.rb#69 +Rack::ShowStatus::TEMPLATE = T.let(T.unsafe(nil), String) + +# The Rack::Static middleware intercepts requests for static files +# (javascript files, images, stylesheets, etc) based on the url prefixes or +# route mappings passed in the options, and serves them using a Rack::Files +# object. This allows a Rack stack to serve both static and dynamic content. +# +# Examples: +# +# Serve all requests beginning with /media from the "media" folder located +# in the current directory (ie media/*): +# +# use Rack::Static, :urls => ["/media"] +# +# Same as previous, but instead of returning 404 for missing files under +# /media, call the next middleware: +# +# use Rack::Static, :urls => ["/media"], :cascade => true +# +# Serve all requests beginning with /css or /images from the folder "public" +# in the current directory (ie public/css/* and public/images/*): +# +# use Rack::Static, :urls => ["/css", "/images"], :root => "public" +# +# Serve all requests to / with "index.html" from the folder "public" in the +# current directory (ie public/index.html): +# +# use Rack::Static, :urls => {"/" => 'index.html'}, :root => 'public' +# +# Serve all requests normally from the folder "public" in the current +# directory but uses index.html as default route for "/" +# +# use Rack::Static, :urls => [""], :root => 'public', :index => +# 'index.html' +# +# Set custom HTTP Headers for based on rules: +# +# use Rack::Static, :root => 'public', +# :header_rules => [ +# [rule, {header_field => content, header_field => content}], +# [rule, {header_field => content}] +# ] +# +# Rules for selecting files: +# +# 1) All files +# Provide the :all symbol +# :all => Matches every file +# +# 2) Folders +# Provide the folder path as a string +# '/folder' or '/folder/subfolder' => Matches files in a certain folder +# +# 3) File Extensions +# Provide the file extensions as an array +# ['css', 'js'] or %w(css js) => Matches files ending in .css or .js +# +# 4) Regular Expressions / Regexp +# Provide a regular expression +# %r{\.(?:css|js)\z} => Matches files ending in .css or .js +# /\.(?:eot|ttf|otf|woff2|woff|svg)\z/ => Matches files ending in +# the most common web font formats (.eot, .ttf, .otf, .woff2, .woff, .svg) +# Note: This Regexp is available as a shortcut, using the :fonts rule +# +# 5) Font Shortcut +# Provide the :fonts symbol +# :fonts => Uses the Regexp rule stated right above to match all common web font endings +# +# Rule Ordering: +# Rules are applied in the order that they are provided. +# List rather general rules above special ones. +# +# Complete example use case including HTTP header rules: +# +# use Rack::Static, :root => 'public', +# :header_rules => [ +# # Cache all static files in public caches (e.g. Rack::Cache) +# # as well as in the browser +# [:all, {'cache-control' => 'public, max-age=31536000'}], +# +# # Provide web fonts with cross-origin access-control-headers +# # Firefox requires this when serving assets using a Content Delivery Network +# [:fonts, {'access-control-allow-origin' => '*'}] +# ] +# +# source://rack//lib/rack/static.rb#92 +class Rack::Static + # @return [Static] a new instance of Static + # + # source://rack//lib/rack/static.rb#93 + def initialize(app, options = T.unsafe(nil)); end + + # @return [Boolean] + # + # source://rack//lib/rack/static.rb#109 + def add_index_root?(path); end + + # Convert HTTP header rules to HTTP headers + # + # source://rack//lib/rack/static.rb#166 + def applicable_rules(path); end + + # source://rack//lib/rack/static.rb#125 + def call(env); end + + # source://rack//lib/rack/static.rb#121 + def can_serve(path); end + + # source://rack//lib/rack/static.rb#113 + def overwrite_file_path(path); end + + # source://rack//lib/rack/static.rb#117 + def route_file(path); end +end + +# source://rack//lib/rack/constants.rb#38 +Rack::TRACE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/constants.rb#25 +Rack::TRANSFER_ENCODING = T.let(T.unsafe(nil), String) + +# Middleware tracks and cleans Tempfiles created throughout a request (i.e. Rack::Multipart) +# Ideas/strategy based on posts by Eric Wong and Charles Oliver Nutter +# https://groups.google.com/forum/#!searchin/rack-devel/temp/rack-devel/brK8eh-MByw/sw61oJJCGRMJ +# +# source://rack//lib/rack/tempfile_reaper.rb#11 +class Rack::TempfileReaper + # @return [TempfileReaper] a new instance of TempfileReaper + # + # source://rack//lib/rack/tempfile_reaper.rb#12 + def initialize(app); end + + # source://rack//lib/rack/tempfile_reaper.rb#16 + def call(env); end +end + +# source://rack//lib/rack/constants.rb#37 +Rack::UNLINK = T.let(T.unsafe(nil), String) + +# Rack::URLMap takes a hash mapping urls or paths to apps, and +# dispatches accordingly. Support for HTTP/1.1 host names exists if +# the URLs start with http:// or https://. +# +# URLMap modifies the SCRIPT_NAME and PATH_INFO such that the part +# relevant for dispatch is in the SCRIPT_NAME, and the rest in the +# PATH_INFO. This should be taken care of when you need to +# reconstruct the URL in order to create links. +# +# URLMap dispatches in such a way that the longest paths are tried +# first, since they are most specific. +# +# source://rack//lib/rack/urlmap.rb#20 +class Rack::URLMap + # @return [URLMap] a new instance of URLMap + # + # source://rack//lib/rack/urlmap.rb#21 + def initialize(map = T.unsafe(nil)); end + + # source://rack//lib/rack/urlmap.rb#48 + def call(env); end + + # source://rack//lib/rack/urlmap.rb#25 + def remap(map); end + + private + + # @return [Boolean] + # + # source://rack//lib/rack/urlmap.rb#87 + def casecmp?(v1, v2); end +end + +# Rack::Utils contains a grab-bag of useful methods for writing web +# applications adopted from all kinds of Ruby libraries. +# +# source://rack//lib/rack/utils.rb#20 +module Rack::Utils + private + + # Return best accept value to use, based on the algorithm + # in RFC 2616 Section 14. If there are multiple best + # matches (same specificity and quality), the value returned + # is arbitrary. + # + # source://rack//lib/rack/utils.rb#166 + def best_q_match(q_value_header, available_mimes); end + + # source://rack//lib/rack/utils.rb#119 + def build_nested_query(value, prefix = T.unsafe(nil)); end + + # source://rack//lib/rack/utils.rb#109 + def build_query(params); end + + # Parses the "Range:" header, if present, into an array of Range objects. + # Returns nil if the header is missing or syntactically invalid. + # Returns an empty array if none of the ranges are satisfiable. + # + # source://rack//lib/rack/utils.rb#408 + def byte_ranges(env, size); end + + # source://rack//lib/rack/utils.rb#608 + def clean_path_info(path_info); end + + # :nocov: + # + # source://rack//lib/rack/utils.rb#90 + def clock_time; end + + # source://rack//lib/rack/utils.rb#366 + def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end + + # :call-seq: + # delete_set_cookie_header(key, value = {}) -> encoded string + # + # Generate an encoded string based on the given +key+ and +value+ using + # set_cookie_header for the purpose of causing the specified cookie to be + # deleted. The +value+ may be an instance of +Hash+ and can include + # attributes as outlined by set_cookie_header. The encoded cookie will have + # a +max_age+ of 0 seconds, an +expires+ date in the past and an empty + # +value+. When used with the +set-cookie+ header, it will cause the client + # to *remove* any matching cookie. + # + # delete_set_cookie_header("myname") + # # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT" + # + # source://rack//lib/rack/utils.rb#362 + def delete_set_cookie_header(key, value = T.unsafe(nil)); end + + # :call-seq: + # delete_set_cookie_header!(header, key, value = {}) -> header value + # + # Set an expired cookie in the specified headers with the given cookie + # +key+ and +value+ using delete_set_cookie_header. This causes + # the client to immediately delete the specified cookie. + # + # delete_set_cookie_header!(nil, "mycookie") + # # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT" + # + # If the header is non-nil, it will be modified in place. + # + # header = [] + # delete_set_cookie_header!(header, "mycookie") + # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"] + # header + # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"] + # + # source://rack//lib/rack/utils.rb#390 + def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end + + # URI escapes. (CGI style space to +) + # + # source://rack//lib/rack/utils.rb#39 + def escape(s); end + + # source://rack//lib/rack/utils.rb#261 + def escape_cookie_key(key); end + + # Escape ampersands, brackets and quotes to their HTML/XML entities. + def escape_html(_arg0); end + + # Like URI escaping, but with %20 instead of +. Strictly speaking this is + # true URI escaping. + # + # source://rack//lib/rack/utils.rb#45 + def escape_path(s); end + + # source://rack//lib/rack/utils.rb#148 + def forwarded_values(forwarded_header); end + + # source://rack//lib/rack/utils.rb#412 + def get_byte_ranges(http_range, size); end + + # :call-seq: + # parse_cookies(env) -> hash + # + # Parse cookies from the provided request environment using + # parse_cookies_header. Returns a map of cookie +key+ to cookie +value+. + # + # parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'}) + # # => {'myname' => 'myvalue'} + # + # source://rack//lib/rack/utils.rb#252 + def parse_cookies(env); end + + # :call-seq: + # parse_cookies_header(value) -> hash + # + # Parse cookies from the provided header +value+ according to RFC6265. The + # syntax for cookie headers only supports semicolons. Returns a map of + # cookie +key+ to cookie +value+. + # + # parse_cookies_header('myname=myvalue; max-age=0') + # # => {"myname"=>"myvalue", "max-age"=>"0"} + # + # source://rack//lib/rack/utils.rb#233 + def parse_cookies_header(value); end + + # source://rack//lib/rack/utils.rb#105 + def parse_nested_query(qs, d = T.unsafe(nil)); end + + # source://rack//lib/rack/utils.rb#101 + def parse_query(qs, d = T.unsafe(nil), &unescaper); end + + # source://rack//lib/rack/utils.rb#137 + def q_values(q_value_header); end + + # source://rack//lib/rack/utils.rb#401 + def rfc2822(time); end + + # :nocov: + # + # source://rack//lib/rack/utils.rb#454 + def secure_compare(a, b); end + + # source://rack//lib/rack/utils.rb#191 + def select_best_encoding(available_encodings, accept_encoding); end + + # :call-seq: + # set_cookie_header(key, value) -> encoded string + # + # Generate an encoded string using the provided +key+ and +value+ suitable + # for the +set-cookie+ header according to RFC6265. The +value+ may be an + # instance of either +String+ or +Hash+. + # + # If the cookie +value+ is an instance of +Hash+, it considers the following + # cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance + # of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more + # details about the interpretation of these fields, consult + # [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2). + # + # An extra cookie attribute +escape_key+ can be provided to control whether + # or not the cookie key is URL encoded. If explicitly set to +false+, the + # cookie key name will not be url encoded (escaped). The default is +true+. + # + # set_cookie_header("myname", "myvalue") + # # => "myname=myvalue" + # + # set_cookie_header("myname", {value: "myvalue", max_age: 10}) + # # => "myname=myvalue; max-age=10" + # + # source://rack//lib/rack/utils.rb#293 + def set_cookie_header(key, value); end + + # :call-seq: + # set_cookie_header!(headers, key, value) -> header value + # + # Append a cookie in the specified headers with the given cookie +key+ and + # +value+ using set_cookie_header. + # + # If the headers already contains a +set-cookie+ key, it will be converted + # to an +Array+ if not already, and appended to. + # + # source://rack//lib/rack/utils.rb#336 + def set_cookie_header!(headers, key, value); end + + # source://rack//lib/rack/utils.rb#588 + def status_code(status); end + + # Unescapes a URI escaped string with +encoding+. +encoding+ will be the + # target encoding of the string returned, and it defaults to UTF-8 + # + # source://rack//lib/rack/utils.rb#57 + def unescape(s, encoding = T.unsafe(nil)); end + + # Unescapes the **path** component of a URI. See Rack::Utils.unescape for + # unescaping query parameters or form components. + # + # source://rack//lib/rack/utils.rb#51 + def unescape_path(s); end + + # source://rack//lib/rack/utils.rb#625 + def valid_path?(path); end + + class << self + # Return best accept value to use, based on the algorithm + # in RFC 2616 Section 14. If there are multiple best + # matches (same specificity and quality), the value returned + # is arbitrary. + # + # source://rack//lib/rack/utils.rb#166 + def best_q_match(q_value_header, available_mimes); end + + # source://rack//lib/rack/utils.rb#119 + def build_nested_query(value, prefix = T.unsafe(nil)); end + + # source://rack//lib/rack/utils.rb#109 + def build_query(params); end + + # Parses the "Range:" header, if present, into an array of Range objects. + # Returns nil if the header is missing or syntactically invalid. + # Returns an empty array if none of the ranges are satisfiable. + # + # source://rack//lib/rack/utils.rb#408 + def byte_ranges(env, size); end + + # source://rack//lib/rack/utils.rb#608 + def clean_path_info(path_info); end + + # source://rack//lib/rack/utils.rb#90 + def clock_time; end + + # Returns the value of attribute default_query_parser. + # + # source://rack//lib/rack/utils.rb#29 + def default_query_parser; end + + # Sets the attribute default_query_parser + # + # @param value the value to set the attribute default_query_parser to. + # + # source://rack//lib/rack/utils.rb#29 + def default_query_parser=(_arg0); end + + # source://rack//lib/rack/utils.rb#366 + def delete_cookie_header!(headers, key, value = T.unsafe(nil)); end + + # :call-seq: + # delete_set_cookie_header(key, value = {}) -> encoded string + # + # Generate an encoded string based on the given +key+ and +value+ using + # set_cookie_header for the purpose of causing the specified cookie to be + # deleted. The +value+ may be an instance of +Hash+ and can include + # attributes as outlined by set_cookie_header. The encoded cookie will have + # a +max_age+ of 0 seconds, an +expires+ date in the past and an empty + # +value+. When used with the +set-cookie+ header, it will cause the client + # to *remove* any matching cookie. + # + # delete_set_cookie_header("myname") + # # => "myname=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT" + # + # source://rack//lib/rack/utils.rb#362 + def delete_set_cookie_header(key, value = T.unsafe(nil)); end + + # :call-seq: + # delete_set_cookie_header!(header, key, value = {}) -> header value + # + # Set an expired cookie in the specified headers with the given cookie + # +key+ and +value+ using delete_set_cookie_header. This causes + # the client to immediately delete the specified cookie. + # + # delete_set_cookie_header!(nil, "mycookie") + # # => "mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT" + # + # If the header is non-nil, it will be modified in place. + # + # header = [] + # delete_set_cookie_header!(header, "mycookie") + # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"] + # header + # # => ["mycookie=; max-age=0; expires=Thu, 01 Jan 1970 00:00:00 GMT"] + # + # source://rack//lib/rack/utils.rb#390 + def delete_set_cookie_header!(header, key, value = T.unsafe(nil)); end + + # URI escapes. (CGI style space to +) + # + # source://rack//lib/rack/utils.rb#39 + def escape(s); end + + # source://rack//lib/rack/utils.rb#261 + def escape_cookie_key(key); end + + def escape_html(_arg0); end + + # Like URI escaping, but with %20 instead of +. Strictly speaking this is + # true URI escaping. + # + # source://rack//lib/rack/utils.rb#45 + def escape_path(s); end + + # source://rack//lib/rack/utils.rb#148 + def forwarded_values(forwarded_header); end + + # source://rack//lib/rack/utils.rb#412 + def get_byte_ranges(http_range, size); end + + # Returns the value of attribute multipart_file_limit. + # + # source://rack//lib/rack/utils.rb#64 + def multipart_file_limit; end + + # Sets the attribute multipart_file_limit + # + # @param value the value to set the attribute multipart_file_limit to. + # + # source://rack//lib/rack/utils.rb#64 + def multipart_file_limit=(_arg0); end + + # Returns the value of attribute multipart_file_limit. + # multipart_part_limit is the original name of multipart_file_limit, but + # the limit only counts parts with filenames. + # + # source://rack//lib/rack/utils.rb#64 + def multipart_part_limit; end + + # Sets the attribute multipart_file_limit + # + # @param value the value to set the attribute multipart_file_limit to. + # + # source://rack//lib/rack/utils.rb#64 + def multipart_part_limit=(_arg0); end + + # Returns the value of attribute multipart_total_part_limit. + # + # source://rack//lib/rack/utils.rb#62 + def multipart_total_part_limit; end + + # Sets the attribute multipart_total_part_limit + # + # @param value the value to set the attribute multipart_total_part_limit to. + # + # source://rack//lib/rack/utils.rb#62 + def multipart_total_part_limit=(_arg0); end + + # source://rack//lib/rack/utils.rb#81 + def param_depth_limit; end + + # source://rack//lib/rack/utils.rb#85 + def param_depth_limit=(v); end + + # :call-seq: + # parse_cookies(env) -> hash + # + # Parse cookies from the provided request environment using + # parse_cookies_header. Returns a map of cookie +key+ to cookie +value+. + # + # parse_cookies({'HTTP_COOKIE' => 'myname=myvalue'}) + # # => {'myname' => 'myvalue'} + # + # source://rack//lib/rack/utils.rb#252 + def parse_cookies(env); end + + # :call-seq: + # parse_cookies_header(value) -> hash + # + # Parse cookies from the provided header +value+ according to RFC6265. The + # syntax for cookie headers only supports semicolons. Returns a map of + # cookie +key+ to cookie +value+. + # + # parse_cookies_header('myname=myvalue; max-age=0') + # # => {"myname"=>"myvalue", "max-age"=>"0"} + # + # source://rack//lib/rack/utils.rb#233 + def parse_cookies_header(value); end + + # source://rack//lib/rack/utils.rb#105 + def parse_nested_query(qs, d = T.unsafe(nil)); end + + # source://rack//lib/rack/utils.rb#101 + def parse_query(qs, d = T.unsafe(nil), &unescaper); end + + # source://rack//lib/rack/utils.rb#137 + def q_values(q_value_header); end + + # source://rack//lib/rack/utils.rb#401 + def rfc2822(time); end + + # source://rack//lib/rack/utils.rb#454 + def secure_compare(a, b); end + + # source://rack//lib/rack/utils.rb#191 + def select_best_encoding(available_encodings, accept_encoding); end + + # :call-seq: + # set_cookie_header(key, value) -> encoded string + # + # Generate an encoded string using the provided +key+ and +value+ suitable + # for the +set-cookie+ header according to RFC6265. The +value+ may be an + # instance of either +String+ or +Hash+. + # + # If the cookie +value+ is an instance of +Hash+, it considers the following + # cookie attribute keys: +domain+, +max_age+, +expires+ (must be instance + # of +Time+), +secure+, +http_only+, +same_site+ and +value+. For more + # details about the interpretation of these fields, consult + # [RFC6265 Section 5.2](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2). + # + # An extra cookie attribute +escape_key+ can be provided to control whether + # or not the cookie key is URL encoded. If explicitly set to +false+, the + # cookie key name will not be url encoded (escaped). The default is +true+. + # + # set_cookie_header("myname", "myvalue") + # # => "myname=myvalue" + # + # set_cookie_header("myname", {value: "myvalue", max_age: 10}) + # # => "myname=myvalue; max-age=10" + # + # source://rack//lib/rack/utils.rb#293 + def set_cookie_header(key, value); end + + # :call-seq: + # set_cookie_header!(headers, key, value) -> header value + # + # Append a cookie in the specified headers with the given cookie +key+ and + # +value+ using set_cookie_header. + # + # If the headers already contains a +set-cookie+ key, it will be converted + # to an +Array+ if not already, and appended to. + # + # source://rack//lib/rack/utils.rb#336 + def set_cookie_header!(headers, key, value); end + + # source://rack//lib/rack/utils.rb#588 + def status_code(status); end + + # Unescapes a URI escaped string with +encoding+. +encoding+ will be the + # target encoding of the string returned, and it defaults to UTF-8 + # + # source://rack//lib/rack/utils.rb#57 + def unescape(s, encoding = T.unsafe(nil)); end + + # Unescapes the **path** component of a URI. See Rack::Utils.unescape for + # unescaping query parameters or form components. + # + # source://rack//lib/rack/utils.rb#51 + def unescape_path(s); end + + # @return [Boolean] + # + # source://rack//lib/rack/utils.rb#625 + def valid_path?(path); end + end +end + +# source://rack//lib/rack/utils.rb#25 +Rack::Utils::COMMON_SEP = T.let(T.unsafe(nil), Hash) + +# Context allows the use of a compatible middleware at different points +# in a request handling stack. A compatible middleware must define +# #context which should take the arguments env and app. The first of which +# would be the request environment. The second of which would be the rack +# application that the request would be forwarded to. +# +# source://rack//lib/rack/utils.rb#477 +class Rack::Utils::Context + # @return [Context] a new instance of Context + # + # source://rack//lib/rack/utils.rb#480 + def initialize(app_f, app_r); end + + # Returns the value of attribute app. + # + # source://rack//lib/rack/utils.rb#478 + def app; end + + # source://rack//lib/rack/utils.rb#485 + def call(env); end + + # source://rack//lib/rack/utils.rb#493 + def context(env, app = T.unsafe(nil)); end + + # Returns the value of attribute for. + # + # source://rack//lib/rack/utils.rb#478 + def for; end + + # source://rack//lib/rack/utils.rb#489 + def recontext(app); end +end + +# source://rack//lib/rack/utils.rb#24 +Rack::Utils::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp) + +# Every standard HTTP code mapped to the appropriate message. +# Generated with: +# curl -s https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv \ +# | ruby -rcsv -e "puts CSV.parse(STDIN, headers: true) \ +# .reject {|v| v['Description'] == 'Unassigned' or v['Description'].include? '(' } \ +# .map {|v| %Q/#{v['Value']} => '#{v['Description']}'/ }.join(','+?\n)" +# +# source://rack//lib/rack/utils.rb#504 +Rack::Utils::HTTP_STATUS_CODES = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/utils.rb#22 +Rack::Utils::InvalidParameterError = Rack::QueryParser::InvalidParameterError + +# source://rack//lib/rack/utils.rb#26 +Rack::Utils::KeySpaceConstrainedParams = Rack::QueryParser::Params + +# source://rack//lib/rack/utils.rb#623 +Rack::Utils::NULL_BYTE = T.let(T.unsafe(nil), String) + +# source://rack//lib/rack/utils.rb#574 +Rack::Utils::OBSOLETE_SYMBOLS_TO_STATUS_CODES = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/utils.rb#582 +Rack::Utils::OBSOLETE_SYMBOL_MAPPINGS = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/utils.rb#606 +Rack::Utils::PATH_SEPS = T.let(T.unsafe(nil), Regexp) + +# source://rack//lib/rack/utils.rb#21 +Rack::Utils::ParameterTypeError = Rack::QueryParser::ParameterTypeError + +# source://rack//lib/rack/utils.rb#23 +Rack::Utils::ParamsTooDeepError = Rack::QueryParser::ParamsTooDeepError + +# Responses with HTTP status codes that should not have an entity body +# +# source://rack//lib/rack/utils.rb#568 +Rack::Utils::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash) + +# source://rack//lib/rack/utils.rb#570 +Rack::Utils::SYMBOL_TO_STATUS_CODE = T.let(T.unsafe(nil), Hash) + +# A valid cookie key according to RFC2616. +# A can be any US-ASCII characters, except control characters, spaces, or tabs. It also must not contain a separator character like the following: ( ) < > @ , ; : \ " / [ ] ? = { }. +# +# source://rack//lib/rack/utils.rb#258 +Rack::Utils::VALID_COOKIE_KEY = T.let(T.unsafe(nil), Regexp) diff --git a/sorbet/rbi/gems/sinatra@4.0.0.rbi b/sorbet/rbi/gems/sinatra@4.0.0.rbi new file mode 100644 index 0000000..c9d7443 --- /dev/null +++ b/sorbet/rbi/gems/sinatra@4.0.0.rbi @@ -0,0 +1,1955 @@ +# typed: true + +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `sinatra` gem. +# Please instead update this file by running `bin/tapioca gem sinatra`. + + +# source://sinatra//lib/sinatra/main.rb#54 +class Rack::Builder + include ::Sinatra::Delegator + + # source://rack/3.1.7/lib/rack/builder.rb#116 + def initialize(default_app = T.unsafe(nil), **options, &block); end + + # source://rack/3.1.7/lib/rack/builder.rb#276 + def call(env); end + + # source://rack/3.1.7/lib/rack/builder.rb#259 + def freeze_app; end + + # source://rack/3.1.7/lib/rack/builder.rb#252 + def map(path, &block); end + + # source://rack/3.1.7/lib/rack/builder.rb#132 + def options; end + + # source://rack/3.1.7/lib/rack/builder.rb#193 + def run(app = T.unsafe(nil), &block); end + + # source://rack/3.1.7/lib/rack/builder.rb#264 + def to_app; end + + # source://rack/3.1.7/lib/rack/builder.rb#159 + def use(middleware, *args, **_arg2, &block); end + + # source://rack/3.1.7/lib/rack/builder.rb#209 + def warmup(prc = T.unsafe(nil), &block); end + + private + + # source://rack/3.1.7/lib/rack/builder.rb#284 + def generate_map(default_app, mapping); end + + class << self + # source://rack/3.1.7/lib/rack/builder.rb#136 + def app(default_app = T.unsafe(nil), &block); end + + # source://rack/3.1.7/lib/rack/builder.rb#87 + def load_file(path, **options); end + + # source://rack/3.1.7/lib/rack/builder.rb#102 + def new_from_string(builder_script, path = T.unsafe(nil), **options); end + + # source://rack/3.1.7/lib/rack/builder.rb#65 + def parse_file(path, **options); end + end +end + +class Rack::CommonLogger + # source://rack/3.1.7/lib/rack/common_logger.rb#29 + def initialize(app, logger = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#264 + def call(env); end + + # source://rack/3.1.7/lib/rack/common_logger.rb#41 + def call_without_check(env); end + + private + + # source://rack/3.1.7/lib/rack/common_logger.rb#83 + def extract_content_length(headers); end + + # source://rack/3.1.7/lib/rack/common_logger.rb#52 + def log(env, status, response_headers, began_at); end +end + +# source://sinatra//lib/sinatra/main.rb#3 +module Sinatra + class << self + # Include the helper modules provided in Sinatra's request context. + # + # source://sinatra//lib/sinatra/base.rb#2136 + def helpers(*extensions, &block); end + + # Create a new Sinatra application; the block is evaluated in the class scope. + # + # source://sinatra//lib/sinatra/base.rb#2124 + def new(base = T.unsafe(nil), &block); end + + # Extend the top-level DSL with the modules provided. + # + # source://sinatra//lib/sinatra/base.rb#2131 + def register(*extensions, &block); end + + # Use the middleware for classic applications. + # + # source://sinatra//lib/sinatra/base.rb#2141 + def use(*args, &block); end + end +end + +# Execution context for classic style (top-level) applications. All +# DSL methods executed on main are delegated to this class. +# +# The Application class should not be subclassed, unless you want to +# inherit all settings, routes, handlers, and error pages from the +# top-level. Subclassing Sinatra::Base is highly recommended for +# modular applications. +# +# source://sinatra//lib/sinatra/base.rb#2058 +class Sinatra::Application < ::Sinatra::Base + class << self + # source://sinatra//lib/sinatra/base.rb#1362 + def app_file; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def app_file=(val); end + + def app_file?; end + + # source://sinatra//lib/sinatra/base.rb#2059 + def logging; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def logging=(val); end + + def logging?; end + def method_override; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def method_override=(val); end + + def method_override?; end + + # source://sinatra//lib/sinatra/base.rb#2064 + def register(*extensions, &block); end + + # source://sinatra//lib/sinatra/main.rb#36 + def run; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def run=(val); end + + def run?; end + end +end + +# source://sinatra//lib/sinatra/base.rb#274 +class Sinatra::BadRequest < ::Sinatra::Error + # source://sinatra//lib/sinatra/base.rb#275 + def http_status; end +end + +# Base class for all Sinatra applications and middleware. +# +# source://sinatra//lib/sinatra/base.rb#970 +class Sinatra::Base + include ::Rack::Utils + include ::Sinatra::Helpers + include ::Sinatra::Templates + + # @return [Base] a new instance of Base + # @yield [_self] + # @yieldparam _self [Sinatra::Base] the object that the method was called on + # + # source://sinatra//lib/sinatra/base.rb#980 + def initialize(app = T.unsafe(nil), **_kwargs); end + + # Returns the value of attribute app. + # + # source://sinatra//lib/sinatra/base.rb#977 + def app; end + + # Sets the attribute app + # + # @param value the value to set the attribute app to. + # + # source://sinatra//lib/sinatra/base.rb#977 + def app=(_arg0); end + + # Rack call interface. + # + # source://sinatra//lib/sinatra/base.rb#989 + def call(env); end + + # source://sinatra//lib/sinatra/base.rb#993 + def call!(env); end + + # Returns the value of attribute env. + # + # source://sinatra//lib/sinatra/base.rb#977 + def env; end + + # Sets the attribute env + # + # @param value the value to set the attribute env to. + # + # source://sinatra//lib/sinatra/base.rb#977 + def env=(_arg0); end + + # Forward the request to the downstream app -- middleware only. + # + # source://sinatra//lib/sinatra/base.rb#1040 + def forward; end + + # Exit the current block, halts any further processing + # of the request, and returns the specified response. + # + # source://sinatra//lib/sinatra/base.rb#1027 + def halt(*response); end + + # Returns the value of attribute params. + # + # source://sinatra//lib/sinatra/base.rb#977 + def params; end + + # Sets the attribute params + # + # @param value the value to set the attribute params to. + # + # source://sinatra//lib/sinatra/base.rb#977 + def params=(_arg0); end + + # Pass control to the next matching route. + # If there are no more matching routes, Sinatra will + # return a 404 response. + # + # source://sinatra//lib/sinatra/base.rb#1035 + def pass(&block); end + + # Returns the value of attribute request. + # + # source://sinatra//lib/sinatra/base.rb#977 + def request; end + + # Sets the attribute request + # + # @param value the value to set the attribute request to. + # + # source://sinatra//lib/sinatra/base.rb#977 + def request=(_arg0); end + + # Returns the value of attribute response. + # + # source://sinatra//lib/sinatra/base.rb#977 + def response; end + + # Sets the attribute response + # + # @param value the value to set the attribute response to. + # + # source://sinatra//lib/sinatra/base.rb#977 + def response=(_arg0); end + + # Access settings defined with Base.set. + # + # source://sinatra//lib/sinatra/base.rb#1021 + def settings; end + + # Returns the value of attribute template_cache. + # + # source://sinatra//lib/sinatra/base.rb#978 + def template_cache; end + + private + + # Dispatch a request with error handling. + # + # source://sinatra//lib/sinatra/base.rb#1176 + def dispatch!; end + + # source://sinatra//lib/sinatra/base.rb#1268 + def dump_errors!(boom); end + + # Find an custom error block for the key(s) specified. + # + # source://sinatra//lib/sinatra/base.rb#1249 + def error_block!(key, *block_params); end + + # Run filters defined on the class and all superclasses. + # Accepts an optional block to call after each filter is applied. + # + # source://sinatra//lib/sinatra/base.rb#1054 + def filter!(type, base = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#1922 + def force_encoding(*args); end + + # Error handling during requests. + # + # source://sinatra//lib/sinatra/base.rb#1203 + def handle_exception!(boom); end + + # Run the block with 'throw :halt' support and apply result to the response. + # + # source://sinatra//lib/sinatra/base.rb#1160 + def invoke(&block); end + + # If the current request matches pattern and conditions, fill params + # with keys and call the given block. + # Revert params afterwards. + # + # Returns pass block. + # + # source://sinatra//lib/sinatra/base.rb#1097 + def process_route(pattern, conditions, block = T.unsafe(nil), values = T.unsafe(nil)); end + + # Run routes defined on the class and all superclasses. + # + # source://sinatra//lib/sinatra/base.rb#1063 + def route!(base = T.unsafe(nil), pass_block = T.unsafe(nil)); end + + # Run a route block and throw :halt with the result. + # + # source://sinatra//lib/sinatra/base.rb#1088 + def route_eval; end + + # No matching route was found or all routes passed. The default + # implementation is to forward the request downstream when running + # as middleware (@app is non-nil); when no downstream app is set, raise + # a NotFound exception. Subclasses can override this method to perform + # custom route miss logic. + # + # @raise [NotFound] + # + # source://sinatra//lib/sinatra/base.rb#1135 + def route_missing; end + + # Attempt to serve static files from public directory. Throws :halt when + # a matching file is found, returns nil otherwise. + # + # source://sinatra//lib/sinatra/base.rb#1143 + def static!(options = T.unsafe(nil)); end + + class << self + def absolute_redirects; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def absolute_redirects=(val); end + + def absolute_redirects?; end + + # source://sinatra//lib/sinatra/base.rb#1362 + def add_charset; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def add_charset=(val); end + + def add_charset?; end + + # add a filter + # + # source://sinatra//lib/sinatra/base.rb#1493 + def add_filter(type, path = T.unsafe(nil), **options, &block); end + + # Define an after filter; runs after all requests within the same + # context as route handlers and may access/modify the request and + # response. + # + # source://sinatra//lib/sinatra/base.rb#1488 + def after(path = T.unsafe(nil), **options, &block); end + + def app_file; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def app_file=(val); end + + def app_file?; end + + # Define a before filter; runs before all requests within the same + # context as route handlers and may access/modify the request and + # response. + # + # source://sinatra//lib/sinatra/base.rb#1481 + def before(path = T.unsafe(nil), **options, &block); end + + # source://sinatra//lib/sinatra/base.rb#1965 + def bind; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def bind=(val); end + + def bind?; end + + # Creates a Rack::Builder instance with all the middleware set up and + # the given +app+ as end point. + # + # source://sinatra//lib/sinatra/base.rb#1665 + def build(app); end + + # source://sinatra//lib/sinatra/base.rb#1673 + def call(env); end + + # Like Kernel#caller but excluding certain magic entries and without + # line / method information; the resulting array contains filenames only. + # + # source://sinatra//lib/sinatra/base.rb#1679 + def caller_files; end + + # source://sinatra//lib/sinatra/base.rb#1300 + def callers_to_ignore; end + + # Add a route condition. The route is considered non-matching when the + # block returns false. + # + # source://sinatra//lib/sinatra/base.rb#1507 + def condition(name = T.unsafe(nil), &block); end + + # Set configuration options for Sinatra and/or the app. + # Allows scoping of settings for certain environments. + # + # @yield [_self] + # @yieldparam _self [Sinatra::Base] the object that the method was called on + # + # source://sinatra//lib/sinatra/base.rb#1574 + def configure(*envs); end + + # source://sinatra//lib/sinatra/base.rb#1362 + def default_content_type; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def default_content_type=(val); end + + def default_content_type?; end + + # source://sinatra//lib/sinatra/base.rb#1362 + def default_encoding; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def default_encoding=(val); end + + def default_encoding?; end + + # source://sinatra//lib/sinatra/base.rb#1538 + def delete(path, opts = T.unsafe(nil), &block); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#1568 + def development?; end + + # Same as calling `set :option, false` for each of the given options. + # + # source://sinatra//lib/sinatra/base.rb#1388 + def disable(*opts); end + + # source://sinatra//lib/sinatra/base.rb#1930 + def dump_errors; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def dump_errors=(val); end + + def dump_errors?; end + def empty_path_info; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def empty_path_info=(val); end + + def empty_path_info?; end + + # Same as calling `set :option, true` for each of the given options. + # + # source://sinatra//lib/sinatra/base.rb#1383 + def enable(*opts); end + + def environment; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def environment=(val); end + + def environment?; end + + # Define a custom error handler. Optionally takes either an Exception + # class, or an HTTP status code to specify which errors should be + # handled. + # + # source://sinatra//lib/sinatra/base.rb#1395 + def error(*codes, &block); end + + # Returns the value of attribute errors. + # + # source://sinatra//lib/sinatra/base.rb#1298 + def errors; end + + # Extension modules registered on this class and all superclasses. + # + # source://sinatra//lib/sinatra/base.rb#1323 + def extensions; end + + # Returns the value of attribute filters. + # + # source://sinatra//lib/sinatra/base.rb#1298 + def filters; end + + # Force data to specified encoding. It defaults to settings.default_encoding + # which is UTF-8 by default + # + # source://sinatra//lib/sinatra/base.rb#1909 + def force_encoding(data, encoding = T.unsafe(nil)); end + + # Defining a `GET` handler also automatically defines + # a `HEAD` handler. + # + # source://sinatra//lib/sinatra/base.rb#1526 + def get(path, opts = T.unsafe(nil), &block); end + + def handler_name; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def handler_name=(val); end + + def handler_name?; end + + # source://sinatra//lib/sinatra/base.rb#1540 + def head(path, opts = T.unsafe(nil), &block); end + + # Makes the methods defined in the block and in the Modules given + # in `extensions` available to the handlers and templates + # + # source://sinatra//lib/sinatra/base.rb#1552 + def helpers(*extensions, &block); end + + # Load embedded templates from the file; uses the caller's __FILE__ + # when no file is specified. + # + # source://sinatra//lib/sinatra/base.rb#1421 + def inline_templates=(file = T.unsafe(nil)); end + + # Define the layout template. The block must return the template source. + # + # source://sinatra//lib/sinatra/base.rb#1415 + def layout(name = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#1546 + def link(path, opts = T.unsafe(nil), &block); end + + def lock; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def lock=(val); end + + def lock?; end + def logging; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def logging=(val); end + + def logging?; end + def method_override; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def method_override=(val); end + + def method_override?; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def methodoverride=(val); end + + def methodoverride?; end + + # Middleware used in this class and all superclasses. + # + # source://sinatra//lib/sinatra/base.rb#1332 + def middleware; end + + # Lookup or register a mime type in Rack's mime registry. + # + # source://sinatra//lib/sinatra/base.rb#1454 + def mime_type(type, value = T.unsafe(nil)); end + + # provides all mime types matching type, including deprecated types: + # mime_types :html # => ['text/html'] + # mime_types :js # => ['application/javascript', 'text/javascript'] + # + # source://sinatra//lib/sinatra/base.rb#1467 + def mime_types(type); end + + # source://sinatra//lib/sinatra/base.rb#1362 + def mustermann_opts; end + + # source://sinatra//lib/sinatra/base.rb#1370 + def mustermann_opts=(val); end + + def mustermann_opts?; end + + # Create a new instance of the class fronted by its middleware + # pipeline. The object is guaranteed to respond to #call but may not be + # an instance of the class new was called on. + # + # source://sinatra//lib/sinatra/base.rb#1657 + def new(*args, **_arg1, &block); end + + def new!(*_arg0); end + + # Sugar for `error(404) { ... }` + # + # source://sinatra//lib/sinatra/base.rb#1404 + def not_found(&block); end + + # source://sinatra//lib/sinatra/base.rb#1497 + def on_start(&on_start_callback); end + + # Returns the value of attribute on_start_callback. + # + # source://sinatra//lib/sinatra/base.rb#1298 + def on_start_callback; end + + # source://sinatra//lib/sinatra/base.rb#1501 + def on_stop(&on_stop_callback); end + + # Returns the value of attribute on_stop_callback. + # + # source://sinatra//lib/sinatra/base.rb#1298 + def on_stop_callback; end + + # source://sinatra//lib/sinatra/base.rb#1542 + def options(path, opts = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#1544 + def patch(path, opts = T.unsafe(nil), &block); end + + def port; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def port=(val); end + + def port?; end + + # source://sinatra//lib/sinatra/base.rb#1536 + def post(path, opts = T.unsafe(nil), &block); end + + def prefixed_redirects; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def prefixed_redirects=(val); end + + def prefixed_redirects?; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#1569 + def production?; end + + def protection; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def protection=(val); end + + def protection?; end + + # The prototype instance used to process requests. + # + # source://sinatra//lib/sinatra/base.rb#1647 + def prototype; end + + # source://sinatra//lib/sinatra/base.rb#1511 + def public=(value); end + + # source://sinatra//lib/sinatra/base.rb#1520 + def public_dir; end + + # source://sinatra//lib/sinatra/base.rb#1516 + def public_dir=(value); end + + # source://sinatra//lib/sinatra/base.rb#1988 + def public_folder; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def public_folder=(val); end + + def public_folder?; end + + # source://sinatra//lib/sinatra/base.rb#1534 + def put(path, opts = T.unsafe(nil), &block); end + + def quiet; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def quiet=(val); end + + def quiet?; end + + # Stop the self-hosted server if running. + # + # source://sinatra//lib/sinatra/base.rb#1586 + def quit!; end + + # source://sinatra//lib/sinatra/base.rb#1929 + def raise_errors; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def raise_errors=(val); end + + def raise_errors?; end + + # Register an extension. Alternatively take a block from which an + # extension will be created and registered on the fly. + # + # source://sinatra//lib/sinatra/base.rb#1559 + def register(*extensions, &block); end + + # source://sinatra//lib/sinatra/base.rb#1984 + def reload_templates; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def reload_templates=(val); end + + def reload_templates?; end + + # Removes all routes, filters, middleware and extension hooks from the + # current class (not routes/filters/... defined by its superclass). + # + # source://sinatra//lib/sinatra/base.rb#1306 + def reset!; end + + # source://sinatra//lib/sinatra/base.rb#1982 + def root; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def root=(val); end + + def root?; end + + # Returns the value of attribute routes. + # + # source://sinatra//lib/sinatra/base.rb#1298 + def routes; end + + def run; end + + # Run the Sinatra app as a self-hosted server using + # Puma, Falcon, or WEBrick (in that order). If given a block, will call + # with the constructed handler once we have taken the stage. + # + # source://sinatra//lib/sinatra/base.rb#1603 + def run!(options = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#1361 + def run=(val); end + + def run?; end + + # Check whether the self-hosted server is running or not. + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#1642 + def running?; end + + def running_server; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def running_server=(val); end + + def running_server?; end + + # source://sinatra//lib/sinatra/base.rb#1362 + def server; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def server=(val); end + + def server?; end + + # source://sinatra//lib/sinatra/base.rb#1362 + def session_secret; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def session_secret=(val); end + + def session_secret?; end + + # source://sinatra//lib/sinatra/base.rb#1362 + def session_store; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def session_store=(val); end + + def session_store?; end + def sessions; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def sessions=(val); end + + def sessions?; end + + # Sets an option to the given value. If the value is a proc, + # the proc will be called every time the option is accessed. + # + # @raise [ArgumentError] + # + # source://sinatra//lib/sinatra/base.rb#1342 + def set(option, value = T.unsafe(nil), ignore_setter = T.unsafe(nil), &block); end + + # Access settings defined with Base.set. + # + # source://sinatra//lib/sinatra/base.rb#1016 + def settings; end + + # source://sinatra//lib/sinatra/base.rb#1931 + def show_exceptions; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def show_exceptions=(val); end + + def show_exceptions?; end + + # Run the Sinatra app as a self-hosted server using + # Puma, Falcon, or WEBrick (in that order). If given a block, will call + # with the constructed handler once we have taken the stage. + # + # source://sinatra//lib/sinatra/base.rb#1603 + def start!(options = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#1989 + def static; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def static=(val); end + + def static?; end + def static_cache_control; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def static_cache_control=(val); end + + def static_cache_control?; end + + # Stop the self-hosted server if running. + # + # source://sinatra//lib/sinatra/base.rb#1586 + def stop!; end + + def strict_paths; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def strict_paths=(val); end + + def strict_paths?; end + + # Define a named template. The block must return the template source. + # + # source://sinatra//lib/sinatra/base.rb#1409 + def template(name, &block); end + + # Returns the value of attribute templates. + # + # source://sinatra//lib/sinatra/base.rb#1298 + def templates; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#1570 + def test?; end + + def threaded; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def threaded=(val); end + + def threaded?; end + def traps; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def traps=(val); end + + def traps?; end + + # source://sinatra//lib/sinatra/base.rb#1548 + def unlink(path, opts = T.unsafe(nil), &block); end + + # Use the specified Rack middleware + # + # source://sinatra//lib/sinatra/base.rb#1579 + def use(middleware, *args, **_arg2, &block); end + + def use_code; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def use_code=(val); end + + def use_code?; end + + # source://sinatra//lib/sinatra/base.rb#1983 + def views; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def views=(val); end + + def views?; end + def x_cascade; end + + # source://sinatra//lib/sinatra/base.rb#1361 + def x_cascade=(val); end + + def x_cascade?; end + + private + + # Condition for matching user agent. Parameter should be Regexp. + # Will set params[:agent]. + # + # source://sinatra//lib/sinatra/base.rb#1739 + def agent(pattern); end + + # Like Kernel#caller but excluding certain magic entries + # + # source://sinatra//lib/sinatra/base.rb#1900 + def cleaned_caller(keep = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#1810 + def compile(path, route_mustermann_opts = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#1790 + def compile!(verb, path, block, **options); end + + # Dynamically defines a method on settings. + # + # source://sinatra//lib/sinatra/base.rb#1725 + def define_singleton(name, content = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#1783 + def generate_method(method_name, &block); end + + # Condition for matching host name. Parameter might be String or Regexp. + # + # source://sinatra//lib/sinatra/base.rb#1733 + def host_name(pattern); end + + # @private + # + # source://sinatra//lib/sinatra/base.rb#1879 + def inherited(subclass); end + + # source://sinatra//lib/sinatra/base.rb#1779 + def invoke_hook(name, *args); end + + # Condition for matching mimetypes. Accepts file extensions. + # + # source://sinatra//lib/sinatra/base.rb#1752 + def provides(*types); end + + # source://sinatra//lib/sinatra/base.rb#1771 + def route(verb, path, options = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#1841 + def setup_common_logger(builder); end + + # source://sinatra//lib/sinatra/base.rb#1845 + def setup_custom_logger(builder); end + + # source://sinatra//lib/sinatra/base.rb#1814 + def setup_default_middleware(builder); end + + # source://sinatra//lib/sinatra/base.rb#1828 + def setup_logging(builder); end + + # source://sinatra//lib/sinatra/base.rb#1824 + def setup_middleware(builder); end + + # source://sinatra//lib/sinatra/base.rb#1837 + def setup_null_logger(builder); end + + # source://sinatra//lib/sinatra/base.rb#1853 + def setup_protection(builder); end + + # source://sinatra//lib/sinatra/base.rb#1870 + def setup_sessions(builder); end + + # source://sinatra//lib/sinatra/base.rb#1709 + def setup_traps; end + + # Starts the server by running the Rack Handler. + # + # source://sinatra//lib/sinatra/base.rb#1686 + def start_server(handler, server_settings, handler_name); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#1705 + def suppress_messages?; end + + # source://sinatra//lib/sinatra/base.rb#1886 + def synchronize(&block); end + + # Condition for matching user agent. Parameter should be Regexp. + # Will set params[:agent]. + # + # source://sinatra//lib/sinatra/base.rb#1739 + def user_agent(pattern); end + + # used for deprecation warnings + # + # source://sinatra//lib/sinatra/base.rb#1895 + def warn_for_deprecation(message); end + end +end + +# source://sinatra//lib/sinatra/base.rb#975 +Sinatra::Base::URI_INSTANCE = T.let(T.unsafe(nil), URI::RFC2396_Parser) + +# Behaves exactly like Rack::CommonLogger with the notable exception that it does nothing, +# if another CommonLogger is already in the middleware chain. +# +# source://sinatra//lib/sinatra/base.rb#257 +class Sinatra::CommonLogger < ::Rack::CommonLogger + # source://sinatra//lib/sinatra/base.rb#258 + def call(env); end +end + +# Sinatra delegation mixin. Mixing this module into an object causes all +# methods to be delegated to the Sinatra::Application class. Used primarily +# at the top-level. +# +# source://sinatra//lib/sinatra/base.rb#2074 +module Sinatra::Delegator + private + + # source://sinatra//lib/sinatra/base.rb#2077 + def after(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def before(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def configure(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def delete(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def development?(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def disable(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def enable(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def error(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def get(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def head(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def helpers(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def layout(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def link(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def mime_type(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def not_found(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def on_start(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def on_stop(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def options(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def patch(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def post(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def production?(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def put(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def register(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def set(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def settings(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def template(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def test?(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def unlink(*args, **_arg1, &block); end + + # source://sinatra//lib/sinatra/base.rb#2077 + def use(*args, **_arg1, &block); end + + class << self + # source://sinatra//lib/sinatra/base.rb#2075 + def delegate(*methods); end + + # Returns the value of attribute target. + # + # source://sinatra//lib/sinatra/base.rb#2094 + def target; end + + # Sets the attribute target + # + # @param value the value to set the attribute target to. + # + # source://sinatra//lib/sinatra/base.rb#2094 + def target=(_arg0); end + end +end + +# source://sinatra//lib/sinatra/base.rb#271 +class Sinatra::Error < ::StandardError; end + +# Some Rack handlers implement an extended body object protocol, however, +# some middleware (namely Rack::Lint) will break it by not mirroring the methods in question. +# This middleware will detect an extended body object and will make sure it reaches the +# handler directly. We do this here, so our middleware and middleware set up by the app will +# still be able to run. +# +# source://sinatra//lib/sinatra/base.rb#222 +class Sinatra::ExtendedRack < ::Struct + # source://sinatra//lib/sinatra/base.rb#223 + def call(env); end + + private + + # @raise [NotImplementedError] + # + # source://sinatra//lib/sinatra/base.rb#242 + def after_response(&block); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#248 + def async?(status, _headers, body); end + + # source://sinatra//lib/sinatra/base.rb#235 + def setup_close(env, _status, _headers, body); end +end + +# Methods available to routes, before/after filters, and views. +# +# source://sinatra//lib/sinatra/base.rb#283 +module Sinatra::Helpers + # Set the Content-Disposition to "attachment" with the specified filename, + # instructing the user agents to prompt to save. + # + # source://sinatra//lib/sinatra/base.rb#414 + def attachment(filename = T.unsafe(nil), disposition = T.unsafe(nil)); end + + # Sugar for redirect (example: redirect back) + # + # source://sinatra//lib/sinatra/base.rb#650 + def back; end + + # whether or not the status is set to 400 + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#685 + def bad_request?; end + + # Set or retrieve the response body. When a block is given, + # evaluation is deferred until the body is read with #each. + # + # source://sinatra//lib/sinatra/base.rb#292 + def body(value = T.unsafe(nil), &block); end + + # Specify response freshness policy for HTTP caches (Cache-Control header). + # Any number of non-value directives (:public, :private, :no_cache, + # :no_store, :must_revalidate, :proxy_revalidate) may be passed along with + # a Hash of value directives (:max_age, :s_maxage). + # + # cache_control :public, :must_revalidate, :max_age => 60 + # => Cache-Control: public, must-revalidate, max-age=60 + # + # See RFC 2616 / 14.9 for more on standard cache control directives: + # http://tools.ietf.org/html/rfc2616#section-14.9.1 + # + # source://sinatra//lib/sinatra/base.rb#537 + def cache_control(*values); end + + # whether or not the status is set to 4xx + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#670 + def client_error?; end + + # Set the content-type of the response body given a media type or file + # extension. + # + # source://sinatra//lib/sinatra/base.rb#383 + def content_type(type = T.unsafe(nil), params = T.unsafe(nil)); end + + # Halt processing and return the error status provided. + # + # source://sinatra//lib/sinatra/base.rb#346 + def error(code, body = T.unsafe(nil)); end + + # Set the response entity tag (HTTP 'ETag' header) and halt if conditional + # GET matches. The +value+ argument is an identifier that uniquely + # identifies the current version of the resource. The +kind+ argument + # indicates whether the etag should be used as a :strong (default) or :weak + # cache validator. + # + # When the current request includes an 'If-None-Match' header with a + # matching etag, execution is immediately halted. If the request method is + # GET or HEAD, a '304 Not Modified' response is sent. + # + # source://sinatra//lib/sinatra/base.rb#620 + def etag(value, options = T.unsafe(nil)); end + + # Set the Expires header and Cache-Control/max-age directive. Amount + # can be an integer number of seconds in the future or a Time object + # indicating when the response should be considered "stale". The remaining + # "values" arguments are passed to the #cache_control helper: + # + # expires 500, :public, :must_revalidate + # => Cache-Control: public, must-revalidate, max-age=500 + # => Expires: Mon, 08 Jun 2009 08:50:17 GMT + # + # source://sinatra//lib/sinatra/base.rb#565 + def expires(amount, *values); end + + # Set multiple response headers with Hash. + # + # source://sinatra//lib/sinatra/base.rb#361 + def headers(hash = T.unsafe(nil)); end + + # whether or not the status is set to 1xx + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#655 + def informational?; end + + # Set the last modified time of the resource (HTTP 'Last-Modified' header) + # and halt if conditional GET matches. The +time+ argument is a Time, + # DateTime, or other object that responds to +to_time+. + # + # When the current request includes an 'If-Modified-Since' header that is + # equal or later than the time specified, execution is immediately halted + # with a '304 Not Modified' response. + # + # source://sinatra//lib/sinatra/base.rb#589 + def last_modified(time); end + + # Access shared logger object. + # + # source://sinatra//lib/sinatra/base.rb#372 + def logger; end + + # Look up a media type by file extension in Rack's mime registry. + # + # source://sinatra//lib/sinatra/base.rb#377 + def mime_type(type); end + + # Halt processing and return a 404 Not Found. + # + # source://sinatra//lib/sinatra/base.rb#356 + def not_found(body = T.unsafe(nil)); end + + # whether or not the status is set to 404 + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#680 + def not_found?; end + + # Halt processing and redirect to the URI provided. + # + # source://sinatra//lib/sinatra/base.rb#307 + def redirect(uri, *args); end + + # whether or not the status is set to 3xx + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#665 + def redirect?; end + + # Use the contents of the file at +path+ as the response body. + # + # source://sinatra//lib/sinatra/base.rb#425 + def send_file(path, opts = T.unsafe(nil)); end + + # whether or not the status is set to 5xx + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#675 + def server_error?; end + + # Access the underlying Rack session. + # + # source://sinatra//lib/sinatra/base.rb#367 + def session; end + + # Set or retrieve the response status code. + # + # source://sinatra//lib/sinatra/base.rb#285 + def status(value = T.unsafe(nil)); end + + # Allows to start sending data to the client even though later parts of + # the response body have not yet been generated. + # + # The close parameter specifies whether Stream#close should be called + # after the block has been executed. + # + # source://sinatra//lib/sinatra/base.rb#512 + def stream(keep_open = T.unsafe(nil)); end + + # whether or not the status is set to 2xx + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#660 + def success?; end + + # Generates a Time object from the given value. + # Used by #expires and #last_modified. + # + # source://sinatra//lib/sinatra/base.rb#691 + def time_for(value); end + + # Generates the absolute URI for a given path in the app. + # Takes Rack routers and reverse proxies into account. + # + # source://sinatra//lib/sinatra/base.rb#325 + def to(addr = T.unsafe(nil), absolute = T.unsafe(nil), add_script_name = T.unsafe(nil)); end + + # Generates the absolute URI for a given path in the app. + # Takes Rack routers and reverse proxies into account. + # + # source://sinatra//lib/sinatra/base.rb#325 + def uri(addr = T.unsafe(nil), absolute = T.unsafe(nil), add_script_name = T.unsafe(nil)); end + + # Generates the absolute URI for a given path in the app. + # Takes Rack routers and reverse proxies into account. + # + # source://sinatra//lib/sinatra/base.rb#325 + def url(addr = T.unsafe(nil), absolute = T.unsafe(nil), add_script_name = T.unsafe(nil)); end + + private + + # Helper method checking if a ETag value list includes the current ETag. + # + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#708 + def etag_matches?(list, new_resource = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#714 + def with_params(temp_params); end +end + +# source://sinatra//lib/sinatra/base.rb#610 +Sinatra::Helpers::ETAG_KINDS = T.let(T.unsafe(nil), Array) + +# https://html.spec.whatwg.org/#multipart-form-data +# +# source://sinatra//lib/sinatra/base.rb#406 +Sinatra::Helpers::MULTIPART_FORM_DATA_REPLACEMENT_TABLE = T.let(T.unsafe(nil), Hash) + +# Class of the response body in case you use #stream. +# +# Three things really matter: The front and back block (back being the +# block generating content, front the one sending it to the client) and +# the scheduler, integrating with whatever concurrency feature the Rack +# handler is using. +# +# Scheduler has to respond to defer and schedule. +# +# source://sinatra//lib/sinatra/base.rb#457 +class Sinatra::Helpers::Stream + # @return [Stream] a new instance of Stream + # + # source://sinatra//lib/sinatra/base.rb#461 + def initialize(scheduler = T.unsafe(nil), keep_open = T.unsafe(nil), &back); end + + # source://sinatra//lib/sinatra/base.rb#489 + def <<(data); end + + # source://sinatra//lib/sinatra/base.rb#494 + def callback(&block); end + + # source://sinatra//lib/sinatra/base.rb#469 + def close; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#502 + def closed?; end + + # source://sinatra//lib/sinatra/base.rb#476 + def each(&front); end + + # source://sinatra//lib/sinatra/base.rb#494 + def errback(&block); end + + class << self + # source://sinatra//lib/sinatra/base.rb#459 + def defer(*_arg0); end + + # source://sinatra//lib/sinatra/base.rb#458 + def schedule(*_arg0); end + end +end + +# A poor man's ActiveSupport::HashWithIndifferentAccess, with all the Rails-y +# stuff removed. +# +# Implements a hash where keys :foo and "foo" are +# considered to be the same. +# +# rgb = Sinatra::IndifferentHash.new +# +# rgb[:black] = '#000000' # symbol assignment +# rgb[:black] # => '#000000' # symbol retrieval +# rgb['black'] # => '#000000' # string retrieval +# +# rgb['white'] = '#FFFFFF' # string assignment +# rgb[:white] # => '#FFFFFF' # symbol retrieval +# rgb['white'] # => '#FFFFFF' # string retrieval +# +# Internally, symbols are mapped to strings when used as keys in the entire +# writing interface (calling e.g. []=, merge). This mapping +# belongs to the public interface. For example, given: +# +# hash = Sinatra::IndifferentHash.new +# hash[:a] = 1 +# +# You are guaranteed that the key is returned as a string: +# +# hash.keys # => ["a"] +# +# Technically other types of keys are accepted: +# +# hash = Sinatra::IndifferentHash +# hash[:a] = 1 +# hash[0] = 0 +# hash # => { "a"=>1, 0=>0 } +# +# But this class is intended for use cases where strings or symbols are the +# expected keys and it is convenient to understand both as the same. For +# example the +params+ hash in Sinatra. +# +# source://sinatra//lib/sinatra/indifferent_hash.rb#41 +class Sinatra::IndifferentHash < ::Hash + # source://sinatra//lib/sinatra/indifferent_hash.rb#70 + def [](key); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#74 + def []=(key, value); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#56 + def assoc(key); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#181 + def compact; end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#46 + def default(*args); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#52 + def default=(value); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#98 + def delete(key); end + + # Added in Ruby 2.3 + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#103 + def dig(key, *other_keys); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#185 + def except(*keys); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#64 + def fetch(key, *args); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#107 + def fetch_values(*keys); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#84 + def has_key?(key); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#92 + def has_value?(value); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#84 + def include?(key); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#80 + def key(value); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#84 + def key?(key); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#84 + def member?(key); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#143 + def merge(*other_hashes, &block); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#125 + def merge!(*other_hashes); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#60 + def rassoc(value); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#175 + def reject(*args, &block); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#147 + def replace(other_hash); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#169 + def select(*args, &block); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#113 + def slice(*keys); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#74 + def store(key, value); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#160 + def transform_keys(&block); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#164 + def transform_keys!; end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#151 + def transform_values(&block); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#155 + def transform_values!; end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#125 + def update(*other_hashes); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/indifferent_hash.rb#92 + def value?(value); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#119 + def values_at(*keys); end + + private + + # source://sinatra//lib/sinatra/indifferent_hash.rb#193 + def convert_key(key); end + + # source://sinatra//lib/sinatra/indifferent_hash.rb#197 + def convert_value(value); end + + class << self + # source://sinatra//lib/sinatra/indifferent_hash.rb#42 + def [](*args); end + end +end + +# source://sinatra//lib/sinatra/base.rb#278 +class Sinatra::NotFound < ::Sinatra::Error + # source://sinatra//lib/sinatra/base.rb#279 + def http_status; end +end + +# The request object. See Rack::Request for more info: +# https://rubydoc.info/github/rack/rack/main/Rack/Request +# +# source://sinatra//lib/sinatra/base.rb#28 +class Sinatra::Request < ::Rack::Request + # Returns an array of acceptable media types for the response + # + # source://sinatra//lib/sinatra/base.rb#33 + def accept; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#45 + def accept?(type); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#63 + def forwarded?; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#71 + def idempotent?; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#75 + def link?; end + + # source://sinatra//lib/sinatra/base.rb#83 + def params; end + + # source://sinatra//lib/sinatra/base.rb#49 + def preferred_type(*types); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#67 + def safe?; end + + # source://rack/3.1.7/lib/rack/request.rb#410 + def secure?; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#79 + def unlink?; end +end + +# source://sinatra//lib/sinatra/base.rb#91 +class Sinatra::Request::AcceptEntry + # @return [AcceptEntry] a new instance of AcceptEntry + # + # source://sinatra//lib/sinatra/base.rb#95 + def initialize(entry); end + + # source://sinatra//lib/sinatra/base.rb#108 + def <=>(other); end + + # Returns the value of attribute entry. + # + # source://sinatra//lib/sinatra/base.rb#93 + def entry; end + + # source://sinatra//lib/sinatra/base.rb#129 + def method_missing(*args, &block); end + + # Returns the value of attribute params. + # + # source://sinatra//lib/sinatra/base.rb#92 + def params; end + + # Sets the attribute params + # + # @param value the value to set the attribute params to. + # + # source://sinatra//lib/sinatra/base.rb#92 + def params=(_arg0); end + + # source://sinatra//lib/sinatra/base.rb#112 + def priority; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#125 + def respond_to?(*args); end + + # source://sinatra//lib/sinatra/base.rb#121 + def to_s(full = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#117 + def to_str; end +end + +# source://sinatra//lib/sinatra/base.rb#29 +Sinatra::Request::HEADER_PARAM = T.let(T.unsafe(nil), Regexp) + +# source://sinatra//lib/sinatra/base.rb#30 +Sinatra::Request::HEADER_VALUE_WITH_PARAMS = T.let(T.unsafe(nil), Regexp) + +# source://sinatra//lib/sinatra/base.rb#134 +class Sinatra::Request::MimeTypeEntry + # @return [MimeTypeEntry] a new instance of MimeTypeEntry + # + # source://sinatra//lib/sinatra/base.rb#137 + def initialize(entry); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#148 + def accepts?(entry); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#156 + def matches_params?(params); end + + # Returns the value of attribute params. + # + # source://sinatra//lib/sinatra/base.rb#135 + def params; end + + # source://sinatra//lib/sinatra/base.rb#152 + def to_str; end +end + +# The response object. See Rack::Response and Rack::Response::Helpers for +# more info: +# https://rubydoc.info/github/rack/rack/main/Rack/Response +# https://rubydoc.info/github/rack/rack/main/Rack/Response/Helpers +# +# source://sinatra//lib/sinatra/base.rb#168 +class Sinatra::Response < ::Rack::Response + # source://sinatra//lib/sinatra/base.rb#171 + def body=(value); end + + # source://sinatra//lib/sinatra/base.rb#176 + def each; end + + # source://sinatra//lib/sinatra/base.rb#180 + def finish; end + + private + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#204 + def calculate_content_length?; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#212 + def drop_body?; end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/base.rb#208 + def drop_content_info?; end +end + +# source://sinatra//lib/sinatra/base.rb#169 +Sinatra::Response::DROP_BODY_RESPONSES = T.let(T.unsafe(nil), Array) + +# Sinatra::ShowExceptions catches all exceptions raised from the app it +# wraps. It shows a useful backtrace with the sourcefile and clickable +# context, the whole Rack environment and the request data. +# +# Be careful when you use this on public-facing sites as it could reveal +# information helpful to attackers. +# +# source://sinatra//lib/sinatra/show_exceptions.rb#12 +class Sinatra::ShowExceptions < ::Rack::ShowExceptions + # @return [ShowExceptions] a new instance of ShowExceptions + # + # source://sinatra//lib/sinatra/show_exceptions.rb#18 + def initialize(app); end + + # source://sinatra//lib/sinatra/show_exceptions.rb#22 + def call(env); end + + # source://sinatra//lib/sinatra/show_exceptions.rb#48 + def template; end + + private + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/show_exceptions.rb#54 + def bad_request?(exception); end + + # source://sinatra//lib/sinatra/show_exceptions.rb#63 + def frame_class(frame); end + + # @return [Boolean] + # + # source://sinatra//lib/sinatra/show_exceptions.rb#58 + def prefers_plain_text?(env); end +end + +# source://sinatra//lib/sinatra/show_exceptions.rb#74 +Sinatra::ShowExceptions::TEMPLATE = T.let(T.unsafe(nil), ERB) + +# Extremely simple template cache implementation. +# * Not thread-safe. +# * Size is unbounded. +# * Keys are not copied defensively, and should not be modified after +# being passed to #fetch. More specifically, the values returned by +# key#hash and key#eql? should not change. +# +# Implementation copied from Tilt::Cache. +# +# source://sinatra//lib/sinatra/base.rb#948 +class Sinatra::TemplateCache + # @return [TemplateCache] a new instance of TemplateCache + # + # source://sinatra//lib/sinatra/base.rb#949 + def initialize; end + + # Clears the cache. + # + # source://sinatra//lib/sinatra/base.rb#964 + def clear; end + + # Caches a value for key, or returns the previously cached value. + # If a value has been previously cached for key then it is + # returned. Otherwise, block is yielded to and its return value + # which may be nil, is cached under key and returned. + # + # source://sinatra//lib/sinatra/base.rb#957 + def fetch(*key); end +end + +# Template rendering methods. Each method takes the name of a template +# to render as a Symbol and returns a String with the rendered output, +# as well as an optional hash with additional options. +# +# `template` is either the name or path of the template as symbol +# (Use `:'subdir/myview'` for views in subdirectories), or a string +# that will be rendered. +# +# Possible options are: +# :content_type The content type to use, same arguments as content_type. +# :layout If set to something falsy, no layout is rendered, otherwise +# the specified layout is used (Ignored for `sass`) +# :layout_engine Engine to use for rendering the layout. +# :locals A hash with local variables that should be available +# in the template +# :scope If set, template is evaluate with the binding of the given +# object rather than the application instance. +# :views Views directory to use. +# +# source://sinatra//lib/sinatra/base.rb#741 +module Sinatra::Templates + # source://sinatra//lib/sinatra/base.rb#746 + def initialize; end + + # source://sinatra//lib/sinatra/base.rb#792 + def asciidoc(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#774 + def builder(template = T.unsafe(nil), options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#752 + def erb(template, options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # Calls the given block for every possible template file in views, + # named name.ext, where ext is registered on engine. + # + # @yield [::File.join(views, "#{name}.#{@preferred_extension}")] + # + # source://sinatra//lib/sinatra/base.rb#821 + def find_template(views, name, engine); end + + # source://sinatra//lib/sinatra/base.rb#756 + def haml(template, options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#779 + def liquid(template, options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#796 + def markaby(template = T.unsafe(nil), options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#783 + def markdown(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#800 + def nokogiri(template = T.unsafe(nil), options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#814 + def rabl(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#788 + def rdoc(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#760 + def sass(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#767 + def scss(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + # source://sinatra//lib/sinatra/base.rb#805 + def slim(template, options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # source://sinatra//lib/sinatra/base.rb#809 + def yajl(template, options = T.unsafe(nil), locals = T.unsafe(nil)); end + + private + + # source://sinatra//lib/sinatra/base.rb#930 + def compile_block_template(template, options, &body); end + + # source://sinatra//lib/sinatra/base.rb#892 + def compile_template(engine, data, options, views); end + + # source://sinatra//lib/sinatra/base.rb#841 + def render(engine, data, options = T.unsafe(nil), locals = T.unsafe(nil), &block); end + + # logic shared between builder and nokogiri + # + # source://sinatra//lib/sinatra/base.rb#832 + def render_ruby(engine, template, options = T.unsafe(nil), locals = T.unsafe(nil), &block); end +end + +# source://sinatra//lib/sinatra/base.rb#742 +module Sinatra::Templates::ContentTyped + # Returns the value of attribute content_type. + # + # source://sinatra//lib/sinatra/base.rb#743 + def content_type; end + + # Sets the attribute content_type + # + # @param value the value to set the attribute content_type to. + # + # source://sinatra//lib/sinatra/base.rb#743 + def content_type=(_arg0); end +end + +# source://sinatra//lib/sinatra/version.rb#4 +Sinatra::VERSION = T.let(T.unsafe(nil), String) + +# source://sinatra//lib/sinatra/base.rb#2100 +class Sinatra::Wrapper + # @return [Wrapper] a new instance of Wrapper + # + # source://sinatra//lib/sinatra/base.rb#2101 + def initialize(stack, instance); end + + # source://sinatra//lib/sinatra/base.rb#2114 + def call(env); end + + # source://sinatra//lib/sinatra/base.rb#2110 + def helpers; end + + # source://sinatra//lib/sinatra/base.rb#2118 + def inspect; end + + # source://sinatra//lib/sinatra/base.rb#2106 + def settings; end +end diff --git a/sorbet/rbi/orka_api_client.rbi b/sorbet/rbi/orka_api_client.rbi new file mode 100644 index 0000000..d401da0 --- /dev/null +++ b/sorbet/rbi/orka_api_client.rbi @@ -0,0 +1,1920 @@ +# typed: strong +module OrkaAPI + module Models + # @private + module AttrPredicate + end + + # The base class for lazily-loaded objects. + class LazyModel + # _@param_ `lazy_initialized` + sig { params(lazy_initialized: T::Boolean).void } + def initialize(lazy_initialized); end + + # Forces this lazily-loaded object to be fully loaded, performing any necessary network operations. + sig { returns(T.self_type) } + def eager; end + + # Re-fetches this object's data from the Orka API. This will raise an error if the object no longer exists. + sig { void } + def refresh; end + end + + # An +.iso+ disk image used exclusively for the installation of macOS on a virtual machine. You must attach the + # ISO to the VM during deployment. After the installation is complete and the VM has booted successfully, you + # need to restart the VM to detach the ISO. + # + # @note All ISO requests are supported for Intel nodes only. + class ISO < OrkaAPI::Models::LazyModel + # _@param_ `name` + # + # _@param_ `conn` + sig { params(name: String, conn: Connection).returns(ISO) } + def self.lazy_prepare(name:, conn:); end + + # _@param_ `hash` + # + # _@param_ `conn` + sig { params(hash: T::Hash[T.untyped, T.untyped], conn: Connection).returns(ISO) } + def self.from_hash(hash, conn:); end + + # _@param_ `conn` + # + # _@param_ `name` + # + # _@param_ `hash` + sig { params(conn: Connection, name: T.nilable(String), hash: T.nilable(T::Hash[T.untyped, T.untyped])).void } + def initialize(conn:, name: nil, hash: nil); end + + # Rename this ISO. + # + # This method requires the client to be configured with a token. + # + # _@param_ `new_name` — The new name for this ISO. + # + # _@note_ — Make sure that the ISO is not in use. Any VMs that have the ISO of the old name attached will no longer + # be able to boot from it. + sig { params(new_name: String).void } + def rename(new_name); end + + # Copy this ISO to a new one. + # + # This method requires the client to be configured with a token. + # + # _@param_ `new_name` — The name for the copy of this ISO. + # + # _@return_ — The lazily-loaded ISO copy. + sig { params(new_name: String).returns(Image) } + def copy(new_name); end + + # Delete this ISO from the local Orka storage. + # + # This method requires the client to be configured with a token. + # + # _@note_ — Make sure that the ISO is not in use. Any VMs that have the ISO attached will no longer be able to boot + # from it. + sig { void } + def delete; end + + # _@return_ — The name of this ISO. + sig { returns(String) } + attr_reader :name + + # _@return_ — The size of this ISO. + sig { returns(String) } + attr_reader :size + + # _@return_ — The time this image was last modified. + sig { returns(DateTime) } + attr_reader :modification_time + end + + # Information on a disk attached to a VM. + class Disk + # _@param_ `type` + # + # _@param_ `device` + # + # _@param_ `target` + # + # _@param_ `source` + sig do + params( + type: String, + device: String, + target: String, + source: String + ).void + end + def initialize(type:, device:, target:, source:); end + + sig { returns(String) } + attr_reader :type + + sig { returns(String) } + attr_reader :device + + sig { returns(String) } + attr_reader :target + + sig { returns(String) } + attr_reader :source + end + + # A physical or logical host that provides computational resources for your VMs. Usually, an Orka node is a + # genuine Apple physical host with a host OS on top. You have no direct access (via VNC, SSH, or Screen Sharing) + # to your nodes. + class Node < OrkaAPI::Models::LazyModel + # _@param_ `name` + # + # _@param_ `conn` + # + # _@param_ `admin` + sig { params(name: String, conn: Connection, admin: T::Boolean).returns(Node) } + def self.lazy_prepare(name:, conn:, admin: false); end + + # _@param_ `hash` + # + # _@param_ `conn` + # + # _@param_ `admin` + sig { params(hash: T::Hash[T.untyped, T.untyped], conn: Connection, admin: T::Boolean).returns(Node) } + def self.from_hash(hash, conn:, admin: false); end + + # _@param_ `conn` + # + # _@param_ `name` + # + # _@param_ `hash` + # + # _@param_ `admin` + sig do + params( + conn: Connection, + name: T.nilable(String), + hash: T.nilable(T::Hash[T.untyped, T.untyped]), + admin: T::Boolean + ).void + end + def initialize(conn:, name: nil, hash: nil, admin: false); end + + # Get a detailed list of all reserved ports on this node. Orka lists them as port mappings between + # {ProtocolPortMapping#host_port host_port} and {ProtocolPortMapping#guest_port guest_port}. + # {ProtocolPortMapping#host_port host_port} indicates a port on the node, {ProtocolPortMapping#guest_port + # guest_port} indicates a port on a VM on this node. + # + # This method requires the client to be configured with a token. + # The network operation is not performed immediately upon return of this method. The request is performed when + # any action is performed on the enumerator, or otherwise forced via {Models::Enumerator#eager}. + # + # _@return_ — The enumerator of the reserved ports list. + sig { returns(T::Enumerator[ProtocolPortMapping]) } + def reserved_ports; end + + # Tag this node as sandbox. This limits deployment management from the Orka CLI. You can perform only + # Kubernetes deployment management with +kubectl+, {https://helm.sh/docs/helm/#helm Helm}, and Tiller. + # + # This method requires the client to be configured with both a token and a license key. + # + # _@note_ — This request is supported for Intel nodes only. + sig { void } + def enable_sandbox; end + + # Remove the sandbox tag from this node. This re-enables deployment management with the Orka CLI. + # + # This method requires the client to be configured with both a token and a license key. + # + # _@note_ — This request is supported for Intel nodes only. + sig { void } + def disable_sandbox; end + + # Dedicate this node to a specified user group. Only users from this user group will be able to deploy to the + # node. + # + # This method requires the client to be configured with both a token and a license key. + # + # _@param_ `group` — The user group to dedicate the node to. + sig { params(group: T.nilable(String)).void } + def dedicate_to_group(group); end + + # Make this node available to all users. + # + # This method requires the client to be configured with both a token and a license key. + sig { void } + def remove_group_dedication; end + + # Assign the specified tag to the specified node (enable node affinity). When node affinity is configured, + # Orka first attempts to deploy to the specified node or group of nodes, before moving to any other nodes. + # + # This method requires the client to be configured with both a token and a license key. + # + # _@param_ `tag_name` — The name of the tag. + sig { params(tag_name: String).void } + def tag(tag_name); end + + # Remove the specified tag from the specified node. + # + # This method requires the client to be configured with both a token and a license key. + # + # _@param_ `tag_name` — The name of the tag. + sig { params(tag_name: String).void } + def untag(tag_name); end + + # _@return_ — The name of this node. + sig { returns(String) } + attr_reader :name + + # _@return_ — The host name of this node. + sig { returns(String) } + attr_reader :host_name + + # _@return_ — The IP address of this node. + sig { returns(String) } + attr_reader :address + + # _@return_ — The host IP address of this node. + sig { returns(String) } + attr_reader :host_ip + + # _@return_ — The number of free CPU cores on this node. + sig { returns(Integer) } + attr_reader :available_cpu_cores + + # _@return_ — The total number of CPU cores on this node that are allocatable to VMs. + sig { returns(Integer) } + attr_reader :allocatable_cpu_cores + + # _@return_ — The number of free GPUs on this node. + sig { returns(Integer) } + attr_reader :available_gpu_count + + # _@return_ — The total number of GPUs on this node that are allocatable to VMs. + sig { returns(Integer) } + attr_reader :allocatable_gpu_count + + # _@return_ — The amount of free RAM on this node. + sig { returns(String) } + attr_reader :available_memory + + # _@return_ — The total number of CPU cores on this node. + sig { returns(Integer) } + attr_reader :total_cpu_cores + + # _@return_ — The total amount of RAM on this node. + sig { returns(String) } + attr_reader :total_memory + + # _@return_ — The type of this node (WORKER, FOUNDATION, SANDBOX). + sig { returns(String) } + attr_reader :type + + # _@return_ — The state of this node. + sig { returns(String) } + attr_reader :state + + # _@return_ — The user group this node is dedicated to, if any. + sig { returns(T.nilable(String)) } + attr_reader :orka_group + + # _@return_ — The list of tags this node has been assigned. + sig { returns(T::Array[String]) } + attr_reader :tags + end + + # To work with Orka, you need to have a user with an assigned license. You will use this user and the respective + # credentials to authenticate against the Orka service. After being authenticated against the service, you can + # run Orka API calls. + class User < OrkaAPI::Models::LazyModel + # _@param_ `email` + # + # _@param_ `conn` + sig { params(email: String, conn: Connection).returns(User) } + def self.lazy_prepare(email:, conn:); end + + # _@param_ `conn` + # + # _@param_ `email` + # + # _@param_ `group` + sig { params(conn: Connection, email: String, group: T.nilable(String)).void } + def initialize(conn:, email:, group: nil); end + + # Delete the user in the endpoint. The user must have no Orka resources associated with them (other than their + # authentication tokens). This operation invalidates all tokens associated with the user. + # + # This method requires the client to be configured with both a token and a license key. + sig { void } + def delete; end + + # Reset the password for the user. This operation is intended for administrators. + # + # This method requires the client to be configured with both a token and a license key. + # + # _@param_ `password` — The new password for the user. + sig { params(password: String).void } + def reset_password(password); end + + # Apply a group label to the user. + # + # This method requires the client to be configured with a license key. + # + # _@param_ `group` — The new group for the user. + # + # _@note_ — This is a BETA feature. + sig { params(group: String).void } + def change_group(group); end + + # Remove a group label from the user. + # + # This method requires the client to be configured with a license key. + # + # _@note_ — This is a BETA feature. + sig { void } + def remove_group; end + + # _@return_ — The email address for the user. + sig { returns(String) } + attr_reader :email + + # _@return_ — The group the user is in, if any. + sig { returns(T.nilable(String)) } + attr_reader :group + end + + # A disk image that represents a VM's storage and its contents, including the OS and any installed software. + class Image < OrkaAPI::Models::LazyModel + # _@param_ `name` + # + # _@param_ `conn` + sig { params(name: String, conn: Connection).returns(Image) } + def self.lazy_prepare(name:, conn:); end + + # _@param_ `hash` + # + # _@param_ `conn` + sig { params(hash: T::Hash[T.untyped, T.untyped], conn: Connection).returns(Image) } + def self.from_hash(hash, conn:); end + + # _@param_ `conn` + # + # _@param_ `name` + # + # _@param_ `hash` + sig { params(conn: Connection, name: T.nilable(String), hash: T.nilable(T::Hash[T.untyped, T.untyped])).void } + def initialize(conn:, name: nil, hash: nil); end + + # Rename this image. + # + # This method requires the client to be configured with a token. + # + # _@param_ `new_name` — The new name for this image. + # + # _@note_ — After you rename a base image, you can no longer deploy any VM configurations that are based on the + # image of the old name. + sig { params(new_name: String).void } + def rename(new_name); end + + # Copy this image to a new one. + # + # This method requires the client to be configured with a token. + # + # _@param_ `new_name` — The name for the copy of this image. + # + # _@return_ — The lazily-loaded image copy. + sig { params(new_name: String).returns(Image) } + def copy(new_name); end + + # Delete this image from the local Orka storage. + # + # This method requires the client to be configured with a token. + # + # _@note_ — Make sure that the image is not in use. + sig { void } + def delete; end + + # Download this image from Orka cluster storage to your local filesystem. + # + # This method requires the client to be configured with a token. + # + # _@param_ `to` — An open IO, or a String/Pathname file path to the file or directory where you want the image to be written. + # + # _@note_ — This request is supported for Intel images only. Intel images have +.img+ extension. + sig { params(to: T.any(String, Pathname, IO)).void } + def download(to:); end + + # Request the MD5 file checksum for this image in Orka cluster storage. The checksum can be used to verify file + # integrity for a downloaded or uploaded image. + # + # This method requires the client to be configured with a token. + # + # _@return_ — The MD5 checksum of the image, or nil if the calculation is in progress and has not + # completed. + # + # _@note_ — This request is supported for Intel images only. Intel images have +.img+ extension. + sig { returns(T.nilable(String)) } + def checksum; end + + # _@return_ — The name of this image. + sig { returns(String) } + attr_reader :name + + # _@return_ — The size of this image. Orka lists generated empty storage disks with a fixed size of ~192k. + # When attached to a VM and formatted, the disk will appear with its correct size in the OS. + sig { returns(String) } + attr_reader :size + + # _@return_ — The time this image was last modified. + sig { returns(DateTime) } + attr_reader :modification_time + + # _@return_ — The time this image was first created, if available. + sig { returns(T.nilable(DateTime)) } + attr_reader :creation_time + + sig { returns(String) } + attr_reader :owner + end + + # Enumerator subclass for networked operations. + class Enumerator < ::Enumerator + Elem = type_member + + sig { void } + def initialize; end + + # Forces this lazily-loaded enumerator to be fully loaded, performing any necessary network operations. + sig { returns(T.self_type) } + def eager; end + end + + # Represents an ISO which exists in the Orka remote repo rather than local storage. + class RemoteISO + # _@param_ `name` + # + # _@param_ `conn` + sig { params(name: String, conn: Connection).void } + def initialize(name, conn:); end + + # Pull an ISO from the remote repo. You can retain the ISO name or change it during the operation. This is a + # long-running operation and might take a while. + # + # The operation copies the ISO to the local storage of your Orka environment. The ISO will be available for use + # by all users of the environment. + # + # This method requires the client to be configured with a token. + # + # _@param_ `new_name` — The name for the local copy of this ISO. + # + # _@return_ — The lazily-loaded local ISO. + sig { params(new_name: String).returns(ISO) } + def pull(new_name); end + + # _@return_ — The name of this remote ISO. + sig { returns(String) } + attr_reader :name + end + + # Provides information on the client's token. + class TokenInfo + extend OrkaAPI::Models::AttrPredicate + + # _@param_ `hash` + # + # _@param_ `conn` + sig { params(hash: T::Hash[T.untyped, T.untyped], conn: Connection).void } + def initialize(hash, conn:); end + + # _@return_ — True if the tokeb is valid for authentication. + sig { returns(T::Boolean) } + attr_reader :authenticated? + + # _@return_ — True if the token has been revoked. + sig { returns(T::Boolean) } + attr_reader :token_revoked? + + # _@return_ — The user associated with the token. + sig { returns(User) } + attr_reader :user + end + + # A virtual machine deployed on a {Node node} from an existing {VMConfiguration VM configuration} or cloned from + # an existing virtual machine. In the case of macOS VMs, this is a full macOS VM inside of a + # {https://www.docker.com/resources/what-container Docker container}. + class VMInstance + extend OrkaAPI::Models::AttrPredicate + + # _@param_ `hash` + # + # _@param_ `conn` + # + # _@param_ `admin` + sig { params(hash: T::Hash[T.untyped, T.untyped], conn: Connection, admin: T::Boolean).void } + def initialize(hash, conn:, admin: false); end + + # Remove the VM instance. + # + # If the VM instance belongs to the user associated with the client's token then the client only needs to be + # configured with a token. Otherwise, if you are removing a VM instance associated with another user, you need + # to configure the client with both a token and a license key. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # attributes like {#status}. You must fetch a new object instance from the client to refresh this data. + sig { void } + def delete; end + + # Power ON the VM. + # + # This method requires the client to be configured with a token. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # attributes like {#status}. You must fetch a new object instance from the client to refresh this data. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { void } + def start; end + + # Power OFF the VM. + # + # This method requires the client to be configured with a token. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # attributes like {#status}. You must fetch a new object instance from the client to refresh this data. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { void } + def stop; end + + # Suspend the VM. + # + # This method requires the client to be configured with a token. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # attributes like {#status}. You must fetch a new object instance from the client to refresh this data. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { void } + def suspend; end + + # Resume the VM. The VM must already be suspended. + # + # This method requires the client to be configured with a token. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # attributes like {#status}. You must fetch a new object instance from the client to refresh this data. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { void } + def resume; end + + # Revert the VM to the latest state of its base image. This operation restarts the VM. + # + # This method requires the client to be configured with a token. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # attributes like {#status}. You must fetch a new object instance from the client to refresh this data. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { void } + def revert; end + + # List the disks attached to the VM. The VM must be non-scaled. + # + # This method requires the client to be configured with a token. + # The network operation is not performed immediately upon return of this method. The request is performed when + # any action is performed on the enumerator, or otherwise forced via {Models::Enumerator#eager}. + # + # _@return_ — The enumerator of the disk list. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { returns(T::Enumerator[Disk]) } + def disks; end + + # Attach a disk to the VM. The VM must be non-scaled. + # + # You can attach any of the following disks: + # + # * Any disks created with {Client#generate_empty_image} + # * Any non-bootable images available in your Orka storage and listed by {Client#images} + # + # This method requires the client to be configured with a token. + # + # _@param_ `image` — The disk to attach to the VM. + # + # _@param_ `mount_point` — The mount point to attach the VM to. + # + # _@note_ — Before you can use the attached disk, you need to restart the VM with a {#stop manual stop} of the VM, + # followed by a {#start manual start} VM. A software reboot from the OS will not trigger macOS to recognize + # the disk. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { params(image: T.any(Image, String), mount_point: String).void } + def attach_disk(image:, mount_point:); end + + # Save the VM configuration state (disk and memory). + # + # If VM state is previously saved, it is overwritten. To overwrite the VM state, it must not be used by any + # deployed VM. + # + # This method requires the client to be configured with a token. + # + # _@note_ — Saving VM state is restricted only to VMs that have GPU passthrough disabled. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { void } + def save_state; end + + # Apply the current state of the VM's image to the original base image in the Orka storage. Use this operation + # to modify an existing base image. All VM configs that reference this base image will be affected. + # + # The VM must be non-scaled. The base image to which you want to commit changes must be in use by only one VM. + # The base image to which you want to commit changes must not be in use by a VM configuration with saved VM + # state. + # + # This method requires the client to be configured with a token. + sig { void } + def commit_to_base_image; end + + # Save the current state of the VM's image to a new base image in the Orka storage. Use this operation to + # create a new base image. + # + # The VM must be non-scaled. The base image name that you specify must not be in use. + # + # This method requires the client to be configured with a token. + # + # _@param_ `image_name` — The name to give to the new base image. + # + # _@return_ — The lazily-loaded new base image. + sig { params(image_name: String).returns(Image) } + def save_new_base_image(image_name); end + + # Resize the current disk of the VM and save it as a new base image. This does not affect the original base + # image of the VM. + # + # This method requires the client to be configured with a token. + # + # _@param_ `username` — The username of the VM user. + # + # _@param_ `password` — The password of the VM user. + # + # _@param_ `image_name` — The new name for the resized image. + # + # _@param_ `image_size` — The size of the new image (in k, M, G, or T), for example +"100G"+. + # + # _@return_ — The lazily-loaded new base image. + sig do + params( + username: String, + password: String, + image_name: String, + image_size: String + ).returns(Image) + end + def resize_image(username:, password:, image_name:, image_size:); end + + # _@return_ — The ID of the VM. + sig { returns(String) } + attr_reader :id + + # _@return_ — The name of the VM. + sig { returns(String) } + attr_reader :name + + # _@return_ — The node the VM is deployed on. + sig { returns(Node) } + attr_reader :node + + # _@return_ — The owner of the VM, i.e. the user which deployed it. + sig { returns(User) } + attr_reader :owner + + # _@return_ — The state of the node the VM is deployed on. + sig { returns(String) } + attr_reader :node_status + + # _@return_ — The IP of the VM. + sig { returns(String) } + attr_reader :ip + + # _@return_ — The port used to connect to the VM via VNC. + sig { returns(Integer) } + attr_reader :vnc_port + + # _@return_ — The port used to connect to the VM via macOS Screen Sharing. + sig { returns(Integer) } + attr_reader :screen_sharing_port + + # _@return_ — The port used to connect to the VM via SSH. + sig { returns(Integer) } + attr_reader :ssh_port + + # _@return_ — The number of CPU cores allocated to the VM. + sig { returns(Integer) } + attr_reader :cpu_cores + + # _@return_ — The number of vCPUs allocated to the VM. + sig { returns(Integer) } + attr_reader :vcpu_count + + # _@return_ — The number of GPUs allocated to the VM. + sig { returns(Integer) } + attr_reader :gpu_count + + # _@return_ — The amount of RAM allocated to the VM. + sig { returns(String) } + attr_reader :ram + + # _@return_ — The base image the VM was deployed from. + sig { returns(Image) } + attr_reader :base_image + + # _@return_ — The VM configuration object this instance is based on. + sig { returns(VMConfiguration) } + attr_reader :config + + sig { returns(String) } + attr_reader :configuration_template + + # _@return_ — The status of the VM, at the time this class was initialized. + sig { returns(String) } + attr_reader :status + + # _@return_ — True if IO boost is enabled for this VM. + sig { returns(T::Boolean) } + attr_reader :io_boost? + + # _@return_ — True if network boost is enabled for this VM. + sig { returns(T::Boolean) } + attr_reader :net_boost? + + # _@return_ — True if this VM is using a prior saved state rather than a clean base image. + sig { returns(T::Boolean) } + attr_reader :use_saved_state? + + # _@return_ — The port mappings established for this VM. + sig { returns(T::Array[ProtocolPortMapping]) } + attr_reader :reserved_ports + + # _@return_ — The time when this VM was deployed. + sig { returns(DateTime) } + attr_reader :creation_time + + # _@return_ — The tag that was requested this VM be deployed to, if any. + sig { returns(T.nilable(String)) } + attr_reader :tag + + # _@return_ — Whether it was mandatory that this VM was deployed to the requested tag. + sig { returns(T::Boolean) } + attr_reader :tag_required? + end + + # A general representation of {VMConfiguration VM configurations} and the {VMInstance VMs} deployed from those + # configurations. + class VMResource < OrkaAPI::Models::LazyModel + # _@param_ `name` + # + # _@param_ `conn` + # + # _@param_ `admin` + sig { params(name: String, conn: Connection, admin: T::Boolean).returns(VMResource) } + def self.lazy_prepare(name:, conn:, admin: false); end + + # _@param_ `hash` + # + # _@param_ `conn` + # + # _@param_ `admin` + sig { params(hash: T::Hash[T.untyped, T.untyped], conn: Connection, admin: T::Boolean).returns(VMResource) } + def self.from_hash(hash, conn:, admin: false); end + + # _@param_ `conn` + # + # _@param_ `name` + # + # _@param_ `hash` + # + # _@param_ `admin` + sig do + params( + conn: Connection, + name: T.nilable(String), + hash: T.nilable(T::Hash[T.untyped, T.untyped]), + admin: T::Boolean + ).void + end + def initialize(conn:, name: nil, hash: nil, admin: false); end + + # Deploy an existing VM configuration to a node. If you don't specify a node, Orka chooses a node based on the + # available resources. + # + # This method requires the client to be configured with a token. + # + # _@param_ `node` — The node on which to deploy the VM. The node must have sufficient CPU and memory to accommodate the VM. + # + # _@param_ `replicas` — The scale at which to deploy the VM configuration. If not specified, defaults to +1+ (non-scaled). The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `reserved_ports` — One or more port mappings that forward traffic to the specified ports on the VM. The following ports and port ranges are reserved and cannot be used: +22+, +443+, +6443+, +5000-5014+, +5999-6013+, +8822-8836+. + # + # _@param_ `iso_install` — Set to +true+ if you want to use an ISO. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `iso_image` — An ISO to attach to the VM during deployment. If already set in the respective VM configuration and not set here, Orka applies the setting from the VM configuration. You can also use this field to override any ISO specified in the VM configuration. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `attach_disk` — Set to +true+ if you want to attach additional storage during deployment. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `attached_disk` — An additional storage disk to attach to the VM during deployment. If already set in the respective VM configuration and not set here, Orka applies the setting from the VM configuration. You can also use this field to override any storage specified in the VM configuration. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `vnc_console` — Enables or disables VNC for the VM. If not set in the VM configuration or here, defaults to +true+. If already set in the respective VM configuration and not set here, Orka applies the setting from the VM configuration. You can also use this field to override the VNC setting specified in the VM configuration. + # + # _@param_ `vm_metadata` — Inject custom metadata to the VM. If not set, only the built-in metadata is injected into the VM. + # + # _@param_ `system_serial` — Assign an owned macOS system serial number to the VM. If already set in the respective VM configuration and not set here, Orka applies the setting from the VM configuration. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `gpu_passthrough` — Enables or disables GPU passthrough for the VM. If not set in the VM configuration or here, defaults to +false+. If already set in the respective VM configuration and not set here, Orka applies the setting from the VM configuration. You can also use this field to override the GPU passthrough setting specified in the VM configuration. When enabled, +vnc_console+ is automatically disabled. The option is supported for VMs deployed on Intel nodes only. GPU passthrough must first be enabled in your cluster. + # + # _@param_ `tag` — When specified, the VM is preferred to be deployed to a node marked with this tag. + # + # _@param_ `tag_required` — By default, +false+. When set to +true+, the VM is required to be deployed to a node marked with this tag. + # + # _@param_ `scheduler` — Possible values are +:default+ and +:most-allocated+. By default, +:default+. When set to +:most-allocated+ the deployed VM will be scheduled to nodes having most of their resources allocated. +:default+ keeps used vs free resources balanced between the nodes. + # + # _@return_ — Details of the just-deployed VM. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # {#deployed?} and {#instances}, if the object already been loaded. You must fetch a new object instance or + # call {#refresh} to refresh this data. + sig do + params( + node: T.nilable(T.any(Node, String)), + replicas: T.nilable(Integer), + reserved_ports: T.nilable(T::Array[PortMapping]), + iso_install: T.nilable(T::Boolean), + iso_image: T.nilable(T.any(Models::ISO, String)), + attach_disk: T.nilable(T::Boolean), + attached_disk: T.nilable(T.any(Models::Image, String)), + vnc_console: T.nilable(T::Boolean), + vm_metadata: T.nilable(T::Hash[String, String]), + system_serial: T.nilable(String), + gpu_passthrough: T.nilable(T::Boolean), + tag: T.nilable(String), + tag_required: T.nilable(T::Boolean), + scheduler: T.nilable(Symbol) + ).returns(VMDeploymentResult) + end + def deploy(node: nil, replicas: nil, reserved_ports: nil, iso_install: nil, iso_image: nil, attach_disk: nil, attached_disk: nil, vnc_console: nil, vm_metadata: nil, system_serial: nil, gpu_passthrough: nil, tag: nil, tag_required: nil, scheduler: nil); end + + # Removes all VM instances. + # + # If the VM instances belongs to the user associated with the client's token then the client only needs to be + # configured with a token. Otherwise, if you are removing VM instances associated with another user, you need + # to configure the client with both a token and a license key. + # + # _@param_ `node` — If specified, only remove VM deployments on that node. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # {#deployed?} and {#instances}, if the object already been loaded. You must fetch a new object instance or + # call {#refresh} to refresh this data. + sig { params(node: T.nilable(T.any(Node, String))).void } + def delete_all_instances(node: nil); end + + # Remove all VM instances and the VM configuration. + # + # If the VM resource belongs to the user associated with the client's token then the client only needs to be + # configured with a token. Otherwise, if you are removing a VM resource associated with another user, you need + # to configure the client with both a token and a license key. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # {#deployed?} and {#instances}, if the object already been loaded. You must fetch a new object instance or + # call {#refresh} to refresh this data. + sig { void } + def purge; end + + # Power ON all VM instances on a particular node that are associated with this VM resource. + # + # This method requires the client to be configured with a token. + # + # _@param_ `node` — All deployments of this VM located on this node will be started. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # {#deployed?} and {#instances}, if the object already been loaded. You must fetch a new object instance or + # call {#refresh} to refresh this data. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { params(node: T.any(Node, String)).void } + def start_all_on_node(node); end + + # Power OFF all VM instances on a particular node that are associated with this VM resource. + # + # This method requires the client to be configured with a token. + # + # _@param_ `node` — All deployments of this VM located on this node will be stopped. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # {#deployed?} and {#instances}, if the object already been loaded. You must fetch a new object instance or + # call {#refresh} to refresh this data. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { params(node: T.any(Node, String)).void } + def stop_all_on_node(node); end + + # Suspend all VM instances on a particular node that are associated with this VM resource. + # + # This method requires the client to be configured with a token. + # + # _@param_ `node` — All deployments of this VM located on this node will be suspended. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # {#deployed?} and {#instances}, if the object already been loaded. You must fetch a new object instance or + # call {#refresh} to refresh this data. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { params(node: T.any(Node, String)).void } + def suspend_all_on_node(node); end + + # Resume all VM instances on a particular node that are associated with this VM resource. + # + # This method requires the client to be configured with a token. + # + # _@param_ `node` — All deployments of this VM located on this node will be resumed. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # {#deployed?} and {#instances}, if the object already been loaded. You must fetch a new object instance or + # call {#refresh} to refresh this data. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { params(node: T.any(Node, String)).void } + def resume_all_on_node(node); end + + # Revert all VM instances on a particular node that are associated with this VM resource to the latest state of + # its base image. This operation restarts the VMs. + # + # This method requires the client to be configured with a token. + # + # _@param_ `node` — All deployments of this VM located on this node will be reverted. + # + # _@note_ — Calling this will not change the state of this object, and thus not change the return values of + # {#deployed?} and {#instances}, if the object already been loaded. You must fetch a new object instance or + # call {#refresh} to refresh this data. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { params(node: T.any(Node, String)).void } + def revert_all_on_node(node); end + + # _@return_ — The name of this VM resource. + sig { returns(String) } + attr_reader :name + + # _@return_ — True if there are associated deployed VM instances. + sig { returns(T::Boolean) } + attr_reader :deployed? + + # _@return_ — The list of deployed VM instances. + sig { returns(T::Array[VMInstance]) } + attr_reader :instances + + # _@return_ — The owner of the associated VM configuration. This is +nil+ if {#deployed?} is +true+. + sig { returns(T.nilable(User)) } + attr_reader :owner + + # _@return_ — The number of CPU cores to use, specified by the associated VM configuration. This is + # +nil+ if {#deployed?} is +true+. + sig { returns(T.nilable(Integer)) } + attr_reader :cpu_cores + + # _@return_ — The number of vCPUs to use, specified by the associated VM configuration. This is + # +nil+ if {#deployed?} is +true+. + sig { returns(T.nilable(Integer)) } + attr_reader :vcpu_count + + # _@return_ — The base image to use, specified by the associated VM configuration. This is +nil+ if + # {#deployed?} is +true+. + sig { returns(T.nilable(Image)) } + attr_reader :base_image + + # _@return_ — The matching VM configuration object. This is +nil+ if {#deployed?} is +true+. + sig { returns(T.nilable(VMConfiguration)) } + attr_reader :config + + # _@return_ — True if IO boost is enabled, specified by the associated VM configuration. This is + # +nil+ if {#deployed?} is +true+. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :io_boost? + + # _@return_ — True if network boost is enabled, specified by the associated VM configuration. This is + # +nil+ if {#deployed?} is +true+. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :net_boost? + + # _@return_ — True if the saved state should be used rather than cleanly from the base image, + # specified by the associated VM configuration. This is +nil+ if {#deployed?} is +true+. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :use_saved_state? + + # _@return_ — True if GPU passthrough is enabled, specified by the associated VM configuration. This + # is +nil+ if {#deployed?} is +true+. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :gpu_passthrough? + + sig { returns(T.nilable(String)) } + attr_reader :configuration_template + + # _@return_ — The amount of RAM assigned for this VM, if it has been manually configured in advance of + # deployment. This is always +nil+ if {#deployed?} is +true+. + sig { returns(T.nilable(String)) } + attr_reader :ram + end + + # An account used for Kubernetes operations. + class KubeAccount + # _@param_ `name` + # + # _@param_ `email` + # + # _@param_ `kubeconfig` + # + # _@param_ `conn` + sig do + params( + name: String, + conn: Connection, + email: T.nilable(String), + kubeconfig: T.nilable(String) + ).void + end + def initialize(name, conn:, email: nil, kubeconfig: nil); end + + # Regenerate this kube-account. + # + # This method requires the client to be configured with both a token and a license key. + sig { void } + def regenerate; end + + # Retrieve the +kubeconfig+ for this kube-account. + # + # This method is cached. Subsequent calls to this method will not invoke additional network requests. The + # methods {#regenerate} and {Client#create_kube_account} also fill this cache. + # + # This method requires the client to be configured with both a token and a license key. + sig { void } + def kubeconfig; end + + # _@return_ — The name of this kube-account. + sig { returns(String) } + attr_reader :name + end + + # Represents an image which exists in the Orka remote repo rather than local storage. + class RemoteImage + # _@param_ `name` + # + # _@param_ `conn` + sig { params(name: String, conn: Connection).void } + def initialize(name, conn:); end + + # Pull this image from the remote repo. This is a long-running operation and might take a while. + # + # The operation copies the image to the local storage of your Orka environment. The base image will be + # available for use by all users of the environment. + # + # This method requires the client to be configured with a token. + # + # _@param_ `new_name` — The name for the local copy of this image. + # + # _@return_ — The lazily-loaded local image. + sig { params(new_name: String).returns(Image) } + def pull(new_name); end + + # _@return_ — The name of this remote image. + sig { returns(String) } + attr_reader :name + end + + # A template configuration (a container template) consisting of a + # {https://orkadocs.macstadium.com/docs/orka-glossary#base-image base image}, a + # {https://orkadocs.macstadium.com/docs/orka-glossary#snapshot-image snapshot image}, and the number of CPU cores + # to be used. To become a VM that you can run in the cloud, a VM configuration needs to be deployed to a {Node + # node}. + # + # You can deploy multiple VMs from a single VM configuration. Once created, you can no longer modify a VM + # configuration. + # + # Deleting a VM does not delete the VM configuration it was deployed from. + class VMConfiguration < OrkaAPI::Models::LazyModel + # _@param_ `name` + # + # _@param_ `conn` + sig { params(name: String, conn: Connection).returns(VMConfiguration) } + def self.lazy_prepare(name:, conn:); end + + # _@param_ `hash` + # + # _@param_ `conn` + sig { params(hash: T::Hash[T.untyped, T.untyped], conn: Connection).returns(VMConfiguration) } + def self.from_hash(hash, conn:); end + + # _@param_ `conn` + # + # _@param_ `name` + # + # _@param_ `hash` + sig { params(conn: Connection, name: T.nilable(String), hash: T.nilable(T::Hash[T.untyped, T.untyped])).void } + def initialize(conn:, name: nil, hash: nil); end + + # Deploy the VM configuration to a node. If you don't specify a node, Orka chooses a node based on the + # available resources. + # + # This method requires the client to be configured with a token. + # + # _@param_ `node` — The node on which to deploy the VM. The node must have sufficient CPU and memory to accommodate the VM. + # + # _@param_ `replicas` — The scale at which to deploy the VM configuration. If not specified, defaults to +1+ (non-scaled). The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `reserved_ports` — One or more port mappings that forward traffic to the specified ports on the VM. The following ports and port ranges are reserved and cannot be used: +22+, +443+, +6443+, +5000-5014+, +5999-6013+, +8822-8836+. + # + # _@param_ `iso_install` — Set to +true+ if you want to use an ISO. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `iso_image` — An ISO to attach to the VM during deployment. If already set in the respective VM configuration and not set here, Orka applies the setting from the VM configuration. You can also use this field to override any ISO specified in the VM configuration. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `attach_disk` — Set to +true+ if you want to attach additional storage during deployment. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `attached_disk` — An additional storage disk to attach to the VM during deployment. If already set in the respective VM configuration and not set here, Orka applies the setting from the VM configuration. You can also use this field to override any storage specified in the VM configuration. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `vnc_console` — Enables or disables VNC for the VM. If not set in the VM configuration or here, defaults to +true+. If already set in the respective VM configuration and not set here, Orka applies the setting from the VM configuration. You can also use this field to override the VNC setting specified in the VM configuration. + # + # _@param_ `vm_metadata` — Inject custom metadata to the VM. If not set, only the built-in metadata is injected into the VM. + # + # _@param_ `system_serial` — Assign an owned macOS system serial number to the VM. If already set in the respective VM configuration and not set here, Orka applies the setting from the VM configuration. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `gpu_passthrough` — Enables or disables GPU passthrough for the VM. If not set in the VM configuration or here, defaults to +false+. If already set in the respective VM configuration and not set here, Orka applies the setting from the VM configuration. You can also use this field to override the GPU passthrough setting specified in the VM configuration. When enabled, +vnc_console+ is automatically disabled. The option is supported for VMs deployed on Intel nodes only. GPU passthrough must first be enabled in your cluster. + # + # _@param_ `tag` — When specified, the VM is preferred to be deployed to a node marked with this tag. + # + # _@param_ `tag_required` — By default, +false+. When set to +true+, the VM is required to be deployed to a node marked with this tag. + # + # _@param_ `scheduler` — Possible values are +:default+ and +:most-allocated+. By default, +:default+. When set to +:most-allocated+ the deployed VM will be scheduled to nodes having most of their resources allocated. +:default+ keeps used vs free resources balanced between the nodes. + # + # _@return_ — Details of the just-deployed VM. + sig do + params( + node: T.nilable(T.any(Node, String)), + replicas: T.nilable(Integer), + reserved_ports: T.nilable(T::Array[PortMapping]), + iso_install: T.nilable(T::Boolean), + iso_image: T.nilable(T.any(Models::ISO, String)), + attach_disk: T.nilable(T::Boolean), + attached_disk: T.nilable(T.any(Models::Image, String)), + vnc_console: T.nilable(T::Boolean), + vm_metadata: T.nilable(T::Hash[String, String]), + system_serial: T.nilable(String), + gpu_passthrough: T.nilable(T::Boolean), + tag: T.nilable(String), + tag_required: T.nilable(T::Boolean), + scheduler: T.nilable(Symbol) + ).returns(VMDeploymentResult) + end + def deploy(node: nil, replicas: nil, reserved_ports: nil, iso_install: nil, iso_image: nil, attach_disk: nil, attached_disk: nil, vnc_console: nil, vm_metadata: nil, system_serial: nil, gpu_passthrough: nil, tag: nil, tag_required: nil, scheduler: nil); end + + # Remove the VM configuration and all VM deployments of it. + # + # If the VM configuration and its deployments belong to the user associated with the client's token then the + # client only needs to be configured with a token. Otherwise, if you are removing a VM resource associated with + # another user, you need to configure the client with both a token and a license key. + sig { void } + def purge; end + + # Delete the VM configuration state. Now when you deploy the VM configuration it will use the base image to + # boot the VM. + # + # To delete a VM state, it must not be used by any deployed VM. + # + # This method requires the client to be configured with a token. + # + # _@note_ — This request is supported for VMs deployed on Intel nodes only. + sig { void } + def delete_saved_state; end + + # _@return_ — The name of this VM configuration. + sig { returns(String) } + attr_reader :name + + # _@return_ — The owner of this VM configuration, i.e. the user which deployed it. + sig { returns(User) } + attr_reader :owner + + # _@return_ — The base image which newly deployed VMs of this configuration will boot from. + sig { returns(Image) } + attr_reader :base_image + + # _@return_ — The number of CPU cores to allocate to deployed VMs of this configuration. + sig { returns(Integer) } + attr_reader :cpu_cores + + # _@return_ — The number of VCPUs to allocate to deployed VMs of this configuration. + sig { returns(Integer) } + attr_reader :vcpu_count + + # _@return_ — The ISO to attach to deployed VMs of this configuration. + sig { returns(ISO) } + attr_reader :iso_image + + # _@return_ — The storage disk image to attach to deployed VMs of this configuration. + sig { returns(Image) } + attr_reader :attached_disk + + # _@return_ — True if the VNC console should be enabled for deployed VMs of this configuration. + sig { returns(T::Boolean) } + attr_reader :vnc_console? + + # _@return_ — True if IO boost should be enabled for deployed VMs of this configuration. + sig { returns(T::Boolean) } + attr_reader :io_boost? + + # _@return_ — True if network boost should be enabled for deployed VMs of this configuration. + sig { returns(T::Boolean) } + attr_reader :net_boost? + + # _@return_ — True if deployed VMs of this configuration should use a prior saved state (created via + # {VMInstance#save_state}) rather than a clean base image. + sig { returns(T::Boolean) } + attr_reader :use_saved_state? + + # _@return_ — True if GPU passthrough should be enabled for deployed VMs of this configuration. + sig { returns(T::Boolean) } + attr_reader :gpu_passthrough? + + # _@return_ — The custom system serial number, if set. + sig { returns(T.nilable(String)) } + attr_reader :system_serial + + # _@return_ — The tag that VMs of this configuration should be deployed to, if any. + sig { returns(T.nilable(String)) } + attr_reader :tag + + # _@return_ — Whether it is mandatory that VMs are deployed to the requested tag. + sig { returns(T::Boolean) } + attr_reader :tag_required? + + # _@return_ — The scheduler mode chosen for VM deployment. Can be either +:default+ or +:most_allocated+. + sig { returns(Symbol) } + attr_reader :scheduler + + # _@return_ — The amount of RAM this VM is assigned to take, in gigabytes. If not set, Orka will + # automatically select a value when deploying. + sig { returns(T.nilable(Numeric)) } + attr_reader :memory + end + + # Provides information on the just-deployed VM. + class VMDeploymentResult + extend OrkaAPI::Models::AttrPredicate + + # _@param_ `hash` + # + # _@param_ `conn` + # + # _@param_ `admin` + sig { params(hash: T::Hash[T.untyped, T.untyped], conn: Connection, admin: T::Boolean).void } + def initialize(hash, conn:, admin: false); end + + # _@return_ — The amount of RAM allocated to the VM. + sig { returns(String) } + attr_reader :ram + + # _@return_ — The number of vCPUs allocated to the VM. + sig { returns(Integer) } + attr_reader :vcpu_count + + # _@return_ — The number of host CPU cores allocated to the VM. + sig { returns(Integer) } + attr_reader :cpu_cores + + # _@return_ — The IP of the VM. + sig { returns(String) } + attr_reader :ip + + # _@return_ — The port used to connect to the VM via SSH. + sig { returns(Integer) } + attr_reader :ssh_port + + # _@return_ — The port used to connect to the VM via macOS Screen Sharing. + sig { returns(Integer) } + attr_reader :screen_sharing_port + + # _@return_ — The VM resource object representing this VM. + sig { returns(VMResource) } + attr_reader :resource + + # _@return_ — True if network boost is enabled for this VM. + sig { returns(T::Boolean) } + attr_reader :io_boost? + + # _@return_ — True if this VM is using a prior saved state rather than a clean base image. + sig { returns(T::Boolean) } + attr_reader :use_saved_state? + + # _@return_ — True if GPU passthrough is enabled for this VM. + sig { returns(T::Boolean) } + attr_reader :gpu_passthrough? + + # _@return_ — The port used to connect to the VM via VNC, if enabled. + sig { returns(T.nilable(Integer)) } + attr_reader :vnc_port + end + + # The requirements enforced for passwords when creating a user account. + class PasswordRequirements + # _@param_ `hash` + sig { params(hash: T::Hash[T.untyped, T.untyped]).void } + def initialize(hash); end + + # _@return_ — The minimum length of a password. + sig { returns(Integer) } + attr_reader :length + end + + # Represents a port forwarding from a host node to a guest VM, with an additional field denoting the transport + # protocol. + class ProtocolPortMapping < OrkaAPI::PortMapping + # _@param_ `host_port` + # + # _@param_ `guest_port` + # + # _@param_ `protocol` + sig { params(host_port: Integer, guest_port: Integer, protocol: String).void } + def initialize(host_port:, guest_port:, protocol:); end + + # _@return_ — The transport protocol, typically TCP. + sig { returns(String) } + attr_reader :protocol + end + end + + # This is the entrypoint class for all interactions with the Orka API. + class Client + VERSION = T.let("0.2.1", T.untyped) + API_VERSION = T.let("2.4.0", T.untyped) + + # Creates an instance of the client for a given Orka service endpoint and associated credentials. + # + # _@param_ `base_url` — The API URL for the Orka service endpoint. + # + # _@param_ `token` — The token used for authentication. This can be generated with {#create_token} from an credentialless client. + # + # _@param_ `license_key` — The Orka license key used for authentication in administrative operations. + sig { params(base_url: String, token: T.nilable(String), license_key: T.nilable(String)).void } + def initialize(base_url, token: nil, license_key: nil); end + + # Retrieve a list of the users in the Orka environment. + # + # This method requires the client to be configured with a license key. + # The network operation is not performed immediately upon return of this method. The request is performed when + # any action is performed on the enumerator, or otherwise forced via {Models::Enumerator#eager}. + # + # _@return_ — The enumerator of the user list. + sig { returns(Models::Enumerator[Models::User]) } + def users; end + + # Fetches information on a particular user in the Orka environment. + # + # This method requires the client to be configured with a license key. + # The network operation is not performed immediately upon return of this method. The request is performed when + # any attribute is accessed or any method is called on the returned object, or otherwise forced via + # {Models::LazyModel#eager}. Successful return from this method does not guarantee the requested resource + # exists. + # + # _@param_ `email` — The email of the user to fetch. + # + # _@return_ — The lazily-loaded user object. + sig { params(email: String).returns(Models::User) } + def user(email); end + + # Create a new user in the Orka environment. You need to specify email address and password. You cannot pass an + # email address that's already in use. + # + # This method requires the client to be configured with a license key. + # + # _@param_ `email` — An email address for the user. This also serves as the username. + # + # _@param_ `password` — A password for the user. Must be at least 6 characters long. + # + # _@param_ `group` — A user group for the user. Once set, you can no longer change the user group. + # + # _@return_ — The user object. + sig { params(email: String, password: String, group: T.nilable(String)).returns(Models::User) } + def create_user(email:, password:, group: nil); end + + # Modify the email address or password of the current user. This operation is intended for regular Orka users. + # + # This method requires the client to be configured with a token. + # + # _@param_ `email` — The new email address for the user. + # + # _@param_ `password` — The new password for the user. + sig { params(email: T.nilable(String), password: T.nilable(String)).void } + def update_user_credentials(email: nil, password: nil); end + + # Create an authentication token using an existing user's email and password. + # + # This method does not require the client to be configured with any credentials. + # + # _@param_ `user` — The user or their associated email address. + # + # _@param_ `password` — The user's password. + # + # _@return_ — The authentication token. + sig { params(user: T.any(Models::User, String), password: String).returns(String) } + def create_token(user:, password:); end + + # Revoke the token associated with this client instance. + # + # This method requires the client to be configured with a token. + sig { void } + def revoke_token; end + + # Retrieve a list of the VMs and VM configurations. By default this fetches resources associated with the + # client's token, but you can optionally request a list of resources for another user (or all users). + # + # If you filter by a user, or request all users, this method requires the client to be configured with both a + # token and a license key. Otherwise, it only requires a token. + # + # The network operation is not performed immediately upon return of this method. The request is performed when + # any action is performed on the enumerator, or otherwise forced via {Models::Enumerator#eager}. + # + # _@param_ `user` — The user, or their associated email address, to use instead of the one associated with the client's token. Pass "all" if you wish to fetch for all users. + # + # _@return_ — The enumerator of the VM resource list. + sig { params(user: T.nilable(T.any(Models::User, String))).returns(Models::Enumerator[Models::VMResource]) } + def vm_resources(user: nil); end + + # Fetches information on a particular VM or VM configuration. + # + # If you set the admin parameter to true, this method requires the client to be configured with both a + # token and a license key. Otherwise, it only requires a token. + # + # The network operation is not performed immediately upon return of this method. The request is performed when + # any attribute is accessed or any method is called on the returned object, or otherwise forced via + # {Models::LazyModel#eager}. Successful return from this method does not guarantee the requested resource + # exists. + # + # _@param_ `name` — The name of the VM resource to fetch. + # + # _@param_ `admin` — Set to true to allow VM resources associated with other users to be queried. + # + # _@return_ — The lazily-loaded VM resource object. + sig { params(name: String, admin: T::Boolean).returns(Models::VMResource) } + def vm_resource(name, admin: false); end + + # Retrieve a list of the VM configurations associated with the client's token. Orka returns information about the + # base image, CPU cores, owner and name of the VM configurations. + # + # This method requires the client to be configured with a token. + # The network operation is not performed immediately upon return of this method. The request is performed when + # any action is performed on the enumerator, or otherwise forced via {Models::Enumerator#eager}. + # + # _@return_ — The enumerator of the VM configuration list. + sig { returns(Models::Enumerator[Models::VMConfiguration]) } + def vm_configurations; end + + # Fetches information on a particular VM configuration. + # + # This method requires the client to be configured with a token. + # The network operation is not performed immediately upon return of this method. The request is performed when + # any attribute is accessed or any method is called on the returned object, or otherwise forced via + # {Models::LazyModel#eager}. Successful return from this method does not guarantee the requested resource + # exists. + # + # _@param_ `name` — The name of the VM configuration to fetch. + # + # _@return_ — The lazily-loaded VM configuration. + sig { params(name: String).returns(Models::VMConfiguration) } + def vm_configuration(name); end + + # Create a VM configuration that is ready for deployment. In Orka, VM configurations are container templates. + # You can deploy multiple VMs from a single VM configuration. You cannot modify VM configurations. + # + # This method requires the client to be configured with a token. + # + # _@param_ `name` — The name of the VM configuration. This string must consist of lowercase Latin alphanumeric characters or the dash (+-+). This string must begin and end with an alphanumeric character. This string must not exceed 38 characters. + # + # _@param_ `base_image` — The name of the base image that you want to use with the configuration. If you want to attach an ISO to the VM configuration from which to install macOS, make sure that the base image is an empty disk of a sufficient size. + # + # _@param_ `snapshot_image` — A name for the {https://orkadocs.macstadium.com/docs/orka-glossary#section-snapshot-image snapshot image} of the VM. Typically, the same value as +name+. + # + # _@param_ `cpu_cores` — The number of CPU cores to dedicate for the VM. Must be 3, 4, 6, 8, 12, or 24. + # + # _@param_ `vcpu_count` — The number of vCPUs for the VM. Must equal the number of CPUs, when CPU is less than or equal to 3. Otherwise, must equal half of or exactly the number of CPUs specified. + # + # _@param_ `iso_image` — An ISO to attach to the VM on deployment. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `attached_disk` — An additional storage disk to attach to the VM on deployment. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `vnc_console` — By default, +true+. Enables or disables VNC for the VM configuration. You can override on deployment of specific VMs. + # + # _@param_ `system_serial` — Assign an owned macOS system serial number to the VM configuration. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `io_boost` — By default, +false+ for VM configurations created before Orka 1.5. Default value for VM configurations created with Orka 1.5 or later depends on the cluster default. Enables or disables IO performance improvements for the VM configuration. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `net_boost` — By default, +false+ for VM configurations created before Orka 2.3.0. Default value for VM configurations created with Orka 2.3.0 or later depends on the cluster default. Enables or disables network performance improvements for the VM configuration. The option is supported for VMs deployed on Intel nodes only. + # + # _@param_ `gpu_passthrough` — Enables or disables GPU passthrough for the VM. When enabled, +vnc_console+ is automatically disabled. The option is supported for VMs deployed on Intel nodes only. GPU passthrough must first be enabled in your cluster. + # + # _@param_ `tag` — When specified, the VM is preferred to be deployed to a node marked with this tag. + # + # _@param_ `tag_required` — By default, +false+. When set to +true+, the VM is required to be deployed to a node marked with this tag. + # + # _@param_ `scheduler` — Possible values are +:default+ and +:most-allocated+. By default, +:default+. When set to +:most-allocated+ VMs deployed from the VM configuration will be scheduled to nodes having most of their resources allocated. +:default+ keeps used vs free resources balanced between the nodes. + # + # _@param_ `memory` + # + # _@return_ — The lazily-loaded VM configuration. + sig do + params( + name: String, + base_image: T.any(Models::Image, String), + snapshot_image: T.any(Models::Image, String), + cpu_cores: Integer, + vcpu_count: Integer, + iso_image: T.nilable(T.any(Models::ISO, String)), + attached_disk: T.nilable(T.any(Models::Image, String)), + vnc_console: T.nilable(T::Boolean), + system_serial: T.nilable(String), + io_boost: T.nilable(T::Boolean), + net_boost: T.nilable(T::Boolean), + gpu_passthrough: T.nilable(T::Boolean), + tag: T.nilable(String), + tag_required: T.nilable(T::Boolean), + scheduler: T.nilable(Symbol), + memory: T.nilable(Numeric) + ).returns(Models::VMConfiguration) + end + def create_vm_configuration(name, base_image:, snapshot_image:, cpu_cores:, vcpu_count:, iso_image: nil, attached_disk: nil, vnc_console: nil, system_serial: nil, io_boost: nil, net_boost: nil, gpu_passthrough: nil, tag: nil, tag_required: nil, scheduler: nil, memory: nil); end + + # Retrieve a list of the nodes in your Orka environment. Orka returns a list of nodes with IP and resource + # information. + # + # If you set the admin parameter to true, this method requires the client to be configured with both a + # token and a license key. Otherwise, it only requires a token. + # + # The network operation is not performed immediately upon return of this method. The request is performed when + # any action is performed on the enumerator, or otherwise forced via {Models::Enumerator#eager}. + # + # _@param_ `admin` — Set to true to allow nodes dedicated to other users to be queried. + # + # _@return_ — The enumerator of the node list. + sig { params(admin: T::Boolean).returns(Models::Enumerator[Models::Node]) } + def nodes(admin: false); end + + # Fetches information on a particular node. + # + # If you set the admin parameter to true, this method requires the client to be configured with both a + # token and a license key. Otherwise, it only requires a token. + # + # The network operation is not performed immediately upon return of this method. The request is performed when + # any attribute is accessed or any method is called on the returned object, or otherwise forced via + # {Models::LazyModel#eager}. Successful return from this method does not guarantee the requested resource + # exists. + # + # _@param_ `name` — The name of the node to fetch. + # + # _@param_ `admin` — Set to true to allow nodes dedicated with other users to be queried. + # + # _@return_ — The lazily-loaded node object. + sig { params(name: String, admin: T::Boolean).returns(Models::VMResource) } + def node(name, admin: false); end + + # Retrieve a list of the base images and empty disks in your Orka environment. + # + # This method requires the client to be configured with a token. + # The network operation is not performed immediately upon return of this method. The request is performed when + # any action is performed on the enumerator, or otherwise forced via {Models::Enumerator#eager}. + # + # _@return_ — The enumerator of the image list. + sig { returns(Models::Enumerator[Models::Image]) } + def images; end + + # Fetches information on a particular image. + # + # This method requires the client to be configured with a token. + # The network operation is not performed immediately upon return of this method. The request is performed when + # any attribute is accessed or any method is called on the returned object, or otherwise forced via + # {Models::LazyModel#eager}. Successful return from this method does not guarantee the requested resource + # exists. + # + # _@param_ `name` — The name of the image to fetch. + # + # _@return_ — The lazily-loaded image. + sig { params(name: String).returns(Models::Image) } + def image(name); end + + # List the base images available in the Orka remote repo. + # + # To use one of the images from the remote repo, you can {Models::RemoteImage#pull pull} it into the local Orka + # storage. + # + # This method requires the client to be configured with a token. + # The network operation is not performed immediately upon return of this method. The request is performed when + # any action is performed on the enumerator, or otherwise forced via {Models::Enumerator#eager}. + # + # _@return_ — The enumerator of the remote image list. + sig { returns(Models::Enumerator[Models::RemoteImage]) } + def remote_images; end + + # Returns an object representing a remote image of a specified name. + # + # Note that this method does not perform any network requests and does not verify if the name supplied actually + # exists in the Orka remote repo. + # + # _@param_ `name` — The name of the remote image. + # + # _@return_ — The remote image object. + sig { params(name: String).returns(Models::RemoteImage) } + def remote_image(name); end + + # Generate an empty base image. You can use it to create VM configurations that will use an ISO or you can attach + # it to a deployed VM to extend its storage. + # + # This method requires the client to be configured with a token. + # + # _@param_ `name` — The name of this new image. + # + # _@param_ `size` — The size of this new image (in K, M, G, or T), for example +"10G"+. + # + # _@return_ — The new lazily-loaded image. + # + # _@note_ — This request is supported for Intel images only. Intel images have +.img+ extension. + sig { params(name: String, size: String).returns(Models::Image) } + def generate_empty_image(name, size:); end + + # Upload an image to the Orka environment. + # + # This method requires the client to be configured with a token. + # + # _@param_ `file` — The string file path or an open IO object to the image to upload. + # + # _@param_ `name` — The name to give to this image. Defaults to the local filename. + # + # _@return_ — The new lazily-loaded image. + # + # _@note_ — This request is supported for Intel images only. Intel images have +.img+ extension. + sig { params(file: T.any(String, IO), name: T.nilable(String)).returns(Models::Image) } + def upload_image(file, name: nil); end + + # Retrieve a list of the ISOs available in the local Orka storage. + # + # This method requires the client to be configured with a token. + # The network operation is not performed immediately upon return of this method. The request is performed when + # any action is performed on the enumerator, or otherwise forced via {Models::Enumerator#eager}. + # + # _@return_ — The enumerator of the ISO list. + # + # _@note_ — All ISO requests are supported for Intel nodes only. + sig { returns(Models::Enumerator[Models::ISO]) } + def isos; end + + # Fetches information on a particular ISO in local Orka storage. + # + # This method requires the client to be configured with a token. + # The network operation is not performed immediately upon return of this method. The request is performed when + # any attribute is accessed or any method is called on the returned object, or otherwise forced via + # {Models::LazyModel#eager}. Successful return from this method does not guarantee the requested resource + # exists. + # + # _@param_ `name` — The name of the ISO to fetch. + # + # _@return_ — The lazily-loaded ISO. + # + # _@note_ — All ISO requests are supported for Intel nodes only. + sig { params(name: String).returns(Models::ISO) } + def iso(name); end + + # List the ISOs available in the Orka remote repo. + # + # To use one of the ISOs from the remote repo, you can {Models::RemoteISO#pull pull} it into the local Orka + # storage. + # + # This method requires the client to be configured with a token. + # The network operation is not performed immediately upon return of this method. The request is performed when + # any action is performed on the enumerator, or otherwise forced via {Models::Enumerator#eager}. + # + # _@return_ — The enumerator of the remote ISO list. + # + # _@note_ — All ISO requests are supported for Intel nodes only. + sig { returns(Models::Enumerator[Models::RemoteISO]) } + def remote_isos; end + + # Returns an object representing a remote ISO of a specified name. + # + # Note that this method does not perform any network requests and does not verify if the name supplied actually + # exists in the Orka remote repo. + # + # _@param_ `name` — The name of the remote ISO. + # + # _@return_ — The remote ISO object. + # + # _@note_ — All ISO requests are supported for Intel nodes only. + sig { params(name: String).returns(Models::RemoteISO) } + def remote_iso(name); end + + # Upload an ISO to the Orka environment. + # + # This method requires the client to be configured with a token. + # + # _@param_ `file` — The string file path or an open IO object to the ISO to upload. + # + # _@param_ `name` — The name to give to this ISO. Defaults to the local filename. + # + # _@return_ — The new lazily-loaded ISO. + # + # _@note_ — All ISO requests are supported for Intel nodes only. + sig { params(file: T.any(String, IO), name: T.nilable(String)).returns(Models::ISO) } + def upload_iso(file, name: nil); end + + # Retrieve a list of kube-accounts associated with an Orka user. + # + # This method requires the client to be configured with both a token and a license key. + # The network operation is not performed immediately upon return of this method. The request is performed when + # any action is performed on the enumerator, or otherwise forced via {Models::Enumerator#eager}. + # + # _@param_ `user` — The user, which can be specified by the user object or their email address, for which we are returning the associated kube-accounts of. Defaults to the user associated with the client's token. + # + # _@return_ — The enumerator of the kube-account list. + sig { params(user: T.nilable(T.any(Models::User, String))).returns(Models::Enumerator[Models::KubeAccount]) } + def kube_accounts(user: nil); end + + # Returns an object representing a kube-account of a particular user. + # + # Note that this method does not perform any network requests and does not verify if the name supplied actually + # exists in the Orka environment. + # + # _@param_ `name` — The name of the kube-account. + # + # _@param_ `user` — The user, which can be specified by the user object or their email address, of which the kube-account is associated with. Defaults to the user associated with the client's token. + # + # _@return_ — The kube-account object. + sig { params(name: String, user: T.nilable(T.any(Models::User, String))).returns(Models::KubeAccount) } + def kube_account(name, user: nil); end + + # Create a kube-account. + # + # This method requires the client to be configured with both a token and a license key. + # + # _@param_ `name` — The name of the kube-account. + # + # _@param_ `user` — The user, which can be specified by the user object or their email address, of which the kube-account will be associated with. Defaults to the user associated with the client's token. + # + # _@return_ — The created kube-account. + sig { params(name: String, user: T.nilable(T.any(Models::User, String))).returns(Models::KubeAccount) } + def create_kube_account(name, user: nil); end + + # Delete all kube-accounts associated with a user. + # + # This method requires the client to be configured with both a token and a license key. + # + # _@param_ `user` — The user, which can be specified by the user object or their email address, which will have their associated kube-account deleted. Defaults to the user associated with the client's token. + sig { params(user: T.nilable(T.any(Models::User, String))).void } + def delete_all_kube_accounts(user: nil); end + + # Retrieve a log of all CLI commands and API requests executed against your Orka environment. + # + # This method requires the client to be configured with a license key. + # + # _@param_ `limit` — Limit the amount of results returned to this quantity. + # + # _@param_ `start` — Limit the results to be log entries after this date. + # + # _@param_ `query` — The LogQL query to filter by. Defaults to +{log_type="user_logs"}+. + # + # _@return_ — A raw Grafana Loki query result payload. Parsing this is out-of-scope for this gem. + sig { params(limit: T.nilable(Integer), start: T.nilable(DateTime), query: T.nilable(String)).returns(T::Hash[T.untyped, T.untyped]) } + def logs(limit: nil, start: nil, query: nil); end + + # Retrieve information about the token associated with the client. The request returns information about the + # associated email address, the authentication status of the token, and if the token is revoked. + # + # This method requires the client to be configured with a token. + # + # _@return_ — Information about the token. + sig { returns(Models::TokenInfo) } + def token_info; end + + # Retrieve detailed information about the health of your Orka environment. + # + # This method does not require the client to be configured with any credentials. + # + # _@return_ — The status information on different components of your environment. + sig { returns(T::Hash[T.untyped, T.untyped]) } + def environment_status; end + + # Retrieve the current API version of your Orka environment. + # + # This method does not require the client to be configured with any credentials. + # + # _@return_ — The remote API version. + sig { returns(String) } + def remote_api_version; end + + # Retrieve the current version of the components in your Orka environment. + # + # This method does not require the client to be configured with any credentials. + # + # _@return_ — The version of each component. + sig { returns(T::Hash[String, String]) } + def environment_component_versions; end + + # Retrieve the current password requirements for creating an Orka user. + # + # This method does not require the client to be configured with any credentials. + # + # _@return_ — The password requirements. + sig { returns(Models::PasswordRequirements) } + def password_requirements; end + + # Check if a license key is authorized or not. + # + # This method does not require the client to be configured with any credentials. + # + # _@param_ `license_key` — The license key to check. Defaults to the one associated with the client. + # + # _@return_ — True if the license key is valid. + sig { params(license_key: String).returns(T::Boolean) } + def license_key_valid?(license_key = @license_key); end + + # Retrieve the default base image for the Orka environment. + # + # This method does not require the client to be configured with any credentials. + # + # _@return_ — The lazily-loaded default base image object. + sig { returns(Models::Image) } + def default_base_image; end + + # Upload a custom TLS certificate and its private key in PEM format from your computer to your cluster. You can + # then access Orka via {https://orkadocs.macstadium.com/docs/custom-tls-certificate external custom domain}. + # + # The certificate and the key must meet the following requirements: + # + # * Both files are in PEM format. + # * The private key is not passphrase protected. + # * The certificate might be any of the following: + # * A single domain certificate (e.g. +company.com+). + # * Multi-domain certificate (e.g. +app1.company.com+, +app2.company.com+, and so on). + # * Wildcard TLS certificate (e.g. +*.company.com+). If containing an asterisk, it must be a single asterisk + # and must be in the leftmost position of the domain name. For example: You cannot use a +*.*.company.com+ + # certificate to work with Orka. + # * A certificate chain (bundle) that contains your server, intermediates, and root certificates concatenated + # (in the proper order) into one file. + # * The certificate must be a domain certificate issued by a certificate authority for a registered domain OR a + # self-signed certificate for any domain + # ({https://orkadocs.macstadium.com/docs/custom-tls-certificate#32-create-a-local-mapping for local use only}). + # + # This method requires the client to be configured with both a token and a license key. + # + # _@param_ `cert` — The string file path or an open IO object to the certificate. + # + # _@param_ `key` — The string file path or an open IO object to the key. + sig { params(cert: T.any(String, IO), key: T.any(String, IO)).void } + def upload_tls_certificate(cert, key); end + end + + # Base error class. + class Error < StandardError + end + + # This error is thrown if an endpoint requests an auth mechanism which we do not have credentials for. + class AuthConfigurationError < OrkaAPI::Error + end + + # This error is thrown if a specific resource is requested but it was not found in the Orka backend. + class ResourceNotFoundError < OrkaAPI::Error + end + + # This error is thrown if the client receives data from the server it does not recognise. This is typically + # indicative of a bug or a feature not yet implemented. + class UnrecognisedStateError < OrkaAPI::Error + end + + # @api private + class Connection < Faraday::Connection + # _@param_ `base_url` + # + # _@param_ `token` + # + # _@param_ `license_key` + sig { params(base_url: String, token: T.nilable(String), license_key: T.nilable(String)).void } + def initialize(base_url, token: nil, license_key: nil); end + end + + # Represents a port forwarding from a host node to a guest VM. + class PortMapping + # _@param_ `host_port` — The port on the node side. + # + # _@param_ `guest_port` — The port on the VM side. + sig { params(host_port: Integer, guest_port: Integer).void } + def initialize(host_port:, guest_port:); end + + # _@return_ — The port on the node side. + sig { returns(Integer) } + attr_reader :host_port + + # _@return_ — The port on the VM side. + sig { returns(Integer) } + attr_reader :guest_port + end +end diff --git a/sorbet/rbi/shims/http.rbi b/sorbet/rbi/shims/http.rbi new file mode 100644 index 0000000..1e9a6fd --- /dev/null +++ b/sorbet/rbi/shims/http.rbi @@ -0,0 +1,10 @@ + +# typed: strong + +# https://github.com/sorbet/sorbet/pull/8153 +class Net::HTTP + sig { params(uri_or_host: URI::Generic).returns(T.nilable(String)) } + sig { params(uri_or_host: URI::Generic, path_or_header: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(T.nilable(String)) } + sig { params(uri_or_host: String, path_or_header: String, port: T.nilable(Integer)).returns(T.nilable(String)) } + def self.get(uri_or_host, path_or_header, port=nil); end +end diff --git a/sorbet/rbi/shims/json.rbi b/sorbet/rbi/shims/json.rbi new file mode 100644 index 0000000..b6d0784 --- /dev/null +++ b/sorbet/rbi/shims/json.rbi @@ -0,0 +1,5 @@ +# typed: strong + +module JSON + State = T.type_alias { JSON::Ext::Generator::State } +end diff --git a/sorbet/rbi/sinatra.rbi b/sorbet/rbi/sinatra.rbi new file mode 100644 index 0000000..bd7d9d4 --- /dev/null +++ b/sorbet/rbi/sinatra.rbi @@ -0,0 +1,49 @@ +# typed: strong + +class Sinatra::Base + class << self + sig { params(name: String, block: T.proc.bind(Sinatra::Base).returns(T::Boolean)).void } + def condition(name = T.unsafe(nil), &block); end + + sig { params(path: String, opts: T::Hash[Symbol, T.untyped], block: Proc).void } + def head(path, opts = {}, &block); end + + sig { params(path: String, opts: T::Hash[Symbol, T.untyped], block: Proc).void } + def get(path, opts = {}, &block); end + + sig { params(path: String, opts: T::Hash[Symbol, T.untyped], block: Proc).void } + def link(path, opts = {}, &block); end + + sig { params(path: String, opts: T::Hash[Symbol, T.untyped], block: Proc).void } + def options(path, opts = {}, &block); end + + sig { params(path: String, opts: T::Hash[Symbol, T.untyped], block: Proc).void } + def patch(path, opts = {}, &block); end + + sig { params(path: String, opts: T::Hash[Symbol, T.untyped], block: Proc).void } + def post(path, opts = {}, &block); end + + sig { params(path: String, opts: T::Hash[Symbol, T.untyped], block: Proc).void } + def put(path, opts = {}, &block); end + + sig { params(option: T::Enumerable[[T.any(Symbol, String), T.untyped]]).returns(T.self_type) } + sig { params(option: T.any(Symbol, String), value: T.untyped, ignore_setter: T::Boolean).returns(T.self_type) } + sig { params(option: T.any(Symbol, String), ignore_setter: T::Boolean, block: Proc).returns(T.self_type) } + def set(option, value = nil, ignore_setter = false, &block); end + + sig { params(path: String, opts: T::Hash[Symbol, T.untyped], block: Proc).void } + def unlink(path, opts = {}, &block); end + end + + sig { returns(Sinatra::IndifferentHash) } + def params; end + + sig { returns(Sinatra::Request) } + def request; end + + sig { returns(T::Hash[T.untyped, T.untyped]) } + def session; end + + sig { returns(T.class_of(Sinatra::Base)) } + def settings; end +end diff --git a/sorbet/tapioca/config.yml b/sorbet/tapioca/config.yml new file mode 100644 index 0000000..24087ef --- /dev/null +++ b/sorbet/tapioca/config.yml @@ -0,0 +1,44 @@ +gem: + exclude: + - ast + - base64 + - erubi + - faraday-multipart + - faraday-net_http + - faraday-retry + - logger + - json + - language_server-protocol + - multipart-post + - mustermann + - net-http + - netrc + - nio4r + - orka_api_client + - parallel + - parser + - prism + - public_suffix + - puma + - racc + - rack-protection + - rackup + - rainbow + - rbi + - regexp_parser + - rubocop-ast + - rubocop-performance + - rubocop-sorbet + - rubocop + - ruby-progressbar + - ruby2_keywords + - sawyer + - spoom + - tapioca + - thor + - tilt + - unicode-display_width + - uri + - webrick + - yard-sorbet + - yard diff --git a/sorbet/tapioca/require.rb b/sorbet/tapioca/require.rb new file mode 100644 index 0000000..462c5f2 --- /dev/null +++ b/sorbet/tapioca/require.rb @@ -0,0 +1,4 @@ +# typed: strong +# frozen_string_literal: true + +# Add your extra requires here (`bin/tapioca require` can be used to bootstrap this list) diff --git a/src/config.ru b/src/config.ru index faedf0c..f86877f 100644 --- a/src/config.ru +++ b/src/config.ru @@ -1,15 +1,19 @@ +# typed: strong # frozen_string_literal: true -Regexp.timeout = 1 +Regexp.timeout = 1.0 +require "sorbet-runtime" require_relative "server" +T.bind(self, Rack::Builder) + # We have a second pod that assigns the correct IP. # Let's wait on that to avoid race conditions. Is it hacky? Probably. # This IP assignment is however necessary for Orka requests to succeed. public_ip = ENV.fetch("PUBLIC_IP", nil) unless public_ip.nil? - current_ip = nil + current_ip = T.let(nil, T.nilable(String)) loop do begin current_ip = Net::HTTP.get(URI("https://api.ipify.org")) @@ -25,7 +29,7 @@ end puts("Starting application...") -threads = [] +threads = T.let([], T::Array[Thread]) warmup do state = SharedState.instance diff --git a/src/expired_job.rb b/src/expired_job.rb index c883c55..1053ffc 100644 --- a/src/expired_job.rb +++ b/src/expired_job.rb @@ -1,35 +1,55 @@ +# typed: strong # frozen_string_literal: true # Information representing a CI job that we are no longer tracking. class ExpiredJob - attr_reader :runner_name, :expired_at + extend T::Sig + sig { returns(String) } + attr_reader :runner_name + + sig { returns(Integer) } + attr_reader :expired_at + + sig { params(runner_name: String, expired_at: Integer).void } def initialize(runner_name, expired_at:) @runner_name = runner_name @expired_at = expired_at end + sig { override.params(other: BasicObject).returns(T::Boolean) } def ==(other) - if other.is_a?(String) + case other + when String runner_name == other + when self.class + runner_name == other.runner_name else - self.class == other.class && runner_name == other.runner_name + false end end + sig { override.params(other: BasicObject).returns(T::Boolean) } def eql?(other) - self.class == other.class && self == other + case other + when self.class + self == other + else + false + end end + sig { params(object: T::Hash[String, T.untyped]).returns(T.attached_class) } def self.json_create(object) - new(object["runner_name"], expired_at: object["expired_at"]) + new(T.cast(object["runner_name"], String), expired_at: T.cast(object["expired_at"], Integer)) end - def to_json(*) + sig { params(state: T.nilable(JSON::State)).returns(String) } + def to_json(state) { JSON.create_id => self.class.name, "runner_name" => @runner_name, "expired_at" => @expired_at, - }.to_json(*) + }.to_json(state) end end diff --git a/src/github/app_hook_delivery.rb b/src/github/app_hook_delivery.rb new file mode 100644 index 0000000..ca0d747 --- /dev/null +++ b/src/github/app_hook_delivery.rb @@ -0,0 +1,12 @@ +# typed: strong +# frozen_string_literal: true + +module GitHub + # @see https://docs.github.com/en/rest/apps/webhooks?apiVersion=2022-11-28#list-deliveries-for-an-app-webhook + class AppHookDelivery < T::Struct + prop :id, Integer + prop :delivered_at, Time + prop :status_code, Integer + prop :event, String + end +end diff --git a/src/github/runner.rb b/src/github/runner.rb new file mode 100644 index 0000000..3cd5ec9 --- /dev/null +++ b/src/github/runner.rb @@ -0,0 +1,10 @@ +# typed: strong +# frozen_string_literal: true + +module GitHub + # @see https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization + class Runner < T::Struct + prop :id, Integer + prop :name, String + end +end diff --git a/src/github/runner_application.rb b/src/github/runner_application.rb new file mode 100644 index 0000000..d982411 --- /dev/null +++ b/src/github/runner_application.rb @@ -0,0 +1,10 @@ +# typed: strong +# frozen_string_literal: true + +module GitHub + # @see https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization + class RunnerApplication < T::Struct + prop :url, String + prop :sha256, String + end +end diff --git a/src/github/runner_registration_token.rb b/src/github/runner_registration_token.rb new file mode 100644 index 0000000..c94122d --- /dev/null +++ b/src/github/runner_registration_token.rb @@ -0,0 +1,10 @@ +# typed: strong +# frozen_string_literal: true + +module GitHub + # @see https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-organization + class RunnerRegistrationToken < T::Struct + prop :token, String + prop :expires_at, Time + end +end diff --git a/src/github_client.rb b/src/github_client.rb new file mode 100644 index 0000000..4cefff1 --- /dev/null +++ b/src/github_client.rb @@ -0,0 +1,131 @@ +# typed: strict +# frozen_string_literal: true + +require "octokit" +# TODO: upstream these +require_relative "octokit/self_hosted_runner" +require_relative "octokit/actions_workflow_run_attempt" + +require_relative "github/app_hook_delivery" +require_relative "github/runner_application" +require_relative "github/runner_registration_token" +require_relative "github/runner" + +# Type-safe wrapper for Octokit. +class GitHubClient + extend T::Sig + + sig { params(org: String, username: String).returns(T::Boolean) } + def organization_member?(org, username) + octokit_client.organization_member?(org, username) + end + + sig { params(org: String).returns(GitHub::RunnerRegistrationToken) } + def create_org_runner_registration_token(org) + result = octokit_client.create_org_runner_registration_token(org) + GitHub::RunnerRegistrationToken.new(token: result.token, expires_at: result.expires_at) + end + + sig { params(org: String).returns(T::Hash[String, T::Hash[String, GitHub::RunnerApplication]]) } + def org_runner_applications(org) + applications = octokit_client.org_runner_applications(org) + download_urls = T.let({}, T::Hash[String, T::Hash[String, GitHub::RunnerApplication]]) + applications.each do |candidate| + os_map = (download_urls[candidate.os] ||= {}) + os_map[candidate.architecture] = GitHub::RunnerApplication.new( + url: candidate.download_url, + sha256: candidate.sha256_checksum, + ) + end + download_urls + end + + sig { params(since: Integer).returns(T::Array[GitHub::AppHookDelivery]) } + def app_hook_deliveries(since:) + client = jwt_octokit_client + client.per_page = 100 + + deliveries = T.let([], T::Array[GitHub::AppHookDelivery]) + page = client.list_app_hook_deliveries + loop do + filtered = page.select { |delivery| delivery.delivered_at.to_i >= since } + deliveries += filtered.map do |delivery| + GitHub::AppHookDelivery.new( + id: delivery.id, + delivered_at: delivery.delivered_at, + status_code: delivery.status_code, + event: delivery.event, + ) + end + + break if page.length != filtered.length # We found the cut-off + + next_rel = client.last_response.rels[:next] + break if next_rel.nil? # No more pages + + page = client.get(next_rel.href) + end + + deliveries + end + + sig { params(id: Integer).void } + def deliver_app_hook(id) + jwt_octokit_client.deliver_app_hook(id) + end + + sig { params(org: String).returns(T::Array[GitHub::Runner]) } + def org_runners(org) + octokit_client.org_runners(org).runners.map do |runner| + GitHub::Runner.new( + id: runner.id, + name: runner.name, + ) + end + end + + sig { params(org: String, runner: GitHub::Runner).void } + def delete_org_runner(org, runner) + octokit_client.delete_org_runner(org, runner.id) + end + + sig { params(repo: String, run_id: Integer, run_attempt: Integer).returns(String) } + def workflow_run_attempt_status(repo, run_id, run_attempt) + octokit_client.workflow_run_attempt(repo, run_id, run_attempt).status + end + + sig { params(repo: String, job_id: Integer).returns(String) } + def workflow_run_job_status(repo, job_id) + octokit_client.workflow_run_job(repo, job_id).status + end + + private + + sig { returns(Octokit::Client) } + def jwt_octokit_client + config = SharedState.instance.config + payload = { + iat: Time.now.to_i - 60, + exp: Time.now.to_i + (9 * 60), # 10 is the max, but let's be safe with 9. + iss: config.github_client_id, + } + token = JWT.encode(payload, config.github_app_private_key, "RS256") + + Octokit::Client.new(bearer_token: token) + end + + sig { returns(Octokit::Client) } + def octokit_client + @octokit_client = nil if @octokit_client_expiry.nil? || (@octokit_client_expiry.to_i - Time.now.to_i) < 300 + + @octokit_client ||= T.let(begin + installation_id = SharedState.instance.config.github_installation_id + jwt = jwt_octokit_client.create_app_installation_access_token(installation_id) + + client = Octokit::Client.new(bearer_token: jwt.token) + client.auto_paginate = true + @octokit_client_expiry = T.let(jwt.expires_at, T.nilable(Time)) + client + end, T.nilable(Octokit::Client)) + end +end diff --git a/src/github_runner_metadata.rb b/src/github_runner_metadata.rb index 7e7a0ba..6242547 100644 --- a/src/github_runner_metadata.rb +++ b/src/github_runner_metadata.rb @@ -1,15 +1,37 @@ +# typed: strong # frozen_string_literal: true # Information needed to connect a runner to GitHub. class GitHubRunnerMetadata - attr_accessor :registration_token, :download_urls, :download_fetch_time + extend T::Sig + sig { returns(T.nilable(GitHub::RunnerRegistrationToken)) } + attr_accessor :registration_token + + sig { returns(T.nilable(T::Hash[String, T::Hash[String, GitHub::RunnerApplication]])) } + attr_accessor :download_urls + + sig { returns(T.nilable(Time)) } + attr_accessor :download_fetch_time + + sig { void } def initialize @registration_token = nil - @download_urls = nil - @download_fetch_time = nil + @download_urls = T.let(nil, T.nilable(T::Hash[String, T::Hash[String, GitHub::RunnerApplication]])) + @download_fetch_time = T.let(nil, T.nilable(Time)) + end + + sig { params(job: Job).returns(GitHub::RunnerApplication) } + def runner_application_for_job(job) + raise "Download URLs not ready!" if @download_urls.nil? + + runner_application = @download_urls.dig("osx", job.arm64? ? "arm64" : "x64") + raise "No runner application found for #{job.runner_name}!" if runner_application.nil? + + runner_application end + sig { override.returns(String) } def to_s "Runner Metadata" end diff --git a/src/github_watcher.rb b/src/github_watcher.rb index 290b605..2c331a2 100644 --- a/src/github_watcher.rb +++ b/src/github_watcher.rb @@ -1,9 +1,11 @@ +# typed: strong # frozen_string_literal: true require_relative "thread_runner" # Thread runner responsible for managing connection to GitHub. class GitHubWatcher < ThreadRunner + sig { override.void } def run log "Started #{name}." @@ -26,6 +28,7 @@ def run private + sig { void } def refresh_token state = SharedState.instance metadata = state.github_runner_metadata @@ -47,25 +50,17 @@ def refresh_token rescue ShutdownException Thread.current.kill rescue => e - log(e, error: true) - log(e.backtrace, error: true) + log(e.to_s, error: true) + log(e.backtrace.to_s, error: true) end + sig { void } def refresh_download_urls state = SharedState.instance metadata = state.github_runner_metadata if metadata.download_urls.nil? || (Time.now.to_i - metadata.download_fetch_time.to_i) > 86400 begin - applications = state.github_client - .org_runner_applications(state.config.github_organisation) - download_urls = {} - applications.each do |candidate| - download_urls[candidate.os] ||= {} - download_urls[candidate.os][candidate.architecture] = { - url: candidate.download_url, - sha256: candidate.sha256_checksum, - } - end + download_urls = state.github_client.org_runner_applications(state.config.github_organisation) rescue Octokit::Error log("Error retrieving runner download URL.", error: true) return @@ -85,10 +80,11 @@ def refresh_download_urls rescue ShutdownException Thread.current.kill rescue => e - log(e, error: true) - log(e.backtrace, error: true) + log(e.to_s, error: true) + log(e.backtrace.to_s, error: true) end + sig { void } def redeliver_webhooks state = SharedState.instance lookback_time = state.last_webhook_check_time @@ -101,24 +97,8 @@ def redeliver_webhooks return end - client = state.jwt_github_client - client.per_page = 100 - current_time = Time.now.to_i - - deliveries = [] - page = client.list_app_hook_deliveries - loop do - filtered = page.select { |delivery| delivery.delivered_at.to_i >= lookback_time } - deliveries += filtered - - break if page.length != filtered.length # We found the cut-off - - next_rel = client.last_response.rels[:next] - break if next_rel.nil? # No more pages - - page = client.get(next_rel.href) - end + deliveries = state.github_client.app_hook_deliveries(since: lookback_time) # Fetch successful, mark the last check time. state.last_webhook_check_time = current_time @@ -135,7 +115,7 @@ def redeliver_webhooks log "Asking for redelivery of #{failed_deliveries.length} hook events..." unless failed_deliveries.empty? failed_deliveries.each do |delivery| - client.deliver_app_hook(delivery.id) + state.github_client.deliver_app_hook(delivery.id) rescue Octokit::Error log("Failed to redeliver #{delivery.id}.", error: true) end @@ -143,14 +123,15 @@ def redeliver_webhooks rescue ShutdownException Thread.current.kill rescue => e - log(e, error: true) - log(e.backtrace, error: true) + log(e.to_s, error: true) + log(e.backtrace.to_s, error: true) end + sig { void } def delete_runners state = SharedState.instance begin - runners = state.github_client.org_runners(state.config.github_organisation).runners + runners = state.github_client.org_runners(state.config.github_organisation) rescue Octokit::Error log("Error retrieving organisation runner list.", error: true) return @@ -165,7 +146,7 @@ def delete_runners log "Deleting organisation runner for #{job.runner_name}..." begin - state.github_client.delete_org_runner(state.config.github_organisation, runner.id) + state.github_client.delete_org_runner(state.config.github_organisation, runner) log "Organisation runner for #{job.runner_name} deleted." rescue Octokit::Error log("Error deleting organisation runner for \"#{job.runner_name}\".", error: true) @@ -183,17 +164,18 @@ def delete_runners end state.expired_jobs.concat(expired_jobs) rescue => e - log(e, error: true) - log(e.backtrace, error: true) + log(e.to_s, error: true) + log(e.backtrace.to_s, error: true) end + sig { void } def timeout_queued_and_deployed state = SharedState.instance current_time = Time.now.to_i - run_statuses = {} + run_statuses = T.let({}, T::Hash[String, String]) state.jobs.each do |job| next if job.orka_setup_timeout? - next if job.orka_setup_time.nil? || (current_time - job.orka_setup_time) < 900 + next if (orka_setup_time = job.orka_setup_time).nil? || (current_time - orka_setup_time) < 900 next if job.github_state != :queued next if job.orka_vm_id.nil? @@ -202,7 +184,7 @@ def timeout_queued_and_deployed unless run_statuses.key?(run_key) begin - run_statuses[run_key] = state.github_client.workflow_run_attempt(repo, job.run_id, job.run_attempt).status + run_statuses[run_key] = state.github_client.workflow_run_attempt_status(repo, job.run_id, job.run_attempt) rescue Octokit::Error log("Error retrieving workflow run information for #{run_key}.", error: true) next @@ -212,7 +194,7 @@ def timeout_queued_and_deployed job_state = if run_statuses[run_key] == "completed" "completed" else - state.github_client.workflow_run_job(repo, job.github_id).status + state.github_client.workflow_run_job_status(repo, job.github_id) end case job_state @@ -230,15 +212,16 @@ def timeout_queued_and_deployed end end rescue => e - log(e, error: true) - log(e.backtrace, error: true) + log(e.to_s, error: true) + log(e.backtrace.to_s, error: true) end + sig { void } def timeout_completed_jobs state = SharedState.instance current_time = Time.now.to_i state.jobs.each do |job| - next if job.runner_completion_time.nil? || (current_time - job.runner_completion_time) < 600 + next if (completion_time = job.runner_completion_time).nil? || (current_time - completion_time) < 600 next if job.github_state == :completed next if job.orka_vm_id.nil? @@ -248,24 +231,26 @@ def timeout_completed_jobs state.orka_stop_processor.queue << job end rescue => e - log(e, error: true) - log(e.backtrace, error: true) + log(e.to_s, error: true) + log(e.backtrace.to_s, error: true) end + sig { void } def cleanup_expired_jobs current_time = Time.now.to_i SharedState.instance.expired_jobs.delete_if do |job| job.expired_at < (current_time - 86400) # Forget after one day. end rescue => e - log(e, error: true) - log(e.backtrace, error: true) + log(e.to_s, error: true) + log(e.backtrace.to_s, error: true) end + sig { void } def save_state SharedState.instance.save rescue => e - log(e, error: true) - log(e.backtrace, error: true) + log(e.to_s, error: true) + log(e.backtrace.to_s, error: true) end end diff --git a/src/job.rb b/src/job.rb index b5187ec..208f9c8 100644 --- a/src/job.rb +++ b/src/job.rb @@ -1,11 +1,14 @@ +# typed: strong # frozen_string_literal: true require "securerandom" -require_relative "queue_types" +require_relative "queue_type" # Information representing a CI job. class Job + extend T::Sig + NAME_REGEX = / \A (?\d+(?:\.\d+)?(?:-(?:arm|x86_)64)?(?:-cross)?) @@ -15,101 +18,151 @@ class Job \z /x - attr_reader :runner_name, :repository, :github_id, :secret, :group + sig { returns(String) } + attr_reader :runner_name + + sig { returns(String) } + attr_reader :repository + + sig { returns(Integer) } + attr_reader :github_id + + sig { returns(String) } + attr_reader :secret + + sig { returns(PriorityType) } + attr_reader :priority_type + + sig { params(orka_setup_timeout: T::Boolean).returns(T::Boolean) } attr_writer :orka_setup_timeout - attr_accessor :github_state, :orka_vm_id, :orka_setup_time, :orka_start_attempts, :runner_completion_time + sig { returns(Symbol) } + attr_accessor :github_state + + sig { returns(T.nilable(String)) } + attr_accessor :orka_vm_id + + sig { returns(T.nilable(Integer)) } + attr_accessor :orka_setup_time + + sig { returns(Integer) } + attr_accessor :orka_start_attempts + + sig { returns(T.nilable(Integer)) } + attr_accessor :runner_completion_time + + sig { params(runner_name: String, repository: String, github_id: Integer, secret: T.nilable(String)).void } def initialize(runner_name, repository, github_id, secret: nil) raise ArgumentError, "Runner name needs a run attempt" if runner_name[NAME_REGEX, :run_attempt].nil? @runner_name = runner_name @repository = repository @github_id = github_id - @github_state = :queued + @github_state = T.let(:queued, Symbol) @orka_vm_id = nil @orka_setup_time = nil - @orka_setup_timeout = false - @orka_start_attempts = 0 - @secret = secret || SecureRandom.hex(32) + @orka_setup_timeout = T.let(false, T::Boolean) + @orka_start_attempts = T.let(0, Integer) + @secret = T.let(secret || SecureRandom.hex(32), String) @runner_completion_time = nil - @group = if dispatch_job? - :dispatch + + priority_type = if dispatch_job? + PriorityType::Dispatch elsif long_build? - :long + PriorityType::Long else - :default + PriorityType::Default end + @priority_type = T.let(priority_type, PriorityType) end + sig { returns(String) } def os - @runner_name[NAME_REGEX, :runner] + T.must(@runner_name[NAME_REGEX, :runner]) end + sig { returns(T::Boolean) } def arm64? os.split("-").include?("arm64") end + sig { returns(Integer) } def run_id - @runner_name[NAME_REGEX, :run_id] + T.must(@runner_name[NAME_REGEX, :run_id]).to_i end + sig { returns(Integer) } def run_attempt - @runner_name[NAME_REGEX, :run_attempt] + T.must(@runner_name[NAME_REGEX, :run_attempt]).to_i end + sig { returns(T::Array[String]) } def tags @runner_name[NAME_REGEX, :tags]&.split("-").to_a end + sig { returns(T::Boolean) } def dispatch_job? tags.include?("dispatch") end + sig { returns(T::Boolean) } def long_build? tags.include?("long") end + sig { returns(T::Array[String]) } def runner_labels - @runner_labels ||= begin + @runner_labels ||= T.let(begin runner_name_no_attempt = runner_name.sub(NAME_REGEX) do |match| - start_off, end_off = Regexp.last_match.offset(:run_attempt) + start_off, end_off = T.cast(T.must(Regexp.last_match).offset(:run_attempt), [Integer, Integer]) match.slice!((start_off - 1)...end_off) match end [@runner_name, runner_name_no_attempt].freeze - end + end, T.nilable(T::Array[String])) end + sig { returns(T::Boolean) } def orka_setup_complete? !@orka_setup_time.nil? && !@orka_setup_timeout end + sig { returns(T::Boolean) } def orka_setup_timeout? @orka_setup_timeout end + sig { returns(QueueType) } def queue_type if arm64? - QueueTypes::MACOS_ARM64 + QueueType::MacOS_Arm64 elsif os.partition("-").first < "13" - QueueTypes::MACOS_X86_64_LEGACY + QueueType::MacOS_x86_64_Legacy else - QueueTypes::MACOS_X86_64 + QueueType::MacOS_x86_64 end end + sig { params(object: T::Hash[String, T.untyped]).returns(T.attached_class) } def self.json_create(object) - job = new(object["runner_name"], object["repository"], object["github_id"], secret: object["secret"]) - job.github_state = object["github_state"].to_sym - job.orka_vm_id = object["orka_vm_id"] - job.orka_setup_time = object["orka_setup_time"] - job.orka_setup_timeout = object["orka_setup_timeout"] - job.orka_start_attempts = object["orka_start_attempts"] - job.runner_completion_time = object["runner_completion_time"] + job = new( + T.cast(object["runner_name"], String), + T.cast(object["repository"], String), + T.cast(object["github_id"], Integer), + secret: T.cast(object["secret"], T.nilable(String)), + ) + job.github_state = T.cast(object["github_state"], String).to_sym + job.orka_vm_id = T.cast(object["orka_vm_id"], T.nilable(String)) + job.orka_setup_time = T.cast(object["orka_setup_time"], T.nilable(Integer)) + job.orka_setup_timeout = T.cast(object["orka_setup_timeout"], T::Boolean) + job.orka_start_attempts = T.cast(object["orka_start_attempts"], Integer) + job.runner_completion_time = T.cast(object["runner_completion_time"], T.nilable(Integer)) job end - def to_json(*) + sig { params(state: T.nilable(JSON::State)).returns(String) } + def to_json(state) { JSON.create_id => self.class.name, "runner_name" => @runner_name, @@ -122,6 +175,6 @@ def to_json(*) "orka_start_attempts" => @orka_start_attempts, "secret" => @secret, "runner_completion_time" => @runner_completion_time, - }.to_json(*) + }.to_json(state) end end diff --git a/src/job_queue.rb b/src/job_queue.rb index 746b9c6..7250d7f 100644 --- a/src/job_queue.rb +++ b/src/job_queue.rb @@ -1,35 +1,44 @@ +# typed: strong # frozen_string_literal: true -require_relative "queue_types" +require_relative "priority_type" +require_relative "queue_type" require_relative "shared_state" # A variation of `Thread::Queue` that allows us to prioritise certain types of jobs. class JobQueue + extend T::Sig + + sig { params(queue_type: QueueType).void } def initialize(queue_type) - @mutex = Mutex.new - @queue = Hash.new { |h, k| h[k] = [] } + @mutex = T.let(Mutex.new, Mutex) + @queue = T.let(Hash.new { |h, k| h[k] = [] }, T::Hash[PriorityType, T::Array[Job]]) @queue_type = queue_type - @condvar = ConditionVariable.new + @condvar = T.let(ConditionVariable.new, ConditionVariable) # Ideally, @long_build_slots + @dispatch_build_slots < QueueTypes.slots(@queue_type). - @long_build_slots = QueueTypes.slots(@queue_type) / 2 - @dispatch_build_slots = QueueTypes.slots(@queue_type) / 4 + @long_build_slots = T.let(@queue_type.slots / 2, Integer) + @dispatch_build_slots = T.let(@queue_type.slots / 4, Integer) end + sig { params(job: Job).returns(T.self_type) } def <<(job) @mutex.synchronize do - @queue[job.group] << job + T.must(@queue[job.priority_type]) << job @condvar.signal end + self end - def signal_free(group) - # No need to signal for groups without slot limits. - return if group == :default + sig { params(priority_type: PriorityType).void } + def signal_free(priority_type) + # No need to signal for types without slot limits. + return if priority_type == PriorityType::Default @condvar.signal end + sig { returns(Job) } def pop @mutex.synchronize do loop do @@ -37,16 +46,23 @@ def pop running_long_build_count = running_jobs.count(&:long_build?) running_dispatch_build_count = running_jobs.count(&:dispatch_job?) - if running_long_build_count < @long_build_slots && !@queue[:long].empty? - break @queue[:long].shift - elsif running_dispatch_build_count < @dispatch_build_slots && !@queue[:dispatch].empty? - break @queue[:dispatch].shift - elsif !@queue[:default].empty? - break @queue[:default].shift + if running_long_build_count < @long_build_slots && !queue(PriorityType::Long).empty? + break T.must(queue(PriorityType::Long).shift) + elsif running_dispatch_build_count < @dispatch_build_slots && !queue(PriorityType::Dispatch).empty? + break T.must(queue(PriorityType::Dispatch).shift) + elsif !queue(PriorityType::Default).empty? + break T.must(queue(PriorityType::Default).shift) else @condvar.wait(@mutex) end end end end + + private + + sig { params(type: PriorityType).returns(T::Array[Job]) } + def queue(type) + T.must(@queue[type]) + end end diff --git a/src/log_event.rb b/src/log_event.rb index fdcaed9..4d18a72 100644 --- a/src/log_event.rb +++ b/src/log_event.rb @@ -1,19 +1,29 @@ +# typed: strong # frozen_string_literal: true # Represents a particular logging output. class LogEvent - attr_reader :time, :message + extend T::Sig + sig { returns(Time) } + attr_reader :time + + sig { returns(String) } + attr_reader :message + + sig { params(message: String, error: T::Boolean).void } def initialize(message, error: false) - @time = Time.now - @message = message - @error = error + @time = T.let(Time.now, Time) + @message = T.let(message, String) + @error = T.let(error, T::Boolean) end + sig { returns(T::Boolean) } def error? @error end + sig { override.returns(String) } def to_s "[#{time.iso8601}] [#{error? ? "ERROR" : "INFO"}] #{message}" end diff --git a/src/orka_start_processor.rb b/src/orka_start_processor.rb index 0025638..d2f1ea4 100644 --- a/src/orka_start_processor.rb +++ b/src/orka_start_processor.rb @@ -1,3 +1,4 @@ +# typed: strong # frozen_string_literal: true require_relative "thread_runner" @@ -7,7 +8,7 @@ # Thread runner responsible for deploying Orka VMs. class OrkaStartProcessor < ThreadRunner - CONFIG_MAP = { + CONFIG_MAP = T.let({ "10.11-cross" => "monterey-1011-cross", "10.15" => "catalina", "11" => "bigsur", @@ -20,29 +21,34 @@ class OrkaStartProcessor < ThreadRunner "14-arm64" => "sonoma-arm64", "15-x86_64" => "sequoia", "15-arm64" => "sequoia-arm64", - }.freeze + }.freeze, T::Hash[String, String]) + sig { returns(JobQueue) } attr_reader :queue + sig { params(queue_type: QueueType, name: String).void } def initialize(queue_type, name) super("#{self.class.name} (#{name})") - @queue = JobQueue.new(queue_type) - @orka_free_condvar = ConditionVariable.new + @queue = T.let(JobQueue.new(queue_type), JobQueue) + @orka_free_condvar = T.let(ConditionVariable.new, ConditionVariable) end + sig { override.returns(T::Boolean) } def pausable? true end - def signal_free(group) + sig { params(priority_type: PriorityType).void } + def signal_free(priority_type) @orka_free_condvar.signal - @queue.signal_free(group) + @queue.signal_free(priority_type) end + sig { override.void } def run log "Started #{name}." - job = nil + job = T.let(nil, T.nilable(Job)) loop do Thread.handle_interrupt(ShutdownException => :on_blocking) do job = @queue.pop @@ -53,7 +59,7 @@ def run github_mutex = state.github_mutex github_mutex.synchronize do while github_metadata.registration_token.nil? || - (github_metadata.registration_token.expires_at.to_i - Time.now.to_i) < 300 || + (T.must(github_metadata.registration_token).expires_at.to_i - Time.now.to_i) < 300 || github_metadata.download_urls.nil? log "Waiting for GitHub metadata..." state.github_metadata_condvar.wait(github_mutex) @@ -83,19 +89,19 @@ def run next end - runner_download = github_metadata.download_urls["osx"][job.arm64? ? "arm64" : "x64"] + runner_application = github_metadata.runner_application_for_job(job) vm_metadata = { - runner_registration_token: github_metadata.registration_token.token, + runner_registration_token: T.must(github_metadata.registration_token).token, runner_label: job.runner_labels.join(","), runner_name: job.runner_name, runner_config_args: "--ephemeral --disableupdate --no-default-labels", - runner_download: runner_download[:url], - runner_download_sha256: runner_download[:sha256], + runner_download: runner_application.url, + runner_download_sha256: runner_application.sha256, orchestrator_secret: job.secret, } - config = CONFIG_MAP[job.os] + config = CONFIG_MAP.fetch(job.os) job.orka_setup_time = nil full_host_retry_count = 0 @@ -111,7 +117,7 @@ def run log "VM for job #{job.runner_name} deployed (#{job.orka_vm_id})." end rescue Faraday::ServerError => e - if e.response_body.include?("Cannot deploy more than 2 VMs on an ARM host") && full_host_retry_count < 3 + if e.response_body&.include?("Cannot deploy more than 2 VMs on an ARM host") && full_host_retry_count < 3 full_host_retry_count += 1 log "Host full. Retrying..." sleep(10) @@ -136,8 +142,8 @@ def run break rescue => e @queue << job if job && job.orka_vm_id.nil? # Reschedule - log(e, error: true) - log(e.backtrace, error: true) + log(e.to_s, error: true) + log(e.backtrace.to_s, error: true) sleep(30) end end diff --git a/src/orka_stop_processor.rb b/src/orka_stop_processor.rb index 69b91cb..930a211 100644 --- a/src/orka_stop_processor.rb +++ b/src/orka_stop_processor.rb @@ -1,27 +1,32 @@ +# typed: strong # frozen_string_literal: true require_relative "thread_runner" # Thread runner responsible for destroying Orka VMs. class OrkaStopProcessor < ThreadRunner + sig { returns(Queue) } attr_reader :queue + sig { void } def initialize super - @queue = Queue.new + @queue = T.let(Queue.new, Queue) end + sig { override.returns(T::Boolean) } def pausable? true end + sig { override.void } def run log "Started #{name}." - job = nil + job = T.let(nil, T.nilable(Job)) loop do Thread.handle_interrupt(ShutdownException => :on_blocking) do - job = @queue.pop + job = T.cast(@queue.pop, Job) next if job.orka_vm_id.nil? @pause_mutex.synchronize do @@ -41,12 +46,12 @@ def run Thread.handle_interrupt(ShutdownException => :never) do log "Deleting VM for job #{job.runner_name}..." begin - state.orka_client.vm_resource(job.orka_vm_id).delete_all_instances + state.orka_client.vm_resource(T.must(job.orka_vm_id)).delete_all_instances rescue OrkaAPI::ResourceNotFoundError log "VM for job #{job.runner_name} already deleted!" end job.orka_vm_id = nil - state.orka_start_processors[job.queue_type].signal_free(job.group) + state.orka_start_processors.fetch(job.queue_type).signal_free(job.priority_type) log "VM for job #{job.runner_name} deleted." end end @@ -58,7 +63,7 @@ def run job.github_state = :completed else # Try deploy again. - state.orka_start_processors[job.queue_type].queue << job + state.orka_start_processors.fetch(job.queue_type).queue << job end end end @@ -66,8 +71,8 @@ def run break rescue => e @queue << job unless job&.orka_vm_id.nil? # Reschedule - log(e, error: true) - log(e.backtrace, error: true) + log(e.to_s, error: true) + log(e.backtrace.to_s, error: true) sleep(30) end end diff --git a/src/orka_timeout_processor.rb b/src/orka_timeout_processor.rb index 0014f34..07eb9e8 100644 --- a/src/orka_timeout_processor.rb +++ b/src/orka_timeout_processor.rb @@ -1,3 +1,4 @@ +# typed: strong # frozen_string_literal: true require_relative "thread_runner" @@ -6,10 +7,12 @@ class OrkaTimeoutProcessor < ThreadRunner TIMEOUT_SECONDS = 900 + sig { override.returns(T::Boolean) } def pausable? true end + sig { override.void } def run log "Started #{name}." @@ -24,6 +27,7 @@ def run private + sig { void } def check_orka Thread.handle_interrupt(ShutdownException => :on_blocking) do @pause_mutex.synchronize do @@ -50,16 +54,19 @@ def check_orka end end end + + nil end end end rescue ShutdownException raise rescue => e - log(e, error: true) - log(e.backtrace, error: true) + log(e.to_s, error: true) + log(e.backtrace.to_s, error: true) end + sig { void } def check_jobs Thread.handle_interrupt(ShutdownException => :never) do state = SharedState.instance @@ -67,18 +74,18 @@ def check_jobs state.jobs.each do |job| next unless job.orka_setup_timeout? next if job.github_state != :queued - next if job.orka_setup_time > (current_time - TIMEOUT_SECONDS) + next if T.must(job.orka_setup_time) > (current_time - TIMEOUT_SECONDS) log "Rescheduling deploy of #{job.runner_name} after 15 minute timeout." job.orka_setup_time = nil job.orka_setup_timeout = false - state.orka_start_processors[job.queue_type].queue << job + state.orka_start_processors.fetch(job.queue_type).queue << job end end rescue ShutdownException raise rescue => e - log(e, error: true) - log(e.backtrace, error: true) + log(e.to_s, error: true) + log(e.backtrace.to_s, error: true) end end diff --git a/src/priority_type.rb b/src/priority_type.rb new file mode 100644 index 0000000..4869e60 --- /dev/null +++ b/src/priority_type.rb @@ -0,0 +1,13 @@ +# typed: strong +# frozen_string_literal: true + +# Represents the priority grouping within a given queue. +class PriorityType < T::Enum + enums do + # rubocop:disable Style/MutableConstant + Default = new + Long = new + Dispatch = new + # rubocop:enable Style/MutableConstant + end +end diff --git a/src/queue_type.rb b/src/queue_type.rb new file mode 100644 index 0000000..f144244 --- /dev/null +++ b/src/queue_type.rb @@ -0,0 +1,41 @@ +# typed: strong +# frozen_string_literal: true + +# Queues that can be dealt completely separately from each other (typically OS family & arch). +class QueueType < T::Enum + extend T::Sig + + enums do + # rubocop:disable Style/MutableConstant + MacOS_x86_64_Legacy = new(0) + MacOS_Arm64 = new(1) + MacOS_x86_64 = new(2) + # rubocop:enable Style/MutableConstant + end + + sig { returns(String) } + def name + case self + when MacOS_x86_64_Legacy + "Legacy x86_64" + when MacOS_Arm64 + "arm64" + when MacOS_x86_64 + "New x86_64" + else + T.absurd(self) + end + end + + sig { returns(Integer) } + def slots + case self + when MacOS_x86_64_Legacy, MacOS_x86_64 + 12 + when MacOS_Arm64 + 10 + else + T.absurd(self) + end + end +end diff --git a/src/queue_types.rb b/src/queue_types.rb deleted file mode 100644 index 422b8f4..0000000 --- a/src/queue_types.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Queues that can be dealt completely separately from each other (typically OS family & arch). -module QueueTypes - extend Enumerable - - MACOS_X86_64_LEGACY = 0 - MACOS_ARM64 = 1 - MACOS_X86_64 = 2 - - def self.name(type) - case type - when MACOS_X86_64_LEGACY - "Legacy x86_64" - when MACOS_ARM64 - "arm64" - when MACOS_X86_64 - "New x86_64" - else - raise ArgumentError, "Invalid queue type #{type}" - end - end - - def self.slots(type) - case type - when MACOS_X86_64_LEGACY, MACOS_X86_64 - 12 - when MACOS_ARM64 - 10 - else - raise ArgumentError, "Invalid queue type #{type}" - end - end - - def self.each(&) - [MACOS_X86_64_LEGACY, MACOS_ARM64, MACOS_X86_64].each(&) - end -end diff --git a/src/ring.rb b/src/ring.rb index 463498b..9d48cf8 100644 --- a/src/ring.rb +++ b/src/ring.rb @@ -1,27 +1,39 @@ +# typed: strong # frozen_string_literal: true # A fixed-length circular storage. # When full, the oldest items are removed to make way for new entries. class Ring + extend T::Sig + extend T::Generic + include Enumerable + Elem = type_member # rubocop:disable Style/MutableConstant + + sig { params(size: Integer).void } def initialize(size = 250) - @storage = Array.new(size) - @position = 0 + @storage = T.let(Array.new(size), T::Array[T.nilable(Elem)]) + @position = T.let(0, Integer) end - def each + sig { override.params(_blk: T.proc.params(element: Elem).void).returns(T.self_type) } + def each(&_blk) read_position = @position @storage.size.times do - element = @storage[read_position] + element = @storage.fetch(read_position) read_position = (read_position + 1) % @storage.size - next if element.nil? - - yield element + case element + when NilClass + next + else + yield element + end end self end + sig { params(element: Elem).returns(T.self_type) } def <<(element) @storage[@position] = element @position = (@position + 1) % @storage.size diff --git a/src/server.rb b/src/server.rb index 2233f21..3029b85 100644 --- a/src/server.rb +++ b/src/server.rb @@ -1,3 +1,4 @@ +# typed: strict # frozen_string_literal: true require "sinatra/base" @@ -11,6 +12,8 @@ # The app to listen to incoming webhook events. class CIOrchestratorApp < Sinatra::Base + extend T::Sig + configure do set :sessions, expire_after: 28800, same_site: :lax, skip: true set :session_store, Rack::Session::Pool @@ -90,6 +93,8 @@ class CIOrchestratorApp < Sinatra::Base end get "/auth/github" do + T.bind(self, CIOrchestratorApp) + request.session_options[:skip] = false if params["state"] == session[:auth_state] @@ -122,10 +127,14 @@ class CIOrchestratorApp < Sinatra::Base end get "/", require_auth: true do + T.bind(self, CIOrchestratorApp) + erb :index, locals: { state: SharedState.instance, user: session[:user] } end get "/robots.txt" do + T.bind(self, CIOrchestratorApp) + content_type :txt <<~TEXT User-agent: * @@ -134,6 +143,8 @@ class CIOrchestratorApp < Sinatra::Base end post "/pause", require_auth: true do + T.bind(self, CIOrchestratorApp) + thread_runner_name = params["thread_runner"] if thread_runner_name thread_runner = SharedState.instance.thread_runners.find { |runner| runner.name == thread_runner_name } @@ -149,6 +160,8 @@ class CIOrchestratorApp < Sinatra::Base end post "/unpause", require_auth: true do + T.bind(self, CIOrchestratorApp) + thread_runner_name = params["thread_runner"] if thread_runner_name thread_runner = SharedState.instance.thread_runners.find { |runner| runner.name == thread_runner_name } @@ -164,6 +177,8 @@ class CIOrchestratorApp < Sinatra::Base end post "/hooks/github" do + T.bind(self, CIOrchestratorApp) + payload_body = request.body.read verify_webhook_signature(payload_body) payload = JSON.parse(payload_body) @@ -195,7 +210,7 @@ class CIOrchestratorApp < Sinatra::Base job = Job.new(runner, payload["repository"]["name"], workflow_job["id"]) state.jobs << job - state.orka_start_processors[job.queue_type].queue << job + state.orka_start_processors.fetch(job.queue_type).queue << job when "in_progress" runner = runner_for_job(workflow_job) next if runner.nil? @@ -227,6 +242,8 @@ class CIOrchestratorApp < Sinatra::Base end post "/hooks/runner_ready" do + T.bind(self, CIOrchestratorApp) + job = verify_runner_hook(params) return if job.nil? @@ -239,7 +256,9 @@ class CIOrchestratorApp < Sinatra::Base job.orka_setup_time = Time.now.to_i job.orka_setup_timeout = false elsif job.orka_vm_id != vm_id - $stderr.puts("Got ready request for #{runner_name} from an unexpected VM (#{job.orka_vm_id} != #{vm_id}).") + $stderr.puts( + "Got ready request for #{params["runner_name"]} from an unexpected VM (#{job.orka_vm_id} != #{vm_id}).", + ) return end @@ -247,11 +266,13 @@ class CIOrchestratorApp < Sinatra::Base end post "/hooks/runner_job_completed" do + T.bind(self, CIOrchestratorApp) + job = verify_runner_hook(params) return if job.nil? if job.orka_vm_id.nil? - $stderr.puts("Got stop request for #{runner_name} from a VM that shouldn't exist.") + $stderr.puts("Got stop request for #{params["runner_name"]} from a VM that shouldn't exist.") return end @@ -262,6 +283,7 @@ class CIOrchestratorApp < Sinatra::Base private + sig { params(payload_body: String).void } def verify_webhook_signature(payload_body) secret = SharedState.instance.config.github_webhook_secret signature = "sha256=#{OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new("sha256"), secret, payload_body)}" @@ -270,6 +292,7 @@ def verify_webhook_signature(payload_body) halt 400, "Signatures didn't match!" end + sig { params(params: Sinatra::IndifferentHash).returns(T.nilable(Job)) } def verify_runner_hook(params) runner_name = params["runner_name"] halt 400, "Invalid request." if runner_name.to_s.strip.empty? @@ -285,6 +308,7 @@ def verify_runner_hook(params) job end + sig { params(workflow_job: T::Hash[String, T.untyped], only_unassigned: T::Boolean).returns(T.nilable(String)) } def runner_for_job(workflow_job, only_unassigned: false) if workflow_job["runner_name"].to_s.empty? workflow_job["labels"].filter_map do |label| @@ -300,6 +324,7 @@ def runner_for_job(workflow_job, only_unassigned: false) end end + sig { params(runner: String).void } def expire_missed_job(runner) return unless runner.match?(Job::NAME_REGEX) diff --git a/src/shared_state.rb b/src/shared_state.rb index be41f4f..e5c192c 100644 --- a/src/shared_state.rb +++ b/src/shared_state.rb @@ -1,18 +1,15 @@ +# typed: strong # frozen_string_literal: true require "singleton" require "orka_api_client" -require "octokit" -# TODO: upstream these -require_relative "octokit/self_hosted_runner" -require_relative "octokit/actions_workflow_run_attempt" - require "openssl" require "jwt" require "base64" +require_relative "github_client" require_relative "github_runner_metadata" require_relative "job" require_relative "expired_job" @@ -25,31 +22,57 @@ # Shared singleton state class used by all other files. class SharedState + extend T::Sig include Singleton # Environment configuration. class Config - attr_reader :state_file, - :orka_base_url, :orka_token, - :github_app_private_key, - :github_client_id, :github_client_secret, - :github_webhook_secret, - :github_organisation, :github_installation_id, - :brew_vm_password + extend T::Sig + + sig { returns(String) } + attr_reader :state_file + + sig { returns(String) } + attr_reader :orka_base_url + + sig { returns(String) } + attr_reader :orka_token + + sig { returns(OpenSSL::PKey::RSA) } + attr_reader :github_app_private_key + + sig { returns(String) } + attr_reader :github_client_id + + sig { returns(String) } + attr_reader :github_client_secret + + sig { returns(String) } + attr_reader :github_webhook_secret + sig { returns(String) } + attr_reader :github_organisation + + sig { returns(String) } + attr_reader :github_installation_id + + sig { void } def initialize - @state_file = ENV.fetch("STATE_FILE") - @orka_base_url = ENV.fetch("ORKA_BASE_URL") - @orka_token = ENV.fetch("ORKA_TOKEN") - @github_app_private_key = OpenSSL::PKey::RSA.new(Base64.strict_decode64(ENV.fetch("GITHUB_APP_PRIVATE_KEY"))) - @github_client_id = ENV.fetch("GITHUB_CLIENT_ID") - @github_client_secret = ENV.fetch("GITHUB_CLIENT_SECRET") - @github_webhook_secret = ENV.fetch("GITHUB_WEBHOOK_SECRET") - @github_organisation = ENV.fetch("GITHUB_ORGANISATION") - @github_installation_id = ENV.fetch("GITHUB_INSTALLATION_ID") - @brew_vm_password = ENV.fetch("BREW_VM_PASSWORD") + @state_file = T.let(ENV.fetch("STATE_FILE"), String) + @orka_base_url = T.let(ENV.fetch("ORKA_BASE_URL"), String) + @orka_token = T.let(ENV.fetch("ORKA_TOKEN"), String) + @github_app_private_key = T.let( + OpenSSL::PKey::RSA.new(Base64.strict_decode64(ENV.fetch("GITHUB_APP_PRIVATE_KEY"))), + OpenSSL::PKey::RSA, + ) + @github_client_id = T.let(ENV.fetch("GITHUB_CLIENT_ID"), String) + @github_client_secret = T.let(ENV.fetch("GITHUB_CLIENT_SECRET"), String) + @github_webhook_secret = T.let(ENV.fetch("GITHUB_WEBHOOK_SECRET"), String) + @github_organisation = T.let(ENV.fetch("GITHUB_ORGANISATION"), String) + @github_installation_id = T.let(ENV.fetch("GITHUB_INSTALLATION_ID"), String) end + sig { override.returns(String) } def to_s "Shared Configuration" end @@ -60,52 +83,88 @@ def to_s MAX_WEBHOOK_REDELIVERY_WINDOW = 21600 - attr_reader :config, - :orka_client, - :orka_mutex, :github_mutex, :github_metadata_condvar, - :orka_start_processors, :orka_stop_processor, :orka_timeout_processor, :github_watcher, - :github_runner_metadata, - :jobs, :expired_jobs + sig { returns(Config) } + attr_reader :config + + sig { returns(OrkaAPI::Client) } + attr_reader :orka_client + + sig { returns(GitHubClient) } + attr_reader :github_client + + sig { returns(Mutex) } + attr_reader :orka_mutex + + sig { returns(Mutex) } + attr_reader :github_mutex + + sig { returns(ConditionVariable) } + attr_reader :github_metadata_condvar + sig { returns(T::Hash[QueueType, OrkaStartProcessor]) } + attr_reader :orka_start_processors + + sig { returns(OrkaStopProcessor) } + attr_reader :orka_stop_processor + + sig { returns(OrkaTimeoutProcessor) } + attr_reader :orka_timeout_processor + + sig { returns(GitHubWatcher) } + attr_reader :github_watcher + + sig { returns(GitHubRunnerMetadata) } + attr_reader :github_runner_metadata + + sig { returns(T::Array[Job]) } + attr_reader :jobs + + sig { returns(T::Array[ExpiredJob]) } + attr_reader :expired_jobs + + sig { returns(Integer) } attr_accessor :last_webhook_check_time + sig { void } def initialize - @config = Config.new + @config = T.let(Config.new, Config) - @orka_client = OrkaAPI::Client.new(@config.orka_base_url, token: @config.orka_token) + @orka_client = T.let(OrkaAPI::Client.new(@config.orka_base_url, token: @config.orka_token), OrkaAPI::Client) + @github_client = T.let(GitHubClient.new, GitHubClient) - @orka_mutex = Mutex.new - @github_mutex = Mutex.new - @github_metadata_condvar = ConditionVariable.new - @file_mutex = Mutex.new + @orka_mutex = T.let(Mutex.new, Mutex) + @github_mutex = T.let(Mutex.new, Mutex) + @github_metadata_condvar = T.let(ConditionVariable.new, ConditionVariable) + @file_mutex = T.let(Mutex.new, Mutex) - @orka_start_processors = QueueTypes.to_h do |type| - [type, OrkaStartProcessor.new(type, QueueTypes.name(type))] - end - @orka_stop_processor = OrkaStopProcessor.new - @orka_timeout_processor = OrkaTimeoutProcessor.new - @github_watcher = GitHubWatcher.new + @orka_start_processors = T.let(QueueType.values.to_h do |type| + [type, OrkaStartProcessor.new(type, type.name)] + end, T::Hash[QueueType, OrkaStartProcessor]) + @orka_stop_processor = T.let(OrkaStopProcessor.new, OrkaStopProcessor) + @orka_timeout_processor = T.let(OrkaTimeoutProcessor.new, OrkaTimeoutProcessor) + @github_watcher = T.let(GitHubWatcher.new, GitHubWatcher) - @github_runner_metadata = GitHubRunnerMetadata.new + @github_runner_metadata = T.let(GitHubRunnerMetadata.new, GitHubRunnerMetadata) - @jobs = [] - @expired_jobs = [] - @last_webhook_check_time = Time.now.to_i - @loaded = false + @jobs = T.let([], T::Array[Job]) + @expired_jobs = T.let([], T::Array[ExpiredJob]) + @last_webhook_check_time = T.let(Time.now.to_i, Integer) + @loaded = T.let(false, T::Boolean) end + sig { void } def load raise "Already loaded state." if @loaded raise "Too late to load state." unless @jobs.empty? @file_mutex.synchronize do - state = JSON.parse(File.read(@config.state_file), create_additions: true) - if state["version"] == STATE_VERSION + state = T.cast(JSON.parse(File.read(@config.state_file), create_additions: true), T::Hash[String, T.untyped]) + if T.cast(state["version"], Integer) == STATE_VERSION @jobs = state["jobs"] @expired_jobs = state["expired_jobs"] @last_webhook_check_time = state["last_webhook_check_time"] - load_pause_data state["paused"] + load_pause_data T.cast(state["paused"], T::Array[String]) end @loaded = true puts "Loaded #{jobs.count} jobs from state file." @@ -136,7 +195,7 @@ def load job.github_state = :completed elsif !job.orka_setup_timeout? puts "Queueing #{job.runner_name} for deployment..." - @orka_start_processors[job.queue_type].queue << job + @orka_start_processors.fetch(job.queue_type).queue << job end else puts "Ready to expire #{job.runner_name}." @@ -157,6 +216,7 @@ def load end end + sig { void } def save @file_mutex.synchronize do state = { @@ -175,56 +235,40 @@ def save end end + sig { returns(T::Boolean) } def loaded? @loaded end - def jwt_github_client - payload = { - iat: Time.now.to_i - 60, - exp: Time.now.to_i + (9 * 60), # 10 is the max, but let's be safe with 9. - iss: @config.github_client_id, - } - token = JWT.encode(payload, @config.github_app_private_key, "RS256") - - Octokit::Client.new(bearer_token: token) - end - - def github_client - return @github_client if @github_client_expiry && (@github_client_expiry.to_i - Time.now.to_i) >= 300 - - jwt = jwt_github_client.create_app_installation_access_token(@config.github_installation_id) - - @github_client = Octokit::Client.new(bearer_token: jwt.token) - @github_client.auto_paginate = true - @github_client_expiry = jwt.expires_at - @github_client - end - + sig { returns(T::Array[ThreadRunner]) } def thread_runners [*@orka_start_processors.values, @orka_stop_processor, @orka_timeout_processor, @github_watcher].freeze end + sig { params(runner_name: String).returns(T.nilable(Job)) } def job(runner_name) @jobs.find { |job| job.runner_name == runner_name } end + sig { params(waiting_job: Job).returns(T::Boolean) } def free_slot?(waiting_job) - max_slots = QueueTypes.slots(waiting_job.queue_type) + max_slots = waiting_job.queue_type.slots @jobs.count { |job| job.queue_type == waiting_job.queue_type && !job.orka_vm_id.nil? } < max_slots end + sig { params(queue_type: QueueType).returns(T::Array[Job]) } def running_jobs(queue_type) jobs.select { |job| job.queue_type == queue_type && !job.orka_vm_id.nil? } end private + sig { params(pause_data: T::Array[String]).void } def load_pause_data(pause_data) pause_data.each do |key| thread_runner = thread_runners.find { |runner| runner.name == key } if thread_runner.nil? - $stderr.puts("Can't find thread runner #{key} to pause.") + T.cast($stderr, IO).puts("Can't find thread runner #{key} to pause.") elsif thread_runner.pausable? thread_runner.pause end diff --git a/src/shutdown_exception.rb b/src/shutdown_exception.rb index 9dd18d9..4ac8a75 100644 --- a/src/shutdown_exception.rb +++ b/src/shutdown_exception.rb @@ -1,3 +1,4 @@ +# typed: strong # frozen_string_literal: true # Informs the threads of a shutdown operation. diff --git a/src/thread_runner.rb b/src/thread_runner.rb index 0ae5885..0f1538d 100644 --- a/src/thread_runner.rb +++ b/src/thread_runner.rb @@ -1,3 +1,4 @@ +# typed: strong # frozen_string_literal: true require_relative "ring" @@ -5,26 +6,36 @@ # The base thread runner class. class ThreadRunner - attr_reader :name, :log_history + extend T::Sig - def initialize(name = self.class.name) + sig { returns(String) } + attr_reader :name + + sig { returns(Ring[LogEvent]) } + attr_reader :log_history + + sig { params(name: String).void } + def initialize(name = T.unsafe(self.class.name)) @name = name - @log_history = Ring.new - @paused = false - @pause_mutex = Mutex.new - @unpause_condvar = ConditionVariable.new + @log_history = T.let(Ring.new, Ring[LogEvent]) + @paused = T.let(false, T::Boolean) + @pause_mutex = T.let(Mutex.new, Mutex) + @unpause_condvar = T.let(ConditionVariable.new, ConditionVariable) end + sig { returns(T::Boolean) } def pausable? false end + sig { returns(T::Boolean) } def paused? raise "Runner not pausable." unless pausable? @paused end + sig { void } def pause raise "Runner not pausable." unless pausable? @@ -33,6 +44,7 @@ def pause end end + sig { void } def unpause raise "Runner not pausable." unless pausable? @@ -42,17 +54,19 @@ def unpause end end + sig { void } def run raise "Implement me!" end private + sig { params(message: String, error: T::Boolean).void } def log(message, error: false) - @log_history << LogEvent.new(message.to_s, error:) + @log_history << LogEvent.new(message, error:) if error - $stderr.puts(message) + T.cast($stderr, IO).puts(message) else puts message end diff --git a/src/views/index.erb b/src/views/index.erb index c204bb0..bda4a46 100644 --- a/src/views/index.erb +++ b/src/views/index.erb @@ -116,12 +116,12 @@ <% basename = begin - File.basename(URI.parse(url_data[:url]).path) + File.basename(URI.parse(url_data.url).path) rescue URI::InvalidURIError "(parse error)" end %> - <%= basename %> + <%= basename %> <%= os %> <%= arch %>