-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplanet.rb
More file actions
218 lines (187 loc) · 6.88 KB
/
Copy pathplanet.rb
File metadata and controls
218 lines (187 loc) · 6.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# frozen_string_literal: true
module ScalarGalaxy
module Models
# @see ScalarGalaxy::Resources::Planets#create
class Planet < ScalarGalaxy::Internal::Type::BaseModel
# @!attribute name
#
# @return [String]
required :name, String
# @!attribute atmosphere
# Atmospheric composition
#
# @return [Array<ScalarGalaxy::Models::Planet::Atmosphere>, nil]
optional :atmosphere, -> { ScalarGalaxy::Internal::Type::ArrayOf[ScalarGalaxy::Planet::Atmosphere] }
# @!attribute creator
# A user
#
# @return [ScalarGalaxy::Models::User, nil]
optional :creator, -> { ScalarGalaxy::User }
# @!attribute description
#
# @return [String, nil]
optional :description, String, nil?: true
# @!attribute discovered_at
#
# @return [Time, nil]
optional :discovered_at, Time, api_name: :discoveredAt
# @!attribute failure_callback_url
# URL which gets invoked upon a failed operation
#
# @return [String, nil]
optional :failure_callback_url, String, api_name: :failureCallbackUrl
# @!attribute habitability_index
# A score from 0 to 1 indicating potential habitability
#
# @return [Float, nil]
optional :habitability_index, Float, api_name: :habitabilityIndex
# @!attribute image
#
# @return [String, nil]
optional :image, String, nil?: true
# @!attribute physical_properties
#
# @return [ScalarGalaxy::Models::Planet::PhysicalProperties, nil]
optional :physical_properties,
-> { ScalarGalaxy::Planet::PhysicalProperties },
api_name: :physicalProperties
# @!attribute satellites
#
# @return [Array<Object>, nil]
optional :satellites, ScalarGalaxy::Internal::Type::ArrayOf[ScalarGalaxy::Internal::Type::Unknown]
# @!attribute success_callback_url
# URL which gets invoked upon a successful operation
#
# @return [String, nil]
optional :success_callback_url, String, api_name: :successCallbackUrl
# @!attribute tags
#
# @return [Array<String>, nil]
optional :tags, ScalarGalaxy::Internal::Type::ArrayOf[String]
# @!attribute type
#
# @return [Symbol, ScalarGalaxy::Models::Planet::Type, nil]
optional :type, enum: -> { ScalarGalaxy::Planet::Type }
response_only do
# @!attribute id
#
# @return [Integer]
required :id, Integer
# @!attribute last_updated
#
# @return [Time, nil]
optional :last_updated, Time, api_name: :lastUpdated
end
# @!method initialize(id:, name:, atmosphere: nil, creator: nil, description: nil, discovered_at: nil, failure_callback_url: nil, habitability_index: nil, image: nil, last_updated: nil, physical_properties: nil, satellites: nil, success_callback_url: nil, tags: nil, type: nil)
# A planet in the Scalar Galaxy
#
# @param id [Integer]
#
# @param name [String]
#
# @param atmosphere [Array<ScalarGalaxy::Models::Planet::Atmosphere>] Atmospheric composition
#
# @param creator [ScalarGalaxy::Models::User] A user
#
# @param description [String, nil]
#
# @param discovered_at [Time]
#
# @param failure_callback_url [String] URL which gets invoked upon a failed operation
#
# @param habitability_index [Float] A score from 0 to 1 indicating potential habitability
#
# @param image [String, nil]
#
# @param last_updated [Time]
#
# @param physical_properties [ScalarGalaxy::Models::Planet::PhysicalProperties]
#
# @param satellites [Array<Object>]
#
# @param success_callback_url [String] URL which gets invoked upon a successful operation
#
# @param tags [Array<String>]
#
# @param type [Symbol, ScalarGalaxy::Models::Planet::Type]
class Atmosphere < ScalarGalaxy::Internal::Type::BaseModel
# @!attribute compound
#
# @return [String, nil]
optional :compound, String
# @!attribute percentage
#
# @return [Float, nil]
optional :percentage, Float
# @!method initialize(compound: nil, percentage: nil)
# @param compound [String]
# @param percentage [Float]
end
# @see ScalarGalaxy::Models::Planet#physical_properties
class PhysicalProperties < ScalarGalaxy::Internal::Type::BaseModel
# @!attribute gravity
# Surface gravity in Earth g
#
# @return [Float, nil]
optional :gravity, Float
# @!attribute mass
# Mass in Earth masses (must be greater than 0)
#
# @return [Float, nil]
optional :mass, Float
# @!attribute radius
# Radius in Earth radii (must be greater than 0)
#
# @return [Float, nil]
optional :radius, Float
# @!attribute temperature
#
# @return [ScalarGalaxy::Models::Planet::PhysicalProperties::Temperature, nil]
optional :temperature, -> { ScalarGalaxy::Planet::PhysicalProperties::Temperature }
# @!method initialize(gravity: nil, mass: nil, radius: nil, temperature: nil)
# @param gravity [Float] Surface gravity in Earth g
#
# @param mass [Float] Mass in Earth masses (must be greater than 0)
#
# @param radius [Float] Radius in Earth radii (must be greater than 0)
#
# @param temperature [ScalarGalaxy::Models::Planet::PhysicalProperties::Temperature]
# @see ScalarGalaxy::Models::Planet::PhysicalProperties#temperature
class Temperature < ScalarGalaxy::Internal::Type::BaseModel
# @!attribute average
# Average temperature in Kelvin
#
# @return [Float, nil]
optional :average, Float
# @!attribute max
# Maximum temperature in Kelvin
#
# @return [Float, nil]
optional :max, Float
# @!attribute min
# Minimum temperature in Kelvin
#
# @return [Float, nil]
optional :min, Float
# @!method initialize(average: nil, max: nil, min: nil)
# @param average [Float] Average temperature in Kelvin
#
# @param max [Float] Maximum temperature in Kelvin
#
# @param min [Float] Minimum temperature in Kelvin
end
end
# @see ScalarGalaxy::Models::Planet#type
module Type
extend ScalarGalaxy::Internal::Type::Enum
TERRESTRIAL = :terrestrial
GAS_GIANT = :gas_giant
ICE_GIANT = :ice_giant
DWARF = :dwarf
SUPER_EARTH = :super_earth
# @!method self.values
# @return [Array<Symbol>]
end
end
end
end