kabustation_client 1.0.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/Gemfile +9 -0
- data/README.md +188 -0
- data/Rakefile +10 -0
- data/docs/ApiSoftLimitResponse.md +32 -0
- data/docs/AuthApi.md +72 -0
- data/docs/BoardSuccess.md +142 -0
- data/docs/BoardSuccessBuy1.md +24 -0
- data/docs/BoardSuccessBuy10.md +20 -0
- data/docs/BoardSuccessBuy2.md +20 -0
- data/docs/BoardSuccessBuy3.md +20 -0
- data/docs/BoardSuccessBuy4.md +20 -0
- data/docs/BoardSuccessBuy5.md +20 -0
- data/docs/BoardSuccessBuy6.md +20 -0
- data/docs/BoardSuccessBuy7.md +20 -0
- data/docs/BoardSuccessBuy8.md +20 -0
- data/docs/BoardSuccessBuy9.md +20 -0
- data/docs/BoardSuccessSell1.md +24 -0
- data/docs/BoardSuccessSell10.md +20 -0
- data/docs/BoardSuccessSell2.md +20 -0
- data/docs/BoardSuccessSell3.md +20 -0
- data/docs/BoardSuccessSell4.md +20 -0
- data/docs/BoardSuccessSell5.md +20 -0
- data/docs/BoardSuccessSell6.md +20 -0
- data/docs/BoardSuccessSell7.md +20 -0
- data/docs/BoardSuccessSell8.md +20 -0
- data/docs/BoardSuccessSell9.md +20 -0
- data/docs/ErrorResponse.md +20 -0
- data/docs/ExchangeResponse.md +28 -0
- data/docs/InfoApi.md +924 -0
- data/docs/MarginPremiumResponse.md +22 -0
- data/docs/MarginPremiumResponseDayTrade.md +26 -0
- data/docs/MarginPremiumResponseGeneralMargin.md +26 -0
- data/docs/OrderApi.md +275 -0
- data/docs/OrderSuccess.md +20 -0
- data/docs/OrdersSuccess.md +58 -0
- data/docs/OrdersSuccessDetailsInner.md +44 -0
- data/docs/Positions.md +20 -0
- data/docs/PositionsDeriv.md +20 -0
- data/docs/PositionsSuccess.md +58 -0
- data/docs/PrimaryExchangeResponse.md +20 -0
- data/docs/RankingByCategoryResponse.md +22 -0
- data/docs/RankingByCategoryResponseRankingInner.md +34 -0
- data/docs/RankingByMarginResponse.md +22 -0
- data/docs/RankingByMarginResponseRankingInner.md +36 -0
- data/docs/RankingByTickCountResponse.md +22 -0
- data/docs/RankingByTickCountResponseRankingInner.md +46 -0
- data/docs/RankingByTradeValueResponse.md +22 -0
- data/docs/RankingByTradeValueResponseRankingInner.md +42 -0
- data/docs/RankingByTradeVolumeResponse.md +22 -0
- data/docs/RankingByTradeVolumeResponseRankingInner.md +42 -0
- data/docs/RankingDefaultResponse.md +22 -0
- data/docs/RankingDefaultResponseRankingInner.md +42 -0
- data/docs/RankingGet200Response.md +57 -0
- data/docs/RegistSuccess.md +18 -0
- data/docs/RegisterApi.md +206 -0
- data/docs/RegulationsResponse.md +20 -0
- data/docs/RegulationsResponseRegulationsInfoInner.md +30 -0
- data/docs/RequestCancelOrder.md +20 -0
- data/docs/RequestRegister.md +18 -0
- data/docs/RequestRegisterSymbolsInner.md +20 -0
- data/docs/RequestSendOrder.md +52 -0
- data/docs/RequestSendOrderDerivFuture.md +42 -0
- data/docs/RequestSendOrderDerivFutureReverseLimitOrder.md +24 -0
- data/docs/RequestSendOrderDerivOption.md +42 -0
- data/docs/RequestSendOrderReverseLimitOrder.md +26 -0
- data/docs/RequestToken.md +18 -0
- data/docs/RequestUnregister.md +18 -0
- data/docs/SymbolNameSuccess.md +20 -0
- data/docs/SymbolSuccess.md +64 -0
- data/docs/TokenSuccess.md +20 -0
- data/docs/UnregisterAllSuccess.md +18 -0
- data/docs/WalletApi.md +535 -0
- data/docs/WalletCashSuccess.md +22 -0
- data/docs/WalletFutureSuccess.md +22 -0
- data/docs/WalletMarginSuccess.md +24 -0
- data/docs/WalletOptionSuccess.md +22 -0
- data/git_push.sh +57 -0
- data/kabustation_client.gemspec +39 -0
- data/lib/kabustation_client/api/auth_api.rb +90 -0
- data/lib/kabustation_client/api/info_api.rb +1044 -0
- data/lib/kabustation_client/api/order_api.rb +322 -0
- data/lib/kabustation_client/api/register_api.rb +236 -0
- data/lib/kabustation_client/api/wallet_api.rb +558 -0
- data/lib/kabustation_client/api_client.rb +393 -0
- data/lib/kabustation_client/api_error.rb +58 -0
- data/lib/kabustation_client/configuration.rb +295 -0
- data/lib/kabustation_client/models/api_soft_limit_response.rb +285 -0
- data/lib/kabustation_client/models/board_success.rb +816 -0
- data/lib/kabustation_client/models/board_success_buy1.rb +246 -0
- data/lib/kabustation_client/models/board_success_buy10.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy2.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy3.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy4.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy5.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy6.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy7.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy8.rb +226 -0
- data/lib/kabustation_client/models/board_success_buy9.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell1.rb +246 -0
- data/lib/kabustation_client/models/board_success_sell10.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell2.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell3.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell4.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell5.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell6.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell7.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell8.rb +226 -0
- data/lib/kabustation_client/models/board_success_sell9.rb +226 -0
- data/lib/kabustation_client/models/error_response.rb +225 -0
- data/lib/kabustation_client/models/exchange_response.rb +265 -0
- data/lib/kabustation_client/models/margin_premium_response.rb +233 -0
- data/lib/kabustation_client/models/margin_premium_response_day_trade.rb +256 -0
- data/lib/kabustation_client/models/margin_premium_response_general_margin.rb +256 -0
- data/lib/kabustation_client/models/order_success.rb +225 -0
- data/lib/kabustation_client/models/orders_success.rb +417 -0
- data/lib/kabustation_client/models/orders_success_details_inner.rb +345 -0
- data/lib/kabustation_client/models/positions.rb +225 -0
- data/lib/kabustation_client/models/positions_deriv.rb +225 -0
- data/lib/kabustation_client/models/positions_success.rb +415 -0
- data/lib/kabustation_client/models/primary_exchange_response.rb +225 -0
- data/lib/kabustation_client/models/ranking_by_category_response.rb +237 -0
- data/lib/kabustation_client/models/ranking_by_category_response_ranking_inner.rb +295 -0
- data/lib/kabustation_client/models/ranking_by_margin_response.rb +237 -0
- data/lib/kabustation_client/models/ranking_by_margin_response_ranking_inner.rb +305 -0
- data/lib/kabustation_client/models/ranking_by_tick_count_response.rb +237 -0
- data/lib/kabustation_client/models/ranking_by_tick_count_response_ranking_inner.rb +355 -0
- data/lib/kabustation_client/models/ranking_by_trade_value_response.rb +237 -0
- data/lib/kabustation_client/models/ranking_by_trade_value_response_ranking_inner.rb +335 -0
- data/lib/kabustation_client/models/ranking_by_trade_volume_response.rb +237 -0
- data/lib/kabustation_client/models/ranking_by_trade_volume_response_ranking_inner.rb +335 -0
- data/lib/kabustation_client/models/ranking_default_response.rb +237 -0
- data/lib/kabustation_client/models/ranking_default_response_ranking_inner.rb +335 -0
- data/lib/kabustation_client/models/ranking_get200_response.rb +109 -0
- data/lib/kabustation_client/models/regist_success.rb +217 -0
- data/lib/kabustation_client/models/regulations_response.rb +227 -0
- data/lib/kabustation_client/models/regulations_response_regulations_info_inner.rb +275 -0
- data/lib/kabustation_client/models/request_cancel_order.rb +239 -0
- data/lib/kabustation_client/models/request_register.rb +216 -0
- data/lib/kabustation_client/models/request_register_symbols_inner.rb +225 -0
- data/lib/kabustation_client/models/request_send_order.rb +470 -0
- data/lib/kabustation_client/models/request_send_order_deriv_future.rb +406 -0
- data/lib/kabustation_client/models/request_send_order_deriv_future_reverse_limit_order.rb +274 -0
- data/lib/kabustation_client/models/request_send_order_deriv_option.rb +406 -0
- data/lib/kabustation_client/models/request_send_order_reverse_limit_order.rb +291 -0
- data/lib/kabustation_client/models/request_token.rb +222 -0
- data/lib/kabustation_client/models/request_unregister.rb +217 -0
- data/lib/kabustation_client/models/symbol_name_success.rb +225 -0
- data/lib/kabustation_client/models/symbol_success.rb +445 -0
- data/lib/kabustation_client/models/token_success.rb +225 -0
- data/lib/kabustation_client/models/unregister_all_success.rb +215 -0
- data/lib/kabustation_client/models/wallet_cash_success.rb +235 -0
- data/lib/kabustation_client/models/wallet_future_success.rb +235 -0
- data/lib/kabustation_client/models/wallet_margin_success.rb +245 -0
- data/lib/kabustation_client/models/wallet_option_success.rb +235 -0
- data/lib/kabustation_client/version.rb +15 -0
- data/lib/kabustation_client.rb +112 -0
- data/spec/api/auth_api_spec.rb +47 -0
- data/spec/api/info_api_spec.rb +222 -0
- data/spec/api/order_api_spec.rb +87 -0
- data/spec/api/register_api_spec.rb +73 -0
- data/spec/api/wallet_api_spec.rb +135 -0
- data/spec/models/api_soft_limit_response_spec.rb +78 -0
- data/spec/models/board_success_buy10_spec.rb +42 -0
- data/spec/models/board_success_buy1_spec.rb +54 -0
- data/spec/models/board_success_buy2_spec.rb +42 -0
- data/spec/models/board_success_buy3_spec.rb +42 -0
- data/spec/models/board_success_buy4_spec.rb +42 -0
- data/spec/models/board_success_buy5_spec.rb +42 -0
- data/spec/models/board_success_buy6_spec.rb +42 -0
- data/spec/models/board_success_buy7_spec.rb +42 -0
- data/spec/models/board_success_buy8_spec.rb +42 -0
- data/spec/models/board_success_buy9_spec.rb +42 -0
- data/spec/models/board_success_sell10_spec.rb +42 -0
- data/spec/models/board_success_sell1_spec.rb +54 -0
- data/spec/models/board_success_sell2_spec.rb +42 -0
- data/spec/models/board_success_sell3_spec.rb +42 -0
- data/spec/models/board_success_sell4_spec.rb +42 -0
- data/spec/models/board_success_sell5_spec.rb +42 -0
- data/spec/models/board_success_sell6_spec.rb +42 -0
- data/spec/models/board_success_sell7_spec.rb +42 -0
- data/spec/models/board_success_sell8_spec.rb +42 -0
- data/spec/models/board_success_sell9_spec.rb +42 -0
- data/spec/models/board_success_spec.rb +408 -0
- data/spec/models/error_response_spec.rb +42 -0
- data/spec/models/exchange_response_spec.rb +66 -0
- data/spec/models/margin_premium_response_day_trade_spec.rb +60 -0
- data/spec/models/margin_premium_response_general_margin_spec.rb +60 -0
- data/spec/models/margin_premium_response_spec.rb +48 -0
- data/spec/models/order_success_spec.rb +42 -0
- data/spec/models/orders_success_details_inner_spec.rb +114 -0
- data/spec/models/orders_success_spec.rb +156 -0
- data/spec/models/positions_deriv_spec.rb +42 -0
- data/spec/models/positions_spec.rb +42 -0
- data/spec/models/positions_success_spec.rb +156 -0
- data/spec/models/primary_exchange_response_spec.rb +42 -0
- data/spec/models/ranking_by_category_response_ranking_inner_spec.rb +84 -0
- data/spec/models/ranking_by_category_response_spec.rb +48 -0
- data/spec/models/ranking_by_margin_response_ranking_inner_spec.rb +90 -0
- data/spec/models/ranking_by_margin_response_spec.rb +48 -0
- data/spec/models/ranking_by_tick_count_response_ranking_inner_spec.rb +120 -0
- data/spec/models/ranking_by_tick_count_response_spec.rb +48 -0
- data/spec/models/ranking_by_trade_value_response_ranking_inner_spec.rb +108 -0
- data/spec/models/ranking_by_trade_value_response_spec.rb +48 -0
- data/spec/models/ranking_by_trade_volume_response_ranking_inner_spec.rb +108 -0
- data/spec/models/ranking_by_trade_volume_response_spec.rb +48 -0
- data/spec/models/ranking_default_response_ranking_inner_spec.rb +108 -0
- data/spec/models/ranking_default_response_spec.rb +48 -0
- data/spec/models/ranking_get200_response_spec.rb +32 -0
- data/spec/models/regist_success_spec.rb +36 -0
- data/spec/models/regulations_response_regulations_info_inner_spec.rb +72 -0
- data/spec/models/regulations_response_spec.rb +42 -0
- data/spec/models/request_cancel_order_spec.rb +42 -0
- data/spec/models/request_register_spec.rb +36 -0
- data/spec/models/request_register_symbols_inner_spec.rb +42 -0
- data/spec/models/request_send_order_deriv_future_reverse_limit_order_spec.rb +54 -0
- data/spec/models/request_send_order_deriv_future_spec.rb +108 -0
- data/spec/models/request_send_order_deriv_option_spec.rb +108 -0
- data/spec/models/request_send_order_reverse_limit_order_spec.rb +60 -0
- data/spec/models/request_send_order_spec.rb +138 -0
- data/spec/models/request_token_spec.rb +36 -0
- data/spec/models/request_unregister_spec.rb +36 -0
- data/spec/models/symbol_name_success_spec.rb +42 -0
- data/spec/models/symbol_success_spec.rb +174 -0
- data/spec/models/token_success_spec.rb +42 -0
- data/spec/models/unregister_all_success_spec.rb +36 -0
- data/spec/models/wallet_cash_success_spec.rb +48 -0
- data/spec/models/wallet_future_success_spec.rb +48 -0
- data/spec/models/wallet_margin_success_spec.rb +54 -0
- data/spec/models/wallet_option_success_spec.rb +48 -0
- data/spec/spec_helper.rb +111 -0
- metadata +387 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#kabuステーションAPI
|
|
3
|
+
|
|
4
|
+
## 定義情報 REST APIのコード一覧、エンドポイントは下記リンク参照 - [REST APIコード一覧](../ptal/error.html)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.5
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module KabustationClient
|
|
17
|
+
class OrderSuccess
|
|
18
|
+
# 結果コード<br>0が成功。それ以外はエラーコード。
|
|
19
|
+
attr_accessor :result
|
|
20
|
+
|
|
21
|
+
# 受付注文番号
|
|
22
|
+
attr_accessor :order_id
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'result' => :'Result',
|
|
28
|
+
:'order_id' => :'OrderId'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'result' => :'Integer',
|
|
41
|
+
:'order_id' => :'String'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# List of attributes with nullable: true
|
|
46
|
+
def self.openapi_nullable
|
|
47
|
+
Set.new([
|
|
48
|
+
])
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Initializes the object
|
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
|
+
def initialize(attributes = {})
|
|
54
|
+
if (!attributes.is_a?(Hash))
|
|
55
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KabustationClient::OrderSuccess` initialize method"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KabustationClient::OrderSuccess`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'result')
|
|
67
|
+
self.result = attributes[:'result']
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
if attributes.key?(:'order_id')
|
|
71
|
+
self.order_id = attributes[:'order_id']
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
76
|
+
# @return Array for valid properties with the reasons
|
|
77
|
+
def list_invalid_properties
|
|
78
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
79
|
+
invalid_properties = Array.new
|
|
80
|
+
invalid_properties
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Check to see if the all the properties in the model are valid
|
|
84
|
+
# @return true if the model is valid
|
|
85
|
+
def valid?
|
|
86
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
87
|
+
true
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Checks equality by comparing each attribute.
|
|
91
|
+
# @param [Object] Object to be compared
|
|
92
|
+
def ==(o)
|
|
93
|
+
return true if self.equal?(o)
|
|
94
|
+
self.class == o.class &&
|
|
95
|
+
result == o.result &&
|
|
96
|
+
order_id == o.order_id
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# @see the `==` method
|
|
100
|
+
# @param [Object] Object to be compared
|
|
101
|
+
def eql?(o)
|
|
102
|
+
self == o
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Calculates hash code according to all attributes.
|
|
106
|
+
# @return [Integer] Hash code
|
|
107
|
+
def hash
|
|
108
|
+
[result, order_id].hash
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Builds the object from hash
|
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
113
|
+
# @return [Object] Returns the model itself
|
|
114
|
+
def self.build_from_hash(attributes)
|
|
115
|
+
return nil unless attributes.is_a?(Hash)
|
|
116
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
117
|
+
transformed_hash = {}
|
|
118
|
+
openapi_types.each_pair do |key, type|
|
|
119
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
120
|
+
transformed_hash["#{key}"] = nil
|
|
121
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
122
|
+
# check to ensure the input is an array given that the attribute
|
|
123
|
+
# is documented as an array but the input is not
|
|
124
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
125
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
126
|
+
end
|
|
127
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
128
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
new(transformed_hash)
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Deserializes the data based on type
|
|
135
|
+
# @param string type Data type
|
|
136
|
+
# @param string value Value to be deserialized
|
|
137
|
+
# @return [Object] Deserialized data
|
|
138
|
+
def self._deserialize(type, value)
|
|
139
|
+
case type.to_sym
|
|
140
|
+
when :Time
|
|
141
|
+
Time.parse(value)
|
|
142
|
+
when :Date
|
|
143
|
+
Date.parse(value)
|
|
144
|
+
when :String
|
|
145
|
+
value.to_s
|
|
146
|
+
when :Integer
|
|
147
|
+
value.to_i
|
|
148
|
+
when :Float
|
|
149
|
+
value.to_f
|
|
150
|
+
when :Boolean
|
|
151
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
152
|
+
true
|
|
153
|
+
else
|
|
154
|
+
false
|
|
155
|
+
end
|
|
156
|
+
when :Object
|
|
157
|
+
# generic object (usually a Hash), return directly
|
|
158
|
+
value
|
|
159
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
160
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
161
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
162
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
163
|
+
k_type = Regexp.last_match[:k_type]
|
|
164
|
+
v_type = Regexp.last_match[:v_type]
|
|
165
|
+
{}.tap do |hash|
|
|
166
|
+
value.each do |k, v|
|
|
167
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
else # model
|
|
171
|
+
# models (e.g. Pet) or oneOf
|
|
172
|
+
klass = KabustationClient.const_get(type)
|
|
173
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Returns the string representation of the object
|
|
178
|
+
# @return [String] String presentation of the object
|
|
179
|
+
def to_s
|
|
180
|
+
to_hash.to_s
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
|
185
|
+
def to_body
|
|
186
|
+
to_hash
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Returns the object in the form of hash
|
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
|
191
|
+
def to_hash
|
|
192
|
+
hash = {}
|
|
193
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
194
|
+
value = self.send(attr)
|
|
195
|
+
if value.nil?
|
|
196
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
197
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
hash[param] = _to_hash(value)
|
|
201
|
+
end
|
|
202
|
+
hash
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Outputs non-array value in the form of hash
|
|
206
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
207
|
+
# @param [Object] value Any valid value
|
|
208
|
+
# @return [Hash] Returns the value in the form of hash
|
|
209
|
+
def _to_hash(value)
|
|
210
|
+
if value.is_a?(Array)
|
|
211
|
+
value.compact.map { |v| _to_hash(v) }
|
|
212
|
+
elsif value.is_a?(Hash)
|
|
213
|
+
{}.tap do |hash|
|
|
214
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
215
|
+
end
|
|
216
|
+
elsif value.respond_to? :to_hash
|
|
217
|
+
value.to_hash
|
|
218
|
+
else
|
|
219
|
+
value
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
end
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#kabuステーションAPI
|
|
3
|
+
|
|
4
|
+
## 定義情報 REST APIのコード一覧、エンドポイントは下記リンク参照 - [REST APIコード一覧](../ptal/error.html)
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.5
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.4.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module KabustationClient
|
|
17
|
+
class OrdersSuccess
|
|
18
|
+
# 注文番号
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# 状態<br> ※OrderStateと同一である <table> <thead> <tr> <th>定義値</th> <th>説明</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>待機(発注待機)</td> </tr> <tr> <td>2</td> <td>処理中(発注送信中)</td> </tr> <tr> <td>3</td> <td>処理済(発注済・訂正済)</td> </tr> <tr> <td>4</td> <td>訂正取消送信中</td> </tr> <tr> <td>5</td> <td>終了(発注エラー・取消済・全約定・失効・期限切れ)</td> </tr> </tbody> </table>
|
|
22
|
+
attr_accessor :state
|
|
23
|
+
|
|
24
|
+
# 注文状態<br> ※Stateと同一である <table> <thead> <tr> <th>定義値</th> <th>説明</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>待機(発注待機)</td> </tr> <tr> <td>2</td> <td>処理中(発注送信中)</td> </tr> <tr> <td>3</td> <td>処理済(発注済・訂正済)</td> </tr> <tr> <td>4</td> <td>訂正取消送信中</td> </tr> <tr> <td>5</td> <td>終了(発注エラー・取消済・全約定・失効・期限切れ)</td> </tr> </tbody> </table>
|
|
25
|
+
attr_accessor :order_state
|
|
26
|
+
|
|
27
|
+
# 執行条件 <table> <thead> <tr> <th>定義値</th> <th>説明</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>ザラバ</td> </tr> <tr> <td>2</td> <td>寄り</td> </tr> <tr> <td>3</td> <td>引け</td> </tr> <tr> <td>4</td> <td>不成</td> </tr> <tr> <td>5</td> <td>対当指値</td> </tr> <tr> <td>6</td> <td>IOC</td> </tr> </tbody> </table>
|
|
28
|
+
attr_accessor :ord_type
|
|
29
|
+
|
|
30
|
+
# 受注日時
|
|
31
|
+
attr_accessor :recv_time
|
|
32
|
+
|
|
33
|
+
# 銘柄コード
|
|
34
|
+
attr_accessor :symbol
|
|
35
|
+
|
|
36
|
+
# 銘柄名
|
|
37
|
+
attr_accessor :symbol_name
|
|
38
|
+
|
|
39
|
+
# 市場コード <table> <thead> <tr> <th>定義値</th> <th>説明</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>東証</td> </tr> <tr> <td>3</td> <td>名証</td> </tr> <tr> <td>5</td> <td>福証</td> </tr> <tr> <td>6</td> <td>札証</td> </tr> <tr> <td>9</td> <td>SOR</td> </tr> <tr> <td>2</td> <td>日通し</td> </tr> <tr> <td>23</td> <td>日中</td> </tr> <tr> <td>24</td> <td>夜間</td> </tr> </tbody> </table>
|
|
40
|
+
attr_accessor :exchange
|
|
41
|
+
|
|
42
|
+
# 市場名
|
|
43
|
+
attr_accessor :exchange_name
|
|
44
|
+
|
|
45
|
+
# 有効期間条件<br>※先物・オプション銘柄の場合のみ <table> <thead> <tr> <th>定義値</th> <th>説明</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>FAS</td> </tr> <tr> <td>2</td> <td>FAK</td> </tr> <tr> <td>3</td> <td>FOK</td> </tr> </tbody> </table>
|
|
46
|
+
attr_accessor :time_in_force
|
|
47
|
+
|
|
48
|
+
# 値段
|
|
49
|
+
attr_accessor :price
|
|
50
|
+
|
|
51
|
+
# 発注数量<br> ※注文期限切れと失効の場合、OrderQtyはゼロになりません。<br> ※期限切れと失効の確認方法としては、DetailsのRecType(3: 期限切れ、7: 失効)にてご確認ください。
|
|
52
|
+
attr_accessor :order_qty
|
|
53
|
+
|
|
54
|
+
# 約定数量
|
|
55
|
+
attr_accessor :cum_qty
|
|
56
|
+
|
|
57
|
+
# 売買区分 <table> <thead> <tr> <th>定義値</th> <th>説明</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>売</td> </tr> <tr> <td>2</td> <td>買</td> </tr> </tbody> </table>
|
|
58
|
+
attr_accessor :side
|
|
59
|
+
|
|
60
|
+
# 取引区分 <table> <thead> <tr> <th>定義値</th> <th>説明</th> </tr> </thead> <tbody> <tr> <td>2</td> <td>新規</td> </tr> <tr> <td>3</td> <td>返済</td> </tr> </tbody> </table>
|
|
61
|
+
attr_accessor :cash_margin
|
|
62
|
+
|
|
63
|
+
# 口座種別 <table> <thead> <tr> <th>定義値</th> <th>説明</th> </tr> </thead> <tbody> <tr> <td>2</td> <td>一般</td> </tr> <tr> <td>4</td> <td>特定</td> </tr> <tr> <td>12</td> <td>法人</td> </tr> </tbody> </table>
|
|
64
|
+
attr_accessor :account_type
|
|
65
|
+
|
|
66
|
+
# 受渡区分 <table> <thead> <tr> <th>定義値</th> <th>説明</th> </tr> </thead> <tbody> <tr> <td>2</td> <td>お預り金</td> </tr> <tr> <td>3</td> <td>auマネーコネクト</td> </tr> </tbody> </table>
|
|
67
|
+
attr_accessor :deliv_type
|
|
68
|
+
|
|
69
|
+
# 注文有効期限<br>yyyyMMdd形式
|
|
70
|
+
attr_accessor :expire_day
|
|
71
|
+
|
|
72
|
+
# 信用取引区分<br> ※信用を注文した際に表示されます。 <table> <thead> <tr> <th>定義値</th> <th>説明</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>制度信用</td> </tr> <tr> <td>2</td> <td>一般信用(長期)</td> </tr> <tr> <td>3</td> <td>一般信用(デイトレ)</td> </tr> </tbody> </table>
|
|
73
|
+
attr_accessor :margin_trade_type
|
|
74
|
+
|
|
75
|
+
# プレミアム料<br> ※(注文中数量+約定済数量)×1株あたりプレミアム料として計算されます。<br> ※信用を注文した際に表示されます。<br> ※制度信用売/買、一般(長期)買、一般(デイトレ)買の場合は、Noneと返されます。<br> 一般(長期)売、一般(デイトレ)売の場合は、プレミアム料=0の場合、0(ゼロ)と返されます。
|
|
76
|
+
attr_accessor :margin_premium
|
|
77
|
+
|
|
78
|
+
# 注文詳細
|
|
79
|
+
attr_accessor :details
|
|
80
|
+
|
|
81
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
82
|
+
def self.attribute_map
|
|
83
|
+
{
|
|
84
|
+
:'id' => :'ID',
|
|
85
|
+
:'state' => :'State',
|
|
86
|
+
:'order_state' => :'OrderState',
|
|
87
|
+
:'ord_type' => :'OrdType',
|
|
88
|
+
:'recv_time' => :'RecvTime',
|
|
89
|
+
:'symbol' => :'Symbol',
|
|
90
|
+
:'symbol_name' => :'SymbolName',
|
|
91
|
+
:'exchange' => :'Exchange',
|
|
92
|
+
:'exchange_name' => :'ExchangeName',
|
|
93
|
+
:'time_in_force' => :'TimeInForce',
|
|
94
|
+
:'price' => :'Price',
|
|
95
|
+
:'order_qty' => :'OrderQty',
|
|
96
|
+
:'cum_qty' => :'CumQty',
|
|
97
|
+
:'side' => :'Side',
|
|
98
|
+
:'cash_margin' => :'CashMargin',
|
|
99
|
+
:'account_type' => :'AccountType',
|
|
100
|
+
:'deliv_type' => :'DelivType',
|
|
101
|
+
:'expire_day' => :'ExpireDay',
|
|
102
|
+
:'margin_trade_type' => :'MarginTradeType',
|
|
103
|
+
:'margin_premium' => :'MarginPremium',
|
|
104
|
+
:'details' => :'Details'
|
|
105
|
+
}
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Returns all the JSON keys this model knows about
|
|
109
|
+
def self.acceptable_attributes
|
|
110
|
+
attribute_map.values
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Attribute type mapping.
|
|
114
|
+
def self.openapi_types
|
|
115
|
+
{
|
|
116
|
+
:'id' => :'String',
|
|
117
|
+
:'state' => :'Integer',
|
|
118
|
+
:'order_state' => :'Integer',
|
|
119
|
+
:'ord_type' => :'Integer',
|
|
120
|
+
:'recv_time' => :'String',
|
|
121
|
+
:'symbol' => :'String',
|
|
122
|
+
:'symbol_name' => :'String',
|
|
123
|
+
:'exchange' => :'Integer',
|
|
124
|
+
:'exchange_name' => :'String',
|
|
125
|
+
:'time_in_force' => :'Integer',
|
|
126
|
+
:'price' => :'Float',
|
|
127
|
+
:'order_qty' => :'Float',
|
|
128
|
+
:'cum_qty' => :'Float',
|
|
129
|
+
:'side' => :'String',
|
|
130
|
+
:'cash_margin' => :'Integer',
|
|
131
|
+
:'account_type' => :'Integer',
|
|
132
|
+
:'deliv_type' => :'Integer',
|
|
133
|
+
:'expire_day' => :'Integer',
|
|
134
|
+
:'margin_trade_type' => :'Integer',
|
|
135
|
+
:'margin_premium' => :'Float',
|
|
136
|
+
:'details' => :'Array<OrdersSuccessDetailsInner>'
|
|
137
|
+
}
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# List of attributes with nullable: true
|
|
141
|
+
def self.openapi_nullable
|
|
142
|
+
Set.new([
|
|
143
|
+
])
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Initializes the object
|
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
148
|
+
def initialize(attributes = {})
|
|
149
|
+
if (!attributes.is_a?(Hash))
|
|
150
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KabustationClient::OrdersSuccess` initialize method"
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
154
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
155
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
156
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KabustationClient::OrdersSuccess`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
157
|
+
end
|
|
158
|
+
h[k.to_sym] = v
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if attributes.key?(:'id')
|
|
162
|
+
self.id = attributes[:'id']
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.key?(:'state')
|
|
166
|
+
self.state = attributes[:'state']
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'order_state')
|
|
170
|
+
self.order_state = attributes[:'order_state']
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'ord_type')
|
|
174
|
+
self.ord_type = attributes[:'ord_type']
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if attributes.key?(:'recv_time')
|
|
178
|
+
self.recv_time = attributes[:'recv_time']
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if attributes.key?(:'symbol')
|
|
182
|
+
self.symbol = attributes[:'symbol']
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if attributes.key?(:'symbol_name')
|
|
186
|
+
self.symbol_name = attributes[:'symbol_name']
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
if attributes.key?(:'exchange')
|
|
190
|
+
self.exchange = attributes[:'exchange']
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
if attributes.key?(:'exchange_name')
|
|
194
|
+
self.exchange_name = attributes[:'exchange_name']
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if attributes.key?(:'time_in_force')
|
|
198
|
+
self.time_in_force = attributes[:'time_in_force']
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
if attributes.key?(:'price')
|
|
202
|
+
self.price = attributes[:'price']
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
if attributes.key?(:'order_qty')
|
|
206
|
+
self.order_qty = attributes[:'order_qty']
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
if attributes.key?(:'cum_qty')
|
|
210
|
+
self.cum_qty = attributes[:'cum_qty']
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
if attributes.key?(:'side')
|
|
214
|
+
self.side = attributes[:'side']
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if attributes.key?(:'cash_margin')
|
|
218
|
+
self.cash_margin = attributes[:'cash_margin']
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if attributes.key?(:'account_type')
|
|
222
|
+
self.account_type = attributes[:'account_type']
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if attributes.key?(:'deliv_type')
|
|
226
|
+
self.deliv_type = attributes[:'deliv_type']
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
if attributes.key?(:'expire_day')
|
|
230
|
+
self.expire_day = attributes[:'expire_day']
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
if attributes.key?(:'margin_trade_type')
|
|
234
|
+
self.margin_trade_type = attributes[:'margin_trade_type']
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if attributes.key?(:'margin_premium')
|
|
238
|
+
self.margin_premium = attributes[:'margin_premium']
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
if attributes.key?(:'details')
|
|
242
|
+
if (value = attributes[:'details']).is_a?(Array)
|
|
243
|
+
self.details = value
|
|
244
|
+
end
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
249
|
+
# @return Array for valid properties with the reasons
|
|
250
|
+
def list_invalid_properties
|
|
251
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
252
|
+
invalid_properties = Array.new
|
|
253
|
+
invalid_properties
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Check to see if the all the properties in the model are valid
|
|
257
|
+
# @return true if the model is valid
|
|
258
|
+
def valid?
|
|
259
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
260
|
+
true
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# Checks equality by comparing each attribute.
|
|
264
|
+
# @param [Object] Object to be compared
|
|
265
|
+
def ==(o)
|
|
266
|
+
return true if self.equal?(o)
|
|
267
|
+
self.class == o.class &&
|
|
268
|
+
id == o.id &&
|
|
269
|
+
state == o.state &&
|
|
270
|
+
order_state == o.order_state &&
|
|
271
|
+
ord_type == o.ord_type &&
|
|
272
|
+
recv_time == o.recv_time &&
|
|
273
|
+
symbol == o.symbol &&
|
|
274
|
+
symbol_name == o.symbol_name &&
|
|
275
|
+
exchange == o.exchange &&
|
|
276
|
+
exchange_name == o.exchange_name &&
|
|
277
|
+
time_in_force == o.time_in_force &&
|
|
278
|
+
price == o.price &&
|
|
279
|
+
order_qty == o.order_qty &&
|
|
280
|
+
cum_qty == o.cum_qty &&
|
|
281
|
+
side == o.side &&
|
|
282
|
+
cash_margin == o.cash_margin &&
|
|
283
|
+
account_type == o.account_type &&
|
|
284
|
+
deliv_type == o.deliv_type &&
|
|
285
|
+
expire_day == o.expire_day &&
|
|
286
|
+
margin_trade_type == o.margin_trade_type &&
|
|
287
|
+
margin_premium == o.margin_premium &&
|
|
288
|
+
details == o.details
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# @see the `==` method
|
|
292
|
+
# @param [Object] Object to be compared
|
|
293
|
+
def eql?(o)
|
|
294
|
+
self == o
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# Calculates hash code according to all attributes.
|
|
298
|
+
# @return [Integer] Hash code
|
|
299
|
+
def hash
|
|
300
|
+
[id, state, order_state, ord_type, recv_time, symbol, symbol_name, exchange, exchange_name, time_in_force, price, order_qty, cum_qty, side, cash_margin, account_type, deliv_type, expire_day, margin_trade_type, margin_premium, details].hash
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# Builds the object from hash
|
|
304
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
305
|
+
# @return [Object] Returns the model itself
|
|
306
|
+
def self.build_from_hash(attributes)
|
|
307
|
+
return nil unless attributes.is_a?(Hash)
|
|
308
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
309
|
+
transformed_hash = {}
|
|
310
|
+
openapi_types.each_pair do |key, type|
|
|
311
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
312
|
+
transformed_hash["#{key}"] = nil
|
|
313
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
314
|
+
# check to ensure the input is an array given that the attribute
|
|
315
|
+
# is documented as an array but the input is not
|
|
316
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
317
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
318
|
+
end
|
|
319
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
320
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
321
|
+
end
|
|
322
|
+
end
|
|
323
|
+
new(transformed_hash)
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
# Deserializes the data based on type
|
|
327
|
+
# @param string type Data type
|
|
328
|
+
# @param string value Value to be deserialized
|
|
329
|
+
# @return [Object] Deserialized data
|
|
330
|
+
def self._deserialize(type, value)
|
|
331
|
+
case type.to_sym
|
|
332
|
+
when :Time
|
|
333
|
+
Time.parse(value)
|
|
334
|
+
when :Date
|
|
335
|
+
Date.parse(value)
|
|
336
|
+
when :String
|
|
337
|
+
value.to_s
|
|
338
|
+
when :Integer
|
|
339
|
+
value.to_i
|
|
340
|
+
when :Float
|
|
341
|
+
value.to_f
|
|
342
|
+
when :Boolean
|
|
343
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
344
|
+
true
|
|
345
|
+
else
|
|
346
|
+
false
|
|
347
|
+
end
|
|
348
|
+
when :Object
|
|
349
|
+
# generic object (usually a Hash), return directly
|
|
350
|
+
value
|
|
351
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
352
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
353
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
354
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
355
|
+
k_type = Regexp.last_match[:k_type]
|
|
356
|
+
v_type = Regexp.last_match[:v_type]
|
|
357
|
+
{}.tap do |hash|
|
|
358
|
+
value.each do |k, v|
|
|
359
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
360
|
+
end
|
|
361
|
+
end
|
|
362
|
+
else # model
|
|
363
|
+
# models (e.g. Pet) or oneOf
|
|
364
|
+
klass = KabustationClient.const_get(type)
|
|
365
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
366
|
+
end
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
# Returns the string representation of the object
|
|
370
|
+
# @return [String] String presentation of the object
|
|
371
|
+
def to_s
|
|
372
|
+
to_hash.to_s
|
|
373
|
+
end
|
|
374
|
+
|
|
375
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
376
|
+
# @return [Hash] Returns the object in the form of hash
|
|
377
|
+
def to_body
|
|
378
|
+
to_hash
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
# Returns the object in the form of hash
|
|
382
|
+
# @return [Hash] Returns the object in the form of hash
|
|
383
|
+
def to_hash
|
|
384
|
+
hash = {}
|
|
385
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
386
|
+
value = self.send(attr)
|
|
387
|
+
if value.nil?
|
|
388
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
389
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
390
|
+
end
|
|
391
|
+
|
|
392
|
+
hash[param] = _to_hash(value)
|
|
393
|
+
end
|
|
394
|
+
hash
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
# Outputs non-array value in the form of hash
|
|
398
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
399
|
+
# @param [Object] value Any valid value
|
|
400
|
+
# @return [Hash] Returns the value in the form of hash
|
|
401
|
+
def _to_hash(value)
|
|
402
|
+
if value.is_a?(Array)
|
|
403
|
+
value.compact.map { |v| _to_hash(v) }
|
|
404
|
+
elsif value.is_a?(Hash)
|
|
405
|
+
{}.tap do |hash|
|
|
406
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
407
|
+
end
|
|
408
|
+
elsif value.respond_to? :to_hash
|
|
409
|
+
value.to_hash
|
|
410
|
+
else
|
|
411
|
+
value
|
|
412
|
+
end
|
|
413
|
+
end
|
|
414
|
+
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
end
|