e621_openapi 1.0.385
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +35 -0
- data/lib/e621_openapi/client.rb +144 -0
- data/lib/e621_openapi/enums.rb +15 -0
- data/lib/e621_openapi/error.rb +25 -0
- data/lib/e621_openapi/operations.rb +2216 -0
- data/lib/e621_openapi/spec.rb +19 -0
- data/lib/e621_openapi/spec_commit.rb +6 -0
- data/lib/e621_openapi/version.rb +6 -0
- data/lib/e621_openapi.rb +13 -0
- data/sig/e621_openapi/enums.rbs +15 -0
- data/sig/e621_openapi/operations.rbs +1517 -0
- data/sig/e621_openapi/types.rbs +319 -0
- data/sig/e621_openapi.rbs +66 -0
- metadata +56 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "net/http"
|
|
4
|
+
|
|
5
|
+
module E621OpenAPI
|
|
6
|
+
# The spec this client was generated from.
|
|
7
|
+
SPEC_URL = "https://raw.githubusercontent.com/DonovanDMC/E621OpenAPI/#{SPEC_COMMIT}/openapi.yaml"
|
|
8
|
+
|
|
9
|
+
# The spec this client was generated from, with every `$ref` inlined.
|
|
10
|
+
DEREFERENCED_SPEC_URL = "https://raw.githubusercontent.com/DonovanDMC/E621OpenAPI/#{SPEC_COMMIT}/openapi.dereferenced.yaml"
|
|
11
|
+
|
|
12
|
+
# Fetches the spec this client was generated from, as YAML.
|
|
13
|
+
def self.fetch_spec(dereferenced: false)
|
|
14
|
+
response = Net::HTTP.get_response(URI(dereferenced ? DEREFERENCED_SPEC_URL : SPEC_URL))
|
|
15
|
+
raise "Failed to fetch the spec: #{response.code} #{response.message}" unless response.is_a?(Net::HTTPSuccess)
|
|
16
|
+
|
|
17
|
+
response.body.to_s
|
|
18
|
+
end
|
|
19
|
+
end
|
data/lib/e621_openapi.rb
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "e621_openapi/version"
|
|
4
|
+
require_relative "e621_openapi/spec_commit"
|
|
5
|
+
require_relative "e621_openapi/spec"
|
|
6
|
+
require_relative "e621_openapi/error"
|
|
7
|
+
require_relative "e621_openapi/enums"
|
|
8
|
+
require_relative "e621_openapi/operations"
|
|
9
|
+
require_relative "e621_openapi/client"
|
|
10
|
+
|
|
11
|
+
# Types and a client for the e621.net API, generated from the E621OpenAPI spec.
|
|
12
|
+
module E621OpenAPI
|
|
13
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Generated by scripts/generate.rb from the E621OpenAPI spec, don't edit by hand.
|
|
2
|
+
|
|
3
|
+
module E621OpenAPI
|
|
4
|
+
module TagCategory
|
|
5
|
+
GENERAL: 0
|
|
6
|
+
ARTIST: 1
|
|
7
|
+
CONTRIBUTOR: 2
|
|
8
|
+
COPYRIGHT: 3
|
|
9
|
+
CHARACTER: 4
|
|
10
|
+
SPECIES: 5
|
|
11
|
+
INVALID: 6
|
|
12
|
+
META: 7
|
|
13
|
+
LORE: 8
|
|
14
|
+
end
|
|
15
|
+
end
|