kabustation_client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,245 @@
|
|
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 WalletMarginSuccess
|
18
|
+
# 信用新規可能額
|
19
|
+
attr_accessor :margin_account_wallet
|
20
|
+
|
21
|
+
# 保証金維持率<br>※銘柄指定の場合のみ<br>※銘柄が指定されなかった場合、0.0を返す。
|
22
|
+
attr_accessor :depositkeep_rate
|
23
|
+
|
24
|
+
# 委託保証金率<br>※銘柄指定の場合のみ。<br>※銘柄が指定されなかった場合、Noneを返す。
|
25
|
+
attr_accessor :consignment_deposit_rate
|
26
|
+
|
27
|
+
# 現金委託保証金率<br>※銘柄指定の場合のみ。<br>※銘柄が指定されなかった場合、Noneを返す。
|
28
|
+
attr_accessor :cash_of_consignment_deposit_rate
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'margin_account_wallet' => :'MarginAccountWallet',
|
34
|
+
:'depositkeep_rate' => :'DepositkeepRate',
|
35
|
+
:'consignment_deposit_rate' => :'ConsignmentDepositRate',
|
36
|
+
:'cash_of_consignment_deposit_rate' => :'CashOfConsignmentDepositRate'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns all the JSON keys this model knows about
|
41
|
+
def self.acceptable_attributes
|
42
|
+
attribute_map.values
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.openapi_types
|
47
|
+
{
|
48
|
+
:'margin_account_wallet' => :'Float',
|
49
|
+
:'depositkeep_rate' => :'Float',
|
50
|
+
:'consignment_deposit_rate' => :'Float',
|
51
|
+
:'cash_of_consignment_deposit_rate' => :'Float'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# List of attributes with nullable: true
|
56
|
+
def self.openapi_nullable
|
57
|
+
Set.new([
|
58
|
+
])
|
59
|
+
end
|
60
|
+
|
61
|
+
# Initializes the object
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
63
|
+
def initialize(attributes = {})
|
64
|
+
if (!attributes.is_a?(Hash))
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KabustationClient::WalletMarginSuccess` initialize method"
|
66
|
+
end
|
67
|
+
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
69
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
70
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KabustationClient::WalletMarginSuccess`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
72
|
+
end
|
73
|
+
h[k.to_sym] = v
|
74
|
+
}
|
75
|
+
|
76
|
+
if attributes.key?(:'margin_account_wallet')
|
77
|
+
self.margin_account_wallet = attributes[:'margin_account_wallet']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'depositkeep_rate')
|
81
|
+
self.depositkeep_rate = attributes[:'depositkeep_rate']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'consignment_deposit_rate')
|
85
|
+
self.consignment_deposit_rate = attributes[:'consignment_deposit_rate']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes.key?(:'cash_of_consignment_deposit_rate')
|
89
|
+
self.cash_of_consignment_deposit_rate = attributes[:'cash_of_consignment_deposit_rate']
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
94
|
+
# @return Array for valid properties with the reasons
|
95
|
+
def list_invalid_properties
|
96
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
97
|
+
invalid_properties = Array.new
|
98
|
+
invalid_properties
|
99
|
+
end
|
100
|
+
|
101
|
+
# Check to see if the all the properties in the model are valid
|
102
|
+
# @return true if the model is valid
|
103
|
+
def valid?
|
104
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
105
|
+
true
|
106
|
+
end
|
107
|
+
|
108
|
+
# Checks equality by comparing each attribute.
|
109
|
+
# @param [Object] Object to be compared
|
110
|
+
def ==(o)
|
111
|
+
return true if self.equal?(o)
|
112
|
+
self.class == o.class &&
|
113
|
+
margin_account_wallet == o.margin_account_wallet &&
|
114
|
+
depositkeep_rate == o.depositkeep_rate &&
|
115
|
+
consignment_deposit_rate == o.consignment_deposit_rate &&
|
116
|
+
cash_of_consignment_deposit_rate == o.cash_of_consignment_deposit_rate
|
117
|
+
end
|
118
|
+
|
119
|
+
# @see the `==` method
|
120
|
+
# @param [Object] Object to be compared
|
121
|
+
def eql?(o)
|
122
|
+
self == o
|
123
|
+
end
|
124
|
+
|
125
|
+
# Calculates hash code according to all attributes.
|
126
|
+
# @return [Integer] Hash code
|
127
|
+
def hash
|
128
|
+
[margin_account_wallet, depositkeep_rate, consignment_deposit_rate, cash_of_consignment_deposit_rate].hash
|
129
|
+
end
|
130
|
+
|
131
|
+
# Builds the object from hash
|
132
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
133
|
+
# @return [Object] Returns the model itself
|
134
|
+
def self.build_from_hash(attributes)
|
135
|
+
return nil unless attributes.is_a?(Hash)
|
136
|
+
attributes = attributes.transform_keys(&:to_sym)
|
137
|
+
transformed_hash = {}
|
138
|
+
openapi_types.each_pair do |key, type|
|
139
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
140
|
+
transformed_hash["#{key}"] = nil
|
141
|
+
elsif type =~ /\AArray<(.*)>/i
|
142
|
+
# check to ensure the input is an array given that the attribute
|
143
|
+
# is documented as an array but the input is not
|
144
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
145
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
146
|
+
end
|
147
|
+
elsif !attributes[attribute_map[key]].nil?
|
148
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
149
|
+
end
|
150
|
+
end
|
151
|
+
new(transformed_hash)
|
152
|
+
end
|
153
|
+
|
154
|
+
# Deserializes the data based on type
|
155
|
+
# @param string type Data type
|
156
|
+
# @param string value Value to be deserialized
|
157
|
+
# @return [Object] Deserialized data
|
158
|
+
def self._deserialize(type, value)
|
159
|
+
case type.to_sym
|
160
|
+
when :Time
|
161
|
+
Time.parse(value)
|
162
|
+
when :Date
|
163
|
+
Date.parse(value)
|
164
|
+
when :String
|
165
|
+
value.to_s
|
166
|
+
when :Integer
|
167
|
+
value.to_i
|
168
|
+
when :Float
|
169
|
+
value.to_f
|
170
|
+
when :Boolean
|
171
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
172
|
+
true
|
173
|
+
else
|
174
|
+
false
|
175
|
+
end
|
176
|
+
when :Object
|
177
|
+
# generic object (usually a Hash), return directly
|
178
|
+
value
|
179
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
180
|
+
inner_type = Regexp.last_match[:inner_type]
|
181
|
+
value.map { |v| _deserialize(inner_type, v) }
|
182
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
183
|
+
k_type = Regexp.last_match[:k_type]
|
184
|
+
v_type = Regexp.last_match[:v_type]
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each do |k, v|
|
187
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
else # model
|
191
|
+
# models (e.g. Pet) or oneOf
|
192
|
+
klass = KabustationClient.const_get(type)
|
193
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
# Returns the string representation of the object
|
198
|
+
# @return [String] String presentation of the object
|
199
|
+
def to_s
|
200
|
+
to_hash.to_s
|
201
|
+
end
|
202
|
+
|
203
|
+
# to_body is an alias to to_hash (backward compatibility)
|
204
|
+
# @return [Hash] Returns the object in the form of hash
|
205
|
+
def to_body
|
206
|
+
to_hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the object in the form of hash
|
210
|
+
# @return [Hash] Returns the object in the form of hash
|
211
|
+
def to_hash
|
212
|
+
hash = {}
|
213
|
+
self.class.attribute_map.each_pair do |attr, param|
|
214
|
+
value = self.send(attr)
|
215
|
+
if value.nil?
|
216
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
217
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
218
|
+
end
|
219
|
+
|
220
|
+
hash[param] = _to_hash(value)
|
221
|
+
end
|
222
|
+
hash
|
223
|
+
end
|
224
|
+
|
225
|
+
# Outputs non-array value in the form of hash
|
226
|
+
# For object, use to_hash. Otherwise, just return the value
|
227
|
+
# @param [Object] value Any valid value
|
228
|
+
# @return [Hash] Returns the value in the form of hash
|
229
|
+
def _to_hash(value)
|
230
|
+
if value.is_a?(Array)
|
231
|
+
value.compact.map { |v| _to_hash(v) }
|
232
|
+
elsif value.is_a?(Hash)
|
233
|
+
{}.tap do |hash|
|
234
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
235
|
+
end
|
236
|
+
elsif value.respond_to? :to_hash
|
237
|
+
value.to_hash
|
238
|
+
else
|
239
|
+
value
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
end
|
244
|
+
|
245
|
+
end
|
@@ -0,0 +1,235 @@
|
|
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 WalletOptionSuccess
|
18
|
+
# 買新規建玉可能額
|
19
|
+
attr_accessor :option_buy_trade_limit
|
20
|
+
|
21
|
+
# 売新規建玉可能額
|
22
|
+
attr_accessor :option_sell_trade_limit
|
23
|
+
|
24
|
+
# 必要証拠金額<br>※銘柄指定の場合のみ。<br>※銘柄が指定されなかった場合、空を返す。
|
25
|
+
attr_accessor :margin_requirement
|
26
|
+
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
28
|
+
def self.attribute_map
|
29
|
+
{
|
30
|
+
:'option_buy_trade_limit' => :'OptionBuyTradeLimit',
|
31
|
+
:'option_sell_trade_limit' => :'OptionSellTradeLimit',
|
32
|
+
:'margin_requirement' => :'MarginRequirement'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Returns all the JSON keys this model knows about
|
37
|
+
def self.acceptable_attributes
|
38
|
+
attribute_map.values
|
39
|
+
end
|
40
|
+
|
41
|
+
# Attribute type mapping.
|
42
|
+
def self.openapi_types
|
43
|
+
{
|
44
|
+
:'option_buy_trade_limit' => :'Float',
|
45
|
+
:'option_sell_trade_limit' => :'Float',
|
46
|
+
:'margin_requirement' => :'Float'
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
# List of attributes with nullable: true
|
51
|
+
def self.openapi_nullable
|
52
|
+
Set.new([
|
53
|
+
])
|
54
|
+
end
|
55
|
+
|
56
|
+
# Initializes the object
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
58
|
+
def initialize(attributes = {})
|
59
|
+
if (!attributes.is_a?(Hash))
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `KabustationClient::WalletOptionSuccess` initialize method"
|
61
|
+
end
|
62
|
+
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
65
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `KabustationClient::WalletOptionSuccess`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
67
|
+
end
|
68
|
+
h[k.to_sym] = v
|
69
|
+
}
|
70
|
+
|
71
|
+
if attributes.key?(:'option_buy_trade_limit')
|
72
|
+
self.option_buy_trade_limit = attributes[:'option_buy_trade_limit']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.key?(:'option_sell_trade_limit')
|
76
|
+
self.option_sell_trade_limit = attributes[:'option_sell_trade_limit']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.key?(:'margin_requirement')
|
80
|
+
self.margin_requirement = attributes[:'margin_requirement']
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
85
|
+
# @return Array for valid properties with the reasons
|
86
|
+
def list_invalid_properties
|
87
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
88
|
+
invalid_properties = Array.new
|
89
|
+
invalid_properties
|
90
|
+
end
|
91
|
+
|
92
|
+
# Check to see if the all the properties in the model are valid
|
93
|
+
# @return true if the model is valid
|
94
|
+
def valid?
|
95
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
96
|
+
true
|
97
|
+
end
|
98
|
+
|
99
|
+
# Checks equality by comparing each attribute.
|
100
|
+
# @param [Object] Object to be compared
|
101
|
+
def ==(o)
|
102
|
+
return true if self.equal?(o)
|
103
|
+
self.class == o.class &&
|
104
|
+
option_buy_trade_limit == o.option_buy_trade_limit &&
|
105
|
+
option_sell_trade_limit == o.option_sell_trade_limit &&
|
106
|
+
margin_requirement == o.margin_requirement
|
107
|
+
end
|
108
|
+
|
109
|
+
# @see the `==` method
|
110
|
+
# @param [Object] Object to be compared
|
111
|
+
def eql?(o)
|
112
|
+
self == o
|
113
|
+
end
|
114
|
+
|
115
|
+
# Calculates hash code according to all attributes.
|
116
|
+
# @return [Integer] Hash code
|
117
|
+
def hash
|
118
|
+
[option_buy_trade_limit, option_sell_trade_limit, margin_requirement].hash
|
119
|
+
end
|
120
|
+
|
121
|
+
# Builds the object from hash
|
122
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
123
|
+
# @return [Object] Returns the model itself
|
124
|
+
def self.build_from_hash(attributes)
|
125
|
+
return nil unless attributes.is_a?(Hash)
|
126
|
+
attributes = attributes.transform_keys(&:to_sym)
|
127
|
+
transformed_hash = {}
|
128
|
+
openapi_types.each_pair do |key, type|
|
129
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
130
|
+
transformed_hash["#{key}"] = nil
|
131
|
+
elsif type =~ /\AArray<(.*)>/i
|
132
|
+
# check to ensure the input is an array given that the attribute
|
133
|
+
# is documented as an array but the input is not
|
134
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
135
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
136
|
+
end
|
137
|
+
elsif !attributes[attribute_map[key]].nil?
|
138
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
139
|
+
end
|
140
|
+
end
|
141
|
+
new(transformed_hash)
|
142
|
+
end
|
143
|
+
|
144
|
+
# Deserializes the data based on type
|
145
|
+
# @param string type Data type
|
146
|
+
# @param string value Value to be deserialized
|
147
|
+
# @return [Object] Deserialized data
|
148
|
+
def self._deserialize(type, value)
|
149
|
+
case type.to_sym
|
150
|
+
when :Time
|
151
|
+
Time.parse(value)
|
152
|
+
when :Date
|
153
|
+
Date.parse(value)
|
154
|
+
when :String
|
155
|
+
value.to_s
|
156
|
+
when :Integer
|
157
|
+
value.to_i
|
158
|
+
when :Float
|
159
|
+
value.to_f
|
160
|
+
when :Boolean
|
161
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
162
|
+
true
|
163
|
+
else
|
164
|
+
false
|
165
|
+
end
|
166
|
+
when :Object
|
167
|
+
# generic object (usually a Hash), return directly
|
168
|
+
value
|
169
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
170
|
+
inner_type = Regexp.last_match[:inner_type]
|
171
|
+
value.map { |v| _deserialize(inner_type, v) }
|
172
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
173
|
+
k_type = Regexp.last_match[:k_type]
|
174
|
+
v_type = Regexp.last_match[:v_type]
|
175
|
+
{}.tap do |hash|
|
176
|
+
value.each do |k, v|
|
177
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
else # model
|
181
|
+
# models (e.g. Pet) or oneOf
|
182
|
+
klass = KabustationClient.const_get(type)
|
183
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the string representation of the object
|
188
|
+
# @return [String] String presentation of the object
|
189
|
+
def to_s
|
190
|
+
to_hash.to_s
|
191
|
+
end
|
192
|
+
|
193
|
+
# to_body is an alias to to_hash (backward compatibility)
|
194
|
+
# @return [Hash] Returns the object in the form of hash
|
195
|
+
def to_body
|
196
|
+
to_hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Returns the object in the form of hash
|
200
|
+
# @return [Hash] Returns the object in the form of hash
|
201
|
+
def to_hash
|
202
|
+
hash = {}
|
203
|
+
self.class.attribute_map.each_pair do |attr, param|
|
204
|
+
value = self.send(attr)
|
205
|
+
if value.nil?
|
206
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
207
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
208
|
+
end
|
209
|
+
|
210
|
+
hash[param] = _to_hash(value)
|
211
|
+
end
|
212
|
+
hash
|
213
|
+
end
|
214
|
+
|
215
|
+
# Outputs non-array value in the form of hash
|
216
|
+
# For object, use to_hash. Otherwise, just return the value
|
217
|
+
# @param [Object] value Any valid value
|
218
|
+
# @return [Hash] Returns the value in the form of hash
|
219
|
+
def _to_hash(value)
|
220
|
+
if value.is_a?(Array)
|
221
|
+
value.compact.map { |v| _to_hash(v) }
|
222
|
+
elsif value.is_a?(Hash)
|
223
|
+
{}.tap do |hash|
|
224
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
225
|
+
end
|
226
|
+
elsif value.respond_to? :to_hash
|
227
|
+
value.to_hash
|
228
|
+
else
|
229
|
+
value
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
end
|
234
|
+
|
235
|
+
end
|
@@ -0,0 +1,15 @@
|
|
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
|
+
module KabustationClient
|
14
|
+
VERSION = '1.0.0'
|
15
|
+
end
|
@@ -0,0 +1,112 @@
|
|
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
|
+
# Common files
|
14
|
+
require 'kabustation_client/api_client'
|
15
|
+
require 'kabustation_client/api_error'
|
16
|
+
require 'kabustation_client/version'
|
17
|
+
require 'kabustation_client/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'kabustation_client/models/api_soft_limit_response'
|
21
|
+
require 'kabustation_client/models/board_success'
|
22
|
+
require 'kabustation_client/models/board_success_buy1'
|
23
|
+
require 'kabustation_client/models/board_success_buy10'
|
24
|
+
require 'kabustation_client/models/board_success_buy2'
|
25
|
+
require 'kabustation_client/models/board_success_buy3'
|
26
|
+
require 'kabustation_client/models/board_success_buy4'
|
27
|
+
require 'kabustation_client/models/board_success_buy5'
|
28
|
+
require 'kabustation_client/models/board_success_buy6'
|
29
|
+
require 'kabustation_client/models/board_success_buy7'
|
30
|
+
require 'kabustation_client/models/board_success_buy8'
|
31
|
+
require 'kabustation_client/models/board_success_buy9'
|
32
|
+
require 'kabustation_client/models/board_success_sell1'
|
33
|
+
require 'kabustation_client/models/board_success_sell10'
|
34
|
+
require 'kabustation_client/models/board_success_sell2'
|
35
|
+
require 'kabustation_client/models/board_success_sell3'
|
36
|
+
require 'kabustation_client/models/board_success_sell4'
|
37
|
+
require 'kabustation_client/models/board_success_sell5'
|
38
|
+
require 'kabustation_client/models/board_success_sell6'
|
39
|
+
require 'kabustation_client/models/board_success_sell7'
|
40
|
+
require 'kabustation_client/models/board_success_sell8'
|
41
|
+
require 'kabustation_client/models/board_success_sell9'
|
42
|
+
require 'kabustation_client/models/error_response'
|
43
|
+
require 'kabustation_client/models/exchange_response'
|
44
|
+
require 'kabustation_client/models/margin_premium_response'
|
45
|
+
require 'kabustation_client/models/margin_premium_response_day_trade'
|
46
|
+
require 'kabustation_client/models/margin_premium_response_general_margin'
|
47
|
+
require 'kabustation_client/models/order_success'
|
48
|
+
require 'kabustation_client/models/orders_success'
|
49
|
+
require 'kabustation_client/models/orders_success_details_inner'
|
50
|
+
require 'kabustation_client/models/positions'
|
51
|
+
require 'kabustation_client/models/positions_deriv'
|
52
|
+
require 'kabustation_client/models/positions_success'
|
53
|
+
require 'kabustation_client/models/primary_exchange_response'
|
54
|
+
require 'kabustation_client/models/ranking_by_category_response'
|
55
|
+
require 'kabustation_client/models/ranking_by_category_response_ranking_inner'
|
56
|
+
require 'kabustation_client/models/ranking_by_margin_response'
|
57
|
+
require 'kabustation_client/models/ranking_by_margin_response_ranking_inner'
|
58
|
+
require 'kabustation_client/models/ranking_by_tick_count_response'
|
59
|
+
require 'kabustation_client/models/ranking_by_tick_count_response_ranking_inner'
|
60
|
+
require 'kabustation_client/models/ranking_by_trade_value_response'
|
61
|
+
require 'kabustation_client/models/ranking_by_trade_value_response_ranking_inner'
|
62
|
+
require 'kabustation_client/models/ranking_by_trade_volume_response'
|
63
|
+
require 'kabustation_client/models/ranking_by_trade_volume_response_ranking_inner'
|
64
|
+
require 'kabustation_client/models/ranking_default_response'
|
65
|
+
require 'kabustation_client/models/ranking_default_response_ranking_inner'
|
66
|
+
require 'kabustation_client/models/ranking_get200_response'
|
67
|
+
require 'kabustation_client/models/regist_success'
|
68
|
+
require 'kabustation_client/models/regulations_response'
|
69
|
+
require 'kabustation_client/models/regulations_response_regulations_info_inner'
|
70
|
+
require 'kabustation_client/models/request_cancel_order'
|
71
|
+
require 'kabustation_client/models/request_register'
|
72
|
+
require 'kabustation_client/models/request_register_symbols_inner'
|
73
|
+
require 'kabustation_client/models/request_send_order'
|
74
|
+
require 'kabustation_client/models/request_send_order_deriv_future'
|
75
|
+
require 'kabustation_client/models/request_send_order_deriv_future_reverse_limit_order'
|
76
|
+
require 'kabustation_client/models/request_send_order_deriv_option'
|
77
|
+
require 'kabustation_client/models/request_send_order_reverse_limit_order'
|
78
|
+
require 'kabustation_client/models/request_token'
|
79
|
+
require 'kabustation_client/models/request_unregister'
|
80
|
+
require 'kabustation_client/models/symbol_name_success'
|
81
|
+
require 'kabustation_client/models/symbol_success'
|
82
|
+
require 'kabustation_client/models/token_success'
|
83
|
+
require 'kabustation_client/models/unregister_all_success'
|
84
|
+
require 'kabustation_client/models/wallet_cash_success'
|
85
|
+
require 'kabustation_client/models/wallet_future_success'
|
86
|
+
require 'kabustation_client/models/wallet_margin_success'
|
87
|
+
require 'kabustation_client/models/wallet_option_success'
|
88
|
+
|
89
|
+
# APIs
|
90
|
+
require 'kabustation_client/api/auth_api'
|
91
|
+
require 'kabustation_client/api/info_api'
|
92
|
+
require 'kabustation_client/api/order_api'
|
93
|
+
require 'kabustation_client/api/register_api'
|
94
|
+
require 'kabustation_client/api/wallet_api'
|
95
|
+
|
96
|
+
module KabustationClient
|
97
|
+
class << self
|
98
|
+
# Customize default settings for the SDK using block.
|
99
|
+
# KabustationClient.configure do |config|
|
100
|
+
# config.username = "xxx"
|
101
|
+
# config.password = "xxx"
|
102
|
+
# end
|
103
|
+
# If no block given, return the default Configuration object.
|
104
|
+
def configure
|
105
|
+
if block_given?
|
106
|
+
yield(Configuration.default)
|
107
|
+
else
|
108
|
+
Configuration.default
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,47 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for KabustationClient::AuthApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'AuthApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = KabustationClient::AuthApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of AuthApi' do
|
30
|
+
it 'should create an instance of AuthApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(KabustationClient::AuthApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for token_post
|
36
|
+
# トークン発行
|
37
|
+
# APIトークンを発行します。<br> 発行したトークンは有効である限り使用することができ、リクエストごとに発行する必要はありません。<br> 発行されたAPIトークンは以下のタイミングで無効となります。<br> ・kabuステーションを終了した時<br> ・kabuステーションからログアウトした時<br> ・別のトークンが新たに発行された時<br> ※kabuステーションは早朝、強制的にログアウトいたしますのでご留意ください。<br>
|
38
|
+
# @param request_token
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [TokenSuccess]
|
41
|
+
describe 'token_post test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|