galaxy-ruby 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +8 -0
- data/LICENSE +201 -0
- data/README.md +169 -0
- data/SECURITY.md +19 -0
- data/SKILL.md +83 -0
- data/api.md +188 -0
- data/lib/galaxy-ruby/client.rb +254 -0
- data/lib/galaxy-ruby/errors.rb +227 -0
- data/lib/galaxy-ruby/file_part.rb +58 -0
- data/lib/galaxy-ruby/internal/transport/base_client.rb +576 -0
- data/lib/galaxy-ruby/internal/transport/pooled_net_requester.rb +224 -0
- data/lib/galaxy-ruby/internal/type/array_of.rb +164 -0
- data/lib/galaxy-ruby/internal/type/base_model.rb +529 -0
- data/lib/galaxy-ruby/internal/type/base_page.rb +55 -0
- data/lib/galaxy-ruby/internal/type/boolean.rb +77 -0
- data/lib/galaxy-ruby/internal/type/converter.rb +333 -0
- data/lib/galaxy-ruby/internal/type/enum.rb +130 -0
- data/lib/galaxy-ruby/internal/type/file_input.rb +111 -0
- data/lib/galaxy-ruby/internal/type/hash_of.rb +184 -0
- data/lib/galaxy-ruby/internal/type/request_parameters.rb +42 -0
- data/lib/galaxy-ruby/internal/type/union.rb +234 -0
- data/lib/galaxy-ruby/internal/type/unknown.rb +81 -0
- data/lib/galaxy-ruby/internal/util.rb +960 -0
- data/lib/galaxy-ruby/internal.rb +15 -0
- data/lib/galaxy-ruby/models/authentication_create_token_params.rb +14 -0
- data/lib/galaxy-ruby/models/authentication_create_token_response.rb +16 -0
- data/lib/galaxy-ruby/models/authentication_create_user_params.rb +32 -0
- data/lib/galaxy-ruby/models/authentication_list_me_params.rb +14 -0
- data/lib/galaxy-ruby/models/celestial_body.rb +81 -0
- data/lib/galaxy-ruby/models/celestial_body_create_params.rb +20 -0
- data/lib/galaxy-ruby/models/credentials.rb +25 -0
- data/lib/galaxy-ruby/models/new_planet_webhook_event.rb +216 -0
- data/lib/galaxy-ruby/models/planet.rb +218 -0
- data/lib/galaxy-ruby/models/planet_create_params.rb +14 -0
- data/lib/galaxy-ruby/models/planet_delete_params.rb +20 -0
- data/lib/galaxy-ruby/models/planet_delte_image_params.rb +29 -0
- data/lib/galaxy-ruby/models/planet_delte_image_response.rb +48 -0
- data/lib/galaxy-ruby/models/planet_list_all_data_params.rb +30 -0
- data/lib/galaxy-ruby/models/planet_list_all_data_response.rb +51 -0
- data/lib/galaxy-ruby/models/planet_retrieve_params.rb +20 -0
- data/lib/galaxy-ruby/models/planet_update_params.rb +20 -0
- data/lib/galaxy-ruby/models/unwrap_webhook_event.rb +14 -0
- data/lib/galaxy-ruby/models/user.rb +26 -0
- data/lib/galaxy-ruby/models/webhook_unwrap_params.rb +14 -0
- data/lib/galaxy-ruby/models.rb +78 -0
- data/lib/galaxy-ruby/request_options.rb +77 -0
- data/lib/galaxy-ruby/resources/authentication.rb +80 -0
- data/lib/galaxy-ruby/resources/celestial_bodies.rb +37 -0
- data/lib/galaxy-ruby/resources/planets.rb +215 -0
- data/lib/galaxy-ruby/resources/webhooks.rb +34 -0
- data/lib/galaxy-ruby/version.rb +5 -0
- data/lib/galaxy-ruby.rb +78 -0
- data/rbi/galaxy-ruby/client.rbi +128 -0
- data/rbi/galaxy-ruby/errors.rbi +205 -0
- data/rbi/galaxy-ruby/file_part.rbi +37 -0
- data/rbi/galaxy-ruby/internal/transport/base_client.rbi +305 -0
- data/rbi/galaxy-ruby/internal/transport/pooled_net_requester.rbi +84 -0
- data/rbi/galaxy-ruby/internal/type/array_of.rbi +104 -0
- data/rbi/galaxy-ruby/internal/type/base_model.rbi +314 -0
- data/rbi/galaxy-ruby/internal/type/base_page.rbi +43 -0
- data/rbi/galaxy-ruby/internal/type/boolean.rbi +58 -0
- data/rbi/galaxy-ruby/internal/type/converter.rbi +222 -0
- data/rbi/galaxy-ruby/internal/type/enum.rbi +82 -0
- data/rbi/galaxy-ruby/internal/type/file_input.rbi +59 -0
- data/rbi/galaxy-ruby/internal/type/hash_of.rbi +104 -0
- data/rbi/galaxy-ruby/internal/type/request_parameters.rbi +31 -0
- data/rbi/galaxy-ruby/internal/type/union.rbi +128 -0
- data/rbi/galaxy-ruby/internal/type/unknown.rbi +58 -0
- data/rbi/galaxy-ruby/internal/util.rbi +515 -0
- data/rbi/galaxy-ruby/internal.rbi +18 -0
- data/rbi/galaxy-ruby/models/authentication_create_token_params.rbi +32 -0
- data/rbi/galaxy-ruby/models/authentication_create_token_response.rbi +29 -0
- data/rbi/galaxy-ruby/models/authentication_create_user_params.rbi +54 -0
- data/rbi/galaxy-ruby/models/authentication_list_me_params.rbi +32 -0
- data/rbi/galaxy-ruby/models/celestial_body.rbi +140 -0
- data/rbi/galaxy-ruby/models/celestial_body_create_params.rbi +53 -0
- data/rbi/galaxy-ruby/models/credentials.rbi +27 -0
- data/rbi/galaxy-ruby/models/new_planet_webhook_event.rbi +396 -0
- data/rbi/galaxy-ruby/models/planet.rbi +350 -0
- data/rbi/galaxy-ruby/models/planet_create_params.rbi +32 -0
- data/rbi/galaxy-ruby/models/planet_delete_params.rbi +38 -0
- data/rbi/galaxy-ruby/models/planet_delte_image_params.rbi +55 -0
- data/rbi/galaxy-ruby/models/planet_delte_image_response.rbi +85 -0
- data/rbi/galaxy-ruby/models/planet_list_all_data_params.rbi +60 -0
- data/rbi/galaxy-ruby/models/planet_list_all_data_response.rbi +110 -0
- data/rbi/galaxy-ruby/models/planet_retrieve_params.rbi +38 -0
- data/rbi/galaxy-ruby/models/planet_update_params.rbi +38 -0
- data/rbi/galaxy-ruby/models/unwrap_webhook_event.rbi +17 -0
- data/rbi/galaxy-ruby/models/user.rbi +33 -0
- data/rbi/galaxy-ruby/models/webhook_unwrap_params.rbi +32 -0
- data/rbi/galaxy-ruby/models.rbi +39 -0
- data/rbi/galaxy-ruby/request_options.rbi +59 -0
- data/rbi/galaxy-ruby/resources/authentication.rbi +47 -0
- data/rbi/galaxy-ruby/resources/celestial_bodies.rbi +28 -0
- data/rbi/galaxy-ruby/resources/planets.rbi +176 -0
- data/rbi/galaxy-ruby/resources/webhooks.rbi +29 -0
- data/rbi/galaxy-ruby/version.rbi +5 -0
- data/sig/galaxy-ruby/client.rbs +62 -0
- data/sig/galaxy-ruby/errors.rbs +117 -0
- data/sig/galaxy-ruby/file_part.rbs +21 -0
- data/sig/galaxy-ruby/internal/transport/base_client.rbs +133 -0
- data/sig/galaxy-ruby/internal/transport/pooled_net_requester.rbs +48 -0
- data/sig/galaxy-ruby/internal/type/array_of.rbs +48 -0
- data/sig/galaxy-ruby/internal/type/base_model.rbs +102 -0
- data/sig/galaxy-ruby/internal/type/base_page.rbs +24 -0
- data/sig/galaxy-ruby/internal/type/boolean.rbs +26 -0
- data/sig/galaxy-ruby/internal/type/converter.rbs +79 -0
- data/sig/galaxy-ruby/internal/type/enum.rbs +32 -0
- data/sig/galaxy-ruby/internal/type/file_input.rbs +25 -0
- data/sig/galaxy-ruby/internal/type/hash_of.rbs +48 -0
- data/sig/galaxy-ruby/internal/type/request_parameters.rbs +17 -0
- data/sig/galaxy-ruby/internal/type/union.rbs +52 -0
- data/sig/galaxy-ruby/internal/type/unknown.rbs +26 -0
- data/sig/galaxy-ruby/internal/util.rbs +199 -0
- data/sig/galaxy-ruby/internal.rbs +9 -0
- data/sig/galaxy-ruby/models/authentication_create_token_params.rbs +15 -0
- data/sig/galaxy-ruby/models/authentication_create_token_response.rbs +15 -0
- data/sig/galaxy-ruby/models/authentication_create_user_params.rbs +34 -0
- data/sig/galaxy-ruby/models/authentication_list_me_params.rbs +15 -0
- data/sig/galaxy-ruby/models/celestial_body.rbs +76 -0
- data/sig/galaxy-ruby/models/celestial_body_create_params.rbs +24 -0
- data/sig/galaxy-ruby/models/credentials.rbs +15 -0
- data/sig/galaxy-ruby/models/new_planet_webhook_event.rbs +211 -0
- data/sig/galaxy-ruby/models/planet.rbs +211 -0
- data/sig/galaxy-ruby/models/planet_create_params.rbs +15 -0
- data/sig/galaxy-ruby/models/planet_delete_params.rbs +23 -0
- data/sig/galaxy-ruby/models/planet_delte_image_params.rbs +32 -0
- data/sig/galaxy-ruby/models/planet_delte_image_response.rbs +50 -0
- data/sig/galaxy-ruby/models/planet_list_all_data_params.rbs +32 -0
- data/sig/galaxy-ruby/models/planet_list_all_data_response.rbs +64 -0
- data/sig/galaxy-ruby/models/planet_retrieve_params.rbs +23 -0
- data/sig/galaxy-ruby/models/planet_update_params.rbs +25 -0
- data/sig/galaxy-ruby/models/unwrap_webhook_event.rbs +11 -0
- data/sig/galaxy-ruby/models/user.rbs +19 -0
- data/sig/galaxy-ruby/models/webhook_unwrap_params.rbs +15 -0
- data/sig/galaxy-ruby/models.rbs +35 -0
- data/sig/galaxy-ruby/request_options.rbs +34 -0
- data/sig/galaxy-ruby/resources/authentication.rbs +24 -0
- data/sig/galaxy-ruby/resources/celestial_bodies.rbs +12 -0
- data/sig/galaxy-ruby/resources/planets.rbs +68 -0
- data/sig/galaxy-ruby/resources/webhooks.rbs +13 -0
- data/sig/galaxy-ruby/version.rbs +3 -0
- data/sig/manifest.yaml +6 -0
- metadata +245 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ScalarGalaxy
|
|
4
|
+
module Models
|
|
5
|
+
class PlanetListAllDataResponse < ScalarGalaxy::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
ScalarGalaxy::Models::PlanetListAllDataResponse,
|
|
10
|
+
ScalarGalaxy::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(T.nilable(T::Array[T.anything])) }
|
|
15
|
+
attr_reader :data
|
|
16
|
+
|
|
17
|
+
sig { params(data: T::Array[T.anything]).void }
|
|
18
|
+
attr_writer :data
|
|
19
|
+
|
|
20
|
+
sig do
|
|
21
|
+
returns(
|
|
22
|
+
T.nilable(ScalarGalaxy::Models::PlanetListAllDataResponse::Meta)
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
attr_reader :meta
|
|
26
|
+
|
|
27
|
+
sig do
|
|
28
|
+
params(
|
|
29
|
+
meta: ScalarGalaxy::Models::PlanetListAllDataResponse::Meta::OrHash
|
|
30
|
+
).void
|
|
31
|
+
end
|
|
32
|
+
attr_writer :meta
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
data: T::Array[T.anything],
|
|
37
|
+
meta: ScalarGalaxy::Models::PlanetListAllDataResponse::Meta::OrHash
|
|
38
|
+
).returns(T.attached_class)
|
|
39
|
+
end
|
|
40
|
+
def self.new(data: nil, meta: nil)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
sig do
|
|
44
|
+
override.returns(
|
|
45
|
+
{
|
|
46
|
+
data: T::Array[T.anything],
|
|
47
|
+
meta: ScalarGalaxy::Models::PlanetListAllDataResponse::Meta
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
def to_hash
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
class Meta < ScalarGalaxy::Internal::Type::BaseModel
|
|
55
|
+
OrHash =
|
|
56
|
+
T.type_alias do
|
|
57
|
+
T.any(
|
|
58
|
+
ScalarGalaxy::Models::PlanetListAllDataResponse::Meta,
|
|
59
|
+
ScalarGalaxy::Internal::AnyHash
|
|
60
|
+
)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
sig { returns(T.nilable(Integer)) }
|
|
64
|
+
attr_reader :limit
|
|
65
|
+
|
|
66
|
+
sig { params(limit: Integer).void }
|
|
67
|
+
attr_writer :limit
|
|
68
|
+
|
|
69
|
+
sig { returns(T.nilable(String)) }
|
|
70
|
+
attr_accessor :next_
|
|
71
|
+
|
|
72
|
+
sig { returns(T.nilable(Integer)) }
|
|
73
|
+
attr_reader :offset
|
|
74
|
+
|
|
75
|
+
sig { params(offset: Integer).void }
|
|
76
|
+
attr_writer :offset
|
|
77
|
+
|
|
78
|
+
sig { returns(T.nilable(Integer)) }
|
|
79
|
+
attr_reader :total
|
|
80
|
+
|
|
81
|
+
sig { params(total: Integer).void }
|
|
82
|
+
attr_writer :total
|
|
83
|
+
|
|
84
|
+
sig do
|
|
85
|
+
params(
|
|
86
|
+
limit: Integer,
|
|
87
|
+
next_: T.nilable(String),
|
|
88
|
+
offset: Integer,
|
|
89
|
+
total: Integer
|
|
90
|
+
).returns(T.attached_class)
|
|
91
|
+
end
|
|
92
|
+
def self.new(limit: nil, next_: nil, offset: nil, total: nil)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
sig do
|
|
96
|
+
override.returns(
|
|
97
|
+
{
|
|
98
|
+
limit: Integer,
|
|
99
|
+
next_: T.nilable(String),
|
|
100
|
+
offset: Integer,
|
|
101
|
+
total: Integer
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
def to_hash
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ScalarGalaxy
|
|
4
|
+
module Models
|
|
5
|
+
class PlanetRetrieveParams < ScalarGalaxy::Internal::Type::BaseModel
|
|
6
|
+
extend ScalarGalaxy::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include ScalarGalaxy::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
ScalarGalaxy::PlanetRetrieveParams,
|
|
13
|
+
ScalarGalaxy::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(Integer) }
|
|
18
|
+
attr_accessor :planet_id
|
|
19
|
+
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
planet_id: Integer,
|
|
23
|
+
request_options: ScalarGalaxy::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(planet_id:, request_options: {})
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
override.returns(
|
|
31
|
+
{ planet_id: Integer, request_options: ScalarGalaxy::RequestOptions }
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
def to_hash
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ScalarGalaxy
|
|
4
|
+
module Models
|
|
5
|
+
class PlanetUpdateParams < ScalarGalaxy::Models::Planet
|
|
6
|
+
extend ScalarGalaxy::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include ScalarGalaxy::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
ScalarGalaxy::PlanetUpdateParams,
|
|
13
|
+
ScalarGalaxy::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(Integer) }
|
|
18
|
+
attr_accessor :planet_id
|
|
19
|
+
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
planet_id: Integer,
|
|
23
|
+
request_options: ScalarGalaxy::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(planet_id:, request_options: {})
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
override.returns(
|
|
31
|
+
{ planet_id: Integer, request_options: ScalarGalaxy::RequestOptions }
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
def to_hash
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ScalarGalaxy
|
|
4
|
+
module Models
|
|
5
|
+
module UnwrapWebhookEvent
|
|
6
|
+
extend ScalarGalaxy::Internal::Type::Union
|
|
7
|
+
|
|
8
|
+
Variants = T.type_alias { T.any(ScalarGalaxy::NewPlanetWebhookEvent) }
|
|
9
|
+
|
|
10
|
+
sig do
|
|
11
|
+
override.returns(T::Array[ScalarGalaxy::UnwrapWebhookEvent::Variants])
|
|
12
|
+
end
|
|
13
|
+
def self.variants
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ScalarGalaxy
|
|
4
|
+
module Models
|
|
5
|
+
class User < ScalarGalaxy::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(ScalarGalaxy::User, ScalarGalaxy::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(T.nilable(Integer)) }
|
|
12
|
+
attr_reader :id
|
|
13
|
+
|
|
14
|
+
sig { params(id: Integer).void }
|
|
15
|
+
attr_writer :id
|
|
16
|
+
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_reader :name
|
|
19
|
+
|
|
20
|
+
sig { params(name: String).void }
|
|
21
|
+
attr_writer :name
|
|
22
|
+
|
|
23
|
+
# A user
|
|
24
|
+
sig { params(id: Integer, name: String).returns(T.attached_class) }
|
|
25
|
+
def self.new(id: nil, name: nil)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
sig { override.returns({ id: Integer, name: String }) }
|
|
29
|
+
def to_hash
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ScalarGalaxy
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookUnwrapParams < ScalarGalaxy::Internal::Type::BaseModel
|
|
6
|
+
extend ScalarGalaxy::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include ScalarGalaxy::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
ScalarGalaxy::WebhookUnwrapParams,
|
|
13
|
+
ScalarGalaxy::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(request_options: ScalarGalaxy::RequestOptions::OrHash).returns(
|
|
19
|
+
T.attached_class
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
def self.new(request_options: {})
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
override.returns({ request_options: ScalarGalaxy::RequestOptions })
|
|
27
|
+
end
|
|
28
|
+
def to_hash
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ScalarGalaxy
|
|
4
|
+
AuthenticationCreateTokenParams =
|
|
5
|
+
ScalarGalaxy::Models::AuthenticationCreateTokenParams
|
|
6
|
+
|
|
7
|
+
AuthenticationCreateUserParams =
|
|
8
|
+
ScalarGalaxy::Models::AuthenticationCreateUserParams
|
|
9
|
+
|
|
10
|
+
AuthenticationListMeParams = ScalarGalaxy::Models::AuthenticationListMeParams
|
|
11
|
+
|
|
12
|
+
CelestialBody = ScalarGalaxy::Models::CelestialBody
|
|
13
|
+
|
|
14
|
+
CelestialBodyCreateParams = ScalarGalaxy::Models::CelestialBodyCreateParams
|
|
15
|
+
|
|
16
|
+
Credentials = ScalarGalaxy::Models::Credentials
|
|
17
|
+
|
|
18
|
+
NewPlanetWebhookEvent = ScalarGalaxy::Models::NewPlanetWebhookEvent
|
|
19
|
+
|
|
20
|
+
Planet = ScalarGalaxy::Models::Planet
|
|
21
|
+
|
|
22
|
+
PlanetCreateParams = ScalarGalaxy::Models::PlanetCreateParams
|
|
23
|
+
|
|
24
|
+
PlanetDeleteParams = ScalarGalaxy::Models::PlanetDeleteParams
|
|
25
|
+
|
|
26
|
+
PlanetDelteImageParams = ScalarGalaxy::Models::PlanetDelteImageParams
|
|
27
|
+
|
|
28
|
+
PlanetListAllDataParams = ScalarGalaxy::Models::PlanetListAllDataParams
|
|
29
|
+
|
|
30
|
+
PlanetRetrieveParams = ScalarGalaxy::Models::PlanetRetrieveParams
|
|
31
|
+
|
|
32
|
+
PlanetUpdateParams = ScalarGalaxy::Models::PlanetUpdateParams
|
|
33
|
+
|
|
34
|
+
UnwrapWebhookEvent = ScalarGalaxy::Models::UnwrapWebhookEvent
|
|
35
|
+
|
|
36
|
+
User = ScalarGalaxy::Models::User
|
|
37
|
+
|
|
38
|
+
WebhookUnwrapParams = ScalarGalaxy::Models::WebhookUnwrapParams
|
|
39
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ScalarGalaxy
|
|
4
|
+
# Specify HTTP behaviour to use for a specific request. These options supplement
|
|
5
|
+
# or override those provided at the client level.
|
|
6
|
+
#
|
|
7
|
+
# When making a request, you can pass an actual {RequestOptions} instance, or
|
|
8
|
+
# simply pass a Hash with symbol keys matching the attributes on this class.
|
|
9
|
+
class RequestOptions < ScalarGalaxy::Internal::Type::BaseModel
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(ScalarGalaxy::RequestOptions, ScalarGalaxy::Internal::AnyHash)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# @api private
|
|
16
|
+
sig { params(opts: ScalarGalaxy::RequestOptions::OrHash).void }
|
|
17
|
+
def self.validate!(opts)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Idempotency key to send with request and all associated retries. Will only be
|
|
21
|
+
# sent for write requests.
|
|
22
|
+
sig { returns(T.nilable(String)) }
|
|
23
|
+
attr_accessor :idempotency_key
|
|
24
|
+
|
|
25
|
+
# Extra query params to send with the request. These are `.merge`’d into any
|
|
26
|
+
# `query` given at the client level.
|
|
27
|
+
sig do
|
|
28
|
+
returns(
|
|
29
|
+
T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
attr_accessor :extra_query
|
|
33
|
+
|
|
34
|
+
# Extra headers to send with the request. These are `.merged`’d into any
|
|
35
|
+
# `extra_headers` given at the client level.
|
|
36
|
+
sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) }
|
|
37
|
+
attr_accessor :extra_headers
|
|
38
|
+
|
|
39
|
+
# Extra data to send with the request. These are deep merged into any data
|
|
40
|
+
# generated as part of the normal request.
|
|
41
|
+
sig { returns(T.nilable(T.anything)) }
|
|
42
|
+
attr_accessor :extra_body
|
|
43
|
+
|
|
44
|
+
# Maximum number of retries to attempt after a failed initial request.
|
|
45
|
+
sig { returns(T.nilable(Integer)) }
|
|
46
|
+
attr_accessor :max_retries
|
|
47
|
+
|
|
48
|
+
# Request timeout in seconds.
|
|
49
|
+
sig { returns(T.nilable(Float)) }
|
|
50
|
+
attr_accessor :timeout
|
|
51
|
+
|
|
52
|
+
# Returns a new instance of RequestOptions.
|
|
53
|
+
sig do
|
|
54
|
+
params(values: ScalarGalaxy::Internal::AnyHash).returns(T.attached_class)
|
|
55
|
+
end
|
|
56
|
+
def self.new(values = {})
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ScalarGalaxy
|
|
4
|
+
module Resources
|
|
5
|
+
# Some endpoints are public, but some require authentication. We provide all the
|
|
6
|
+
# required endpoints to create an account and authorize yourself.
|
|
7
|
+
class Authentication
|
|
8
|
+
# Yeah, this is the boring security stuff. Just get your super secret token and
|
|
9
|
+
# move on.
|
|
10
|
+
sig do
|
|
11
|
+
params(
|
|
12
|
+
email: String,
|
|
13
|
+
password: String,
|
|
14
|
+
request_options: ScalarGalaxy::RequestOptions::OrHash
|
|
15
|
+
).returns(ScalarGalaxy::Models::AuthenticationCreateTokenResponse)
|
|
16
|
+
end
|
|
17
|
+
def create_token(email:, password:, request_options: {})
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Time to create a user account, eh?
|
|
21
|
+
sig do
|
|
22
|
+
params(
|
|
23
|
+
email: String,
|
|
24
|
+
password: String,
|
|
25
|
+
name: String,
|
|
26
|
+
request_options: ScalarGalaxy::RequestOptions::OrHash
|
|
27
|
+
).returns(ScalarGalaxy::User)
|
|
28
|
+
end
|
|
29
|
+
def create_user(email:, password:, name: nil, request_options: {})
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Find yourself they say. That's what you can do here.
|
|
33
|
+
sig do
|
|
34
|
+
params(request_options: ScalarGalaxy::RequestOptions::OrHash).returns(
|
|
35
|
+
ScalarGalaxy::User
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
def list_me(request_options: {})
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# @api private
|
|
42
|
+
sig { params(client: ScalarGalaxy::Client).returns(T.attached_class) }
|
|
43
|
+
def self.new(client:)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ScalarGalaxy
|
|
4
|
+
module Resources
|
|
5
|
+
# Celestial bodies are the planets and satellites in the Scalar Galaxy.
|
|
6
|
+
class CelestialBodies
|
|
7
|
+
# Stars, moons, comets, the occasional rogue asteroid — if it glows or drifts
|
|
8
|
+
# through the void, you can add it here.
|
|
9
|
+
sig do
|
|
10
|
+
params(
|
|
11
|
+
celestial_body:
|
|
12
|
+
T.any(
|
|
13
|
+
ScalarGalaxy::Planet::OrHash,
|
|
14
|
+
ScalarGalaxy::CelestialBody::Satellite::OrHash
|
|
15
|
+
),
|
|
16
|
+
request_options: ScalarGalaxy::RequestOptions::OrHash
|
|
17
|
+
).returns(ScalarGalaxy::CelestialBody::Variants)
|
|
18
|
+
end
|
|
19
|
+
def create(celestial_body:, request_options: {})
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# @api private
|
|
23
|
+
sig { params(client: ScalarGalaxy::Client).returns(T.attached_class) }
|
|
24
|
+
def self.new(client:)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ScalarGalaxy
|
|
4
|
+
module Resources
|
|
5
|
+
# Everything about planets
|
|
6
|
+
class Planets
|
|
7
|
+
# Time to play god and create a new planet. What do you think? Ah, don't think too
|
|
8
|
+
# much. What could go wrong anyway?
|
|
9
|
+
sig do
|
|
10
|
+
params(
|
|
11
|
+
id: Integer,
|
|
12
|
+
name: String,
|
|
13
|
+
atmosphere: T::Array[ScalarGalaxy::Planet::Atmosphere::OrHash],
|
|
14
|
+
creator: ScalarGalaxy::User::OrHash,
|
|
15
|
+
description: T.nilable(String),
|
|
16
|
+
discovered_at: Time,
|
|
17
|
+
failure_callback_url: String,
|
|
18
|
+
habitability_index: Float,
|
|
19
|
+
image: T.nilable(String),
|
|
20
|
+
last_updated: Time,
|
|
21
|
+
physical_properties: ScalarGalaxy::Planet::PhysicalProperties::OrHash,
|
|
22
|
+
satellites: T::Array[T.anything],
|
|
23
|
+
success_callback_url: String,
|
|
24
|
+
tags: T::Array[String],
|
|
25
|
+
type: ScalarGalaxy::Planet::Type::OrSymbol,
|
|
26
|
+
request_options: ScalarGalaxy::RequestOptions::OrHash
|
|
27
|
+
).returns(ScalarGalaxy::Planet)
|
|
28
|
+
end
|
|
29
|
+
def create(
|
|
30
|
+
id:,
|
|
31
|
+
name:,
|
|
32
|
+
# Atmospheric composition
|
|
33
|
+
atmosphere: nil,
|
|
34
|
+
# A user
|
|
35
|
+
creator: nil,
|
|
36
|
+
description: nil,
|
|
37
|
+
discovered_at: nil,
|
|
38
|
+
# URL which gets invoked upon a failed operation
|
|
39
|
+
failure_callback_url: nil,
|
|
40
|
+
# A score from 0 to 1 indicating potential habitability
|
|
41
|
+
habitability_index: nil,
|
|
42
|
+
image: nil,
|
|
43
|
+
last_updated: nil,
|
|
44
|
+
physical_properties: nil,
|
|
45
|
+
satellites: nil,
|
|
46
|
+
# URL which gets invoked upon a successful operation
|
|
47
|
+
success_callback_url: nil,
|
|
48
|
+
tags: nil,
|
|
49
|
+
type: nil,
|
|
50
|
+
request_options: {}
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# You'll better learn a little bit more about the planets. It might come in handy
|
|
55
|
+
# once space travel is available for everyone.
|
|
56
|
+
sig do
|
|
57
|
+
params(
|
|
58
|
+
planet_id: Integer,
|
|
59
|
+
request_options: ScalarGalaxy::RequestOptions::OrHash
|
|
60
|
+
).returns(ScalarGalaxy::Planet)
|
|
61
|
+
end
|
|
62
|
+
def retrieve(
|
|
63
|
+
# The ID of the planet to get
|
|
64
|
+
planet_id,
|
|
65
|
+
request_options: {}
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Sometimes you make mistakes, that's fine. No worries, you can update all
|
|
70
|
+
# planets.
|
|
71
|
+
sig do
|
|
72
|
+
params(
|
|
73
|
+
planet_id: Integer,
|
|
74
|
+
id: Integer,
|
|
75
|
+
name: String,
|
|
76
|
+
atmosphere: T::Array[ScalarGalaxy::Planet::Atmosphere::OrHash],
|
|
77
|
+
creator: ScalarGalaxy::User::OrHash,
|
|
78
|
+
description: T.nilable(String),
|
|
79
|
+
discovered_at: Time,
|
|
80
|
+
failure_callback_url: String,
|
|
81
|
+
habitability_index: Float,
|
|
82
|
+
image: T.nilable(String),
|
|
83
|
+
last_updated: Time,
|
|
84
|
+
physical_properties: ScalarGalaxy::Planet::PhysicalProperties::OrHash,
|
|
85
|
+
satellites: T::Array[T.anything],
|
|
86
|
+
success_callback_url: String,
|
|
87
|
+
tags: T::Array[String],
|
|
88
|
+
type: ScalarGalaxy::Planet::Type::OrSymbol,
|
|
89
|
+
request_options: ScalarGalaxy::RequestOptions::OrHash
|
|
90
|
+
).returns(ScalarGalaxy::Planet)
|
|
91
|
+
end
|
|
92
|
+
def update(
|
|
93
|
+
# The ID of the planet to get
|
|
94
|
+
planet_id,
|
|
95
|
+
id:,
|
|
96
|
+
name:,
|
|
97
|
+
# Atmospheric composition
|
|
98
|
+
atmosphere: nil,
|
|
99
|
+
# A user
|
|
100
|
+
creator: nil,
|
|
101
|
+
description: nil,
|
|
102
|
+
discovered_at: nil,
|
|
103
|
+
# URL which gets invoked upon a failed operation
|
|
104
|
+
failure_callback_url: nil,
|
|
105
|
+
# A score from 0 to 1 indicating potential habitability
|
|
106
|
+
habitability_index: nil,
|
|
107
|
+
image: nil,
|
|
108
|
+
last_updated: nil,
|
|
109
|
+
physical_properties: nil,
|
|
110
|
+
satellites: nil,
|
|
111
|
+
# URL which gets invoked upon a successful operation
|
|
112
|
+
success_callback_url: nil,
|
|
113
|
+
tags: nil,
|
|
114
|
+
type: nil,
|
|
115
|
+
request_options: {}
|
|
116
|
+
)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# This endpoint was used to delete planets. Unfortunately, that caused a lot of
|
|
120
|
+
# trouble for planets with life. So, this endpoint is now deprecated and should
|
|
121
|
+
# not be used anymore.
|
|
122
|
+
sig do
|
|
123
|
+
params(
|
|
124
|
+
planet_id: Integer,
|
|
125
|
+
request_options: ScalarGalaxy::RequestOptions::OrHash
|
|
126
|
+
).void
|
|
127
|
+
end
|
|
128
|
+
def delete(
|
|
129
|
+
# The ID of the planet to get
|
|
130
|
+
planet_id,
|
|
131
|
+
request_options: {}
|
|
132
|
+
)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Got a crazy good photo of a planet? Share it with the world!
|
|
136
|
+
sig do
|
|
137
|
+
params(
|
|
138
|
+
planet_id: Integer,
|
|
139
|
+
image: ScalarGalaxy::Internal::FileInput,
|
|
140
|
+
request_options: ScalarGalaxy::RequestOptions::OrHash
|
|
141
|
+
).returns(ScalarGalaxy::Models::PlanetDelteImageResponse)
|
|
142
|
+
end
|
|
143
|
+
def delte_image(
|
|
144
|
+
# The ID of the planet to get
|
|
145
|
+
planet_id,
|
|
146
|
+
# The image file to upload
|
|
147
|
+
image: nil,
|
|
148
|
+
request_options: {}
|
|
149
|
+
)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# It's easy to say you know them all, but do you really? Retrieve all the planets
|
|
153
|
+
# and check whether you missed one.
|
|
154
|
+
sig do
|
|
155
|
+
params(
|
|
156
|
+
limit: Integer,
|
|
157
|
+
offset: Integer,
|
|
158
|
+
request_options: ScalarGalaxy::RequestOptions::OrHash
|
|
159
|
+
).returns(ScalarGalaxy::Models::PlanetListAllDataResponse)
|
|
160
|
+
end
|
|
161
|
+
def list_all_data(
|
|
162
|
+
# The number of items to return
|
|
163
|
+
limit: nil,
|
|
164
|
+
# The number of items to skip before starting to collect the result set
|
|
165
|
+
offset: nil,
|
|
166
|
+
request_options: {}
|
|
167
|
+
)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# @api private
|
|
171
|
+
sig { params(client: ScalarGalaxy::Client).returns(T.attached_class) }
|
|
172
|
+
def self.new(client:)
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module ScalarGalaxy
|
|
4
|
+
module Resources
|
|
5
|
+
class Webhooks
|
|
6
|
+
sig do
|
|
7
|
+
params(
|
|
8
|
+
payload: String,
|
|
9
|
+
headers: T::Hash[String, String],
|
|
10
|
+
key: T.nilable(String)
|
|
11
|
+
).returns(ScalarGalaxy::NewPlanetWebhookEvent)
|
|
12
|
+
end
|
|
13
|
+
def unwrap(
|
|
14
|
+
# The raw webhook payload as a string
|
|
15
|
+
payload,
|
|
16
|
+
# The raw HTTP headers that came with the payload
|
|
17
|
+
headers:,
|
|
18
|
+
# The webhook signing key
|
|
19
|
+
key: @client.webhook_secret
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# @api private
|
|
24
|
+
sig { params(client: ScalarGalaxy::Client).returns(T.attached_class) }
|
|
25
|
+
def self.new(client:)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|