moov_ruby 0.3.17 → 0.3.19
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 +4 -4
- data/lib/moov/accounts.rb +276 -0
- data/lib/moov/invoices.rb +1 -1
- data/lib/moov/models/components/createtransfer.rb +2 -2
- data/lib/moov/models/components/createtransferlineitem.rb +53 -0
- data/lib/moov/models/components/{transferlineitemvalidationerror.rbi → createtransferlineitem.rbi} +8 -6
- data/lib/moov/models/components/createtransferlineitemoption.rb +49 -0
- data/lib/moov/models/components/{transferlineitemoptionvalidationerror.rbi → createtransferlineitemoption.rbi} +8 -6
- data/lib/moov/models/components/{transferlineitemoptionvalidationerror.rb → createtransferlineitemoptionvalidationerror.rb} +7 -3
- data/lib/moov/models/components/createtransferlineitemoptionvalidationerror.rbi +21 -0
- data/lib/moov/models/components/createtransferlineitems.rb +34 -0
- data/lib/moov/models/components/{transferlineitemsvalidationerror.rbi → createtransferlineitems.rbi} +2 -2
- data/lib/moov/models/components/{transferlineitemsvalidationerror.rb → createtransferlineitemsvalidationerror.rb} +3 -3
- data/lib/moov/models/components/createtransferlineitemsvalidationerror.rbi +13 -0
- data/lib/moov/models/components/{transferlineitemvalidationerror.rb → createtransferlineitemvalidationerror.rb} +8 -4
- data/lib/moov/models/components/createtransferlineitemvalidationerror.rbi +23 -0
- data/lib/moov/models/components/sharescopes.rb +37 -0
- data/lib/moov/models/components/sharescopes.rbi +15 -0
- data/lib/moov/models/components/transferlineitem.rb +6 -2
- data/lib/moov/models/components/transferlineitem.rbi +2 -0
- data/lib/moov/models/components/transferlineitemimagemetadata.rb +45 -0
- data/lib/moov/models/components/transferlineitemimagemetadata.rbi +19 -0
- data/lib/moov/models/components/transferlineitemoption.rb +6 -2
- data/lib/moov/models/components/transferlineitemoption.rbi +2 -0
- data/lib/moov/models/components.rb +8 -3
- data/lib/moov/models/errors/connectaccountrequestvalidationerror.rb +41 -0
- data/lib/moov/models/errors/connectaccountrequestvalidationerror.rbi +17 -0
- data/lib/moov/models/errors/transfervalidationerror.rb +2 -2
- data/lib/moov/models/errors.rb +1 -0
- data/lib/moov/models/operations/connectaccount_request.rb +50 -0
- data/lib/moov/models/operations/connectaccount_request.rbi +17 -0
- data/lib/moov/models/operations/connectaccount_response.rb +45 -0
- data/lib/moov/models/operations/connectaccount_response.rbi +19 -0
- data/lib/moov/models/operations/listconnectedaccountsforaccount_request.rb +101 -0
- data/lib/moov/models/operations/listconnectedaccountsforaccount_request.rbi +33 -0
- data/lib/moov/models/operations/listconnectedaccountsforaccount_response.rb +49 -0
- data/lib/moov/models/operations/listconnectedaccountsforaccount_response.rbi +21 -0
- data/lib/moov/models/operations.rb +4 -0
- data/lib/moov/sdkconfiguration.rb +3 -3
- metadata +28 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ecb87a15d2b950f6f0f733c2699a40ffff3bbf379c16b844b8d8566a652b1578
|
|
4
|
+
data.tar.gz: d7849126a9980adf9e884fb433440f1d8ecce325aaa37a719ae309e0e8eb41e3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d67960ae8a0c48186084d10fdc1a2e8763b2b7d5f88ae50b2523f8e9edec60f12268526a9535bf5d0178851587f07c3e3b965360ec340fd308d953c86d358468
|
|
7
|
+
data.tar.gz: 6d7474504e3a1fd8630e61a6d3c8bc03c5cb97dbc4b76dfd71b3a9009d3b1c6a3d1880133032cdbcb8fa9e1cfe55e70dc12941b694cfd50c927ec2576763629a
|
data/lib/moov/accounts.rb
CHANGED
|
@@ -746,6 +746,282 @@ module Moov
|
|
|
746
746
|
end
|
|
747
747
|
|
|
748
748
|
|
|
749
|
+
sig { params(request: Models::Operations::ListConnectedAccountsForAccountRequest, timeout_ms: T.nilable(Integer)).returns(Models::Operations::ListConnectedAccountsForAccountResponse) }
|
|
750
|
+
def list_connected(request:, timeout_ms: nil)
|
|
751
|
+
# list_connected - List or search accounts to which the caller is connected.
|
|
752
|
+
#
|
|
753
|
+
# All supported query parameters are optional. If none are provided the response will include all connected accounts.
|
|
754
|
+
# Pagination is supported via the `skip` and `count` query parameters. Searching by name and email will overlap and
|
|
755
|
+
# return results based on relevance. Accounts with AccountType `guest` will not be included in the response.
|
|
756
|
+
#
|
|
757
|
+
# To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) you'll need
|
|
758
|
+
# to specify the `/accounts.read` scope.
|
|
759
|
+
url, params = @sdk_configuration.get_server_details
|
|
760
|
+
base_url = Utils.template_url(url, params)
|
|
761
|
+
url = Utils.generate_url(
|
|
762
|
+
Models::Operations::ListConnectedAccountsForAccountRequest,
|
|
763
|
+
base_url,
|
|
764
|
+
'/accounts/{accountID}/connected-accounts',
|
|
765
|
+
request,
|
|
766
|
+
@sdk_configuration.globals
|
|
767
|
+
)
|
|
768
|
+
headers = Utils.get_headers(request, @sdk_configuration.globals)
|
|
769
|
+
headers = T.cast(headers, T::Hash[String, String])
|
|
770
|
+
query_params = Utils.get_query_params(Models::Operations::ListConnectedAccountsForAccountRequest, request, nil, @sdk_configuration.globals)
|
|
771
|
+
headers['Accept'] = 'application/json'
|
|
772
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
773
|
+
|
|
774
|
+
security = @sdk_configuration.security_source&.call
|
|
775
|
+
|
|
776
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
777
|
+
timeout ||= @sdk_configuration.timeout
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
connection = @sdk_configuration.client
|
|
781
|
+
|
|
782
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
783
|
+
config: @sdk_configuration,
|
|
784
|
+
base_url: base_url,
|
|
785
|
+
oauth2_scopes: nil,
|
|
786
|
+
operation_id: 'listConnectedAccountsForAccount',
|
|
787
|
+
security_source: @sdk_configuration.security_source
|
|
788
|
+
)
|
|
789
|
+
|
|
790
|
+
error = T.let(nil, T.nilable(StandardError))
|
|
791
|
+
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
792
|
+
|
|
793
|
+
|
|
794
|
+
begin
|
|
795
|
+
http_response = T.must(connection).get(url) do |req|
|
|
796
|
+
req.headers.merge!(headers)
|
|
797
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
798
|
+
req.params = query_params
|
|
799
|
+
Utils.configure_request_security(req, security)
|
|
800
|
+
|
|
801
|
+
@sdk_configuration.hooks.before_request(
|
|
802
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
803
|
+
hook_ctx: hook_ctx
|
|
804
|
+
),
|
|
805
|
+
request: req
|
|
806
|
+
)
|
|
807
|
+
end
|
|
808
|
+
rescue StandardError => e
|
|
809
|
+
error = e
|
|
810
|
+
ensure
|
|
811
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
812
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
813
|
+
error: error,
|
|
814
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
815
|
+
hook_ctx: hook_ctx
|
|
816
|
+
),
|
|
817
|
+
response: http_response
|
|
818
|
+
)
|
|
819
|
+
else
|
|
820
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
821
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
822
|
+
hook_ctx: hook_ctx
|
|
823
|
+
),
|
|
824
|
+
response: http_response
|
|
825
|
+
)
|
|
826
|
+
end
|
|
827
|
+
|
|
828
|
+
if http_response.nil?
|
|
829
|
+
raise error if !error.nil?
|
|
830
|
+
raise 'no response'
|
|
831
|
+
end
|
|
832
|
+
end
|
|
833
|
+
|
|
834
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
835
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
836
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
837
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
838
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
839
|
+
hook_ctx: hook_ctx
|
|
840
|
+
),
|
|
841
|
+
response: http_response
|
|
842
|
+
)
|
|
843
|
+
response_data = http_response.env.response_body
|
|
844
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Crystalline::Array.new(Models::Components::Account))
|
|
845
|
+
response = Models::Operations::ListConnectedAccountsForAccountResponse.new(
|
|
846
|
+
status_code: http_response.status,
|
|
847
|
+
content_type: content_type,
|
|
848
|
+
raw_response: http_response,
|
|
849
|
+
headers: http_response.headers,
|
|
850
|
+
accounts: T.unsafe(obj)
|
|
851
|
+
)
|
|
852
|
+
|
|
853
|
+
return response
|
|
854
|
+
else
|
|
855
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
856
|
+
end
|
|
857
|
+
elsif Utils.match_status_code(http_response.status, ['401', '403', '429'])
|
|
858
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
859
|
+
elsif Utils.match_status_code(http_response.status, ['500', '504'])
|
|
860
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
861
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
862
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
863
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
864
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
865
|
+
else
|
|
866
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
|
867
|
+
|
|
868
|
+
end
|
|
869
|
+
end
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
sig { params(share_scopes: Models::Components::ShareScopes, account_id: ::String, x_moov_version: T.nilable(::String), timeout_ms: T.nilable(Integer)).returns(Models::Operations::ConnectAccountResponse) }
|
|
873
|
+
def connect(share_scopes:, account_id:, x_moov_version: nil, timeout_ms: nil)
|
|
874
|
+
# connect - Shares access scopes from the account specified to the caller, establishing a connection
|
|
875
|
+
# between the two accounts with the specified permissions.
|
|
876
|
+
request = Models::Operations::ConnectAccountRequest.new(
|
|
877
|
+
account_id: account_id,
|
|
878
|
+
share_scopes: share_scopes,
|
|
879
|
+
x_moov_version: x_moov_version
|
|
880
|
+
)
|
|
881
|
+
url, params = @sdk_configuration.get_server_details
|
|
882
|
+
base_url = Utils.template_url(url, params)
|
|
883
|
+
url = Utils.generate_url(
|
|
884
|
+
Models::Operations::ConnectAccountRequest,
|
|
885
|
+
base_url,
|
|
886
|
+
'/accounts/{accountID}/connections',
|
|
887
|
+
request,
|
|
888
|
+
@sdk_configuration.globals
|
|
889
|
+
)
|
|
890
|
+
headers = Utils.get_headers(request, @sdk_configuration.globals)
|
|
891
|
+
headers = T.cast(headers, T::Hash[String, String])
|
|
892
|
+
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :share_scopes, :json)
|
|
893
|
+
headers['content-type'] = req_content_type
|
|
894
|
+
raise StandardError, 'request body is required' if data.nil? && form.nil?
|
|
895
|
+
|
|
896
|
+
if form
|
|
897
|
+
body = Utils.encode_form(form)
|
|
898
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
|
899
|
+
body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object]))
|
|
900
|
+
else
|
|
901
|
+
body = data
|
|
902
|
+
end
|
|
903
|
+
headers['Accept'] = 'application/json'
|
|
904
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
905
|
+
|
|
906
|
+
security = @sdk_configuration.security_source&.call
|
|
907
|
+
|
|
908
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
909
|
+
timeout ||= @sdk_configuration.timeout
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
connection = @sdk_configuration.client
|
|
913
|
+
|
|
914
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
915
|
+
config: @sdk_configuration,
|
|
916
|
+
base_url: base_url,
|
|
917
|
+
oauth2_scopes: nil,
|
|
918
|
+
operation_id: 'connectAccount',
|
|
919
|
+
security_source: @sdk_configuration.security_source
|
|
920
|
+
)
|
|
921
|
+
|
|
922
|
+
error = T.let(nil, T.nilable(StandardError))
|
|
923
|
+
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
924
|
+
|
|
925
|
+
|
|
926
|
+
begin
|
|
927
|
+
http_response = T.must(connection).post(url) do |req|
|
|
928
|
+
req.body = body
|
|
929
|
+
req.headers.merge!(headers)
|
|
930
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
931
|
+
Utils.configure_request_security(req, security)
|
|
932
|
+
|
|
933
|
+
@sdk_configuration.hooks.before_request(
|
|
934
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
935
|
+
hook_ctx: hook_ctx
|
|
936
|
+
),
|
|
937
|
+
request: req
|
|
938
|
+
)
|
|
939
|
+
end
|
|
940
|
+
rescue StandardError => e
|
|
941
|
+
error = e
|
|
942
|
+
ensure
|
|
943
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
944
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
945
|
+
error: error,
|
|
946
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
947
|
+
hook_ctx: hook_ctx
|
|
948
|
+
),
|
|
949
|
+
response: http_response
|
|
950
|
+
)
|
|
951
|
+
else
|
|
952
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
953
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
954
|
+
hook_ctx: hook_ctx
|
|
955
|
+
),
|
|
956
|
+
response: http_response
|
|
957
|
+
)
|
|
958
|
+
end
|
|
959
|
+
|
|
960
|
+
if http_response.nil?
|
|
961
|
+
raise error if !error.nil?
|
|
962
|
+
raise 'no response'
|
|
963
|
+
end
|
|
964
|
+
end
|
|
965
|
+
|
|
966
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
967
|
+
if Utils.match_status_code(http_response.status, ['201'])
|
|
968
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
969
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
970
|
+
hook_ctx: hook_ctx
|
|
971
|
+
),
|
|
972
|
+
response: http_response
|
|
973
|
+
)
|
|
974
|
+
return Models::Operations::ConnectAccountResponse.new(
|
|
975
|
+
status_code: http_response.status,
|
|
976
|
+
content_type: content_type,
|
|
977
|
+
raw_response: http_response,
|
|
978
|
+
headers: {}
|
|
979
|
+
)
|
|
980
|
+
elsif Utils.match_status_code(http_response.status, ['400', '409'])
|
|
981
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
982
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
983
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
984
|
+
hook_ctx: hook_ctx
|
|
985
|
+
),
|
|
986
|
+
response: http_response
|
|
987
|
+
)
|
|
988
|
+
response_data = http_response.env.response_body
|
|
989
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::GenericError)
|
|
990
|
+
obj.raw_response = http_response
|
|
991
|
+
raise obj
|
|
992
|
+
else
|
|
993
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
994
|
+
end
|
|
995
|
+
elsif Utils.match_status_code(http_response.status, ['422'])
|
|
996
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
997
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
998
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
999
|
+
hook_ctx: hook_ctx
|
|
1000
|
+
),
|
|
1001
|
+
response: http_response
|
|
1002
|
+
)
|
|
1003
|
+
response_data = http_response.env.response_body
|
|
1004
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ConnectAccountRequestValidationError)
|
|
1005
|
+
obj.raw_response = http_response
|
|
1006
|
+
raise obj
|
|
1007
|
+
else
|
|
1008
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
1009
|
+
end
|
|
1010
|
+
elsif Utils.match_status_code(http_response.status, ['401', '403', '404', '429'])
|
|
1011
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
1012
|
+
elsif Utils.match_status_code(http_response.status, ['500', '504'])
|
|
1013
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
1014
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
1015
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
1016
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
1017
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
1018
|
+
else
|
|
1019
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
|
1020
|
+
|
|
1021
|
+
end
|
|
1022
|
+
end
|
|
1023
|
+
|
|
1024
|
+
|
|
749
1025
|
sig { params(account_id: ::String, x_moov_version: T.nilable(::String), timeout_ms: T.nilable(Integer)).returns(Models::Operations::GetAccountCountriesResponse) }
|
|
750
1026
|
def get_countries(account_id:, x_moov_version: nil, timeout_ms: nil)
|
|
751
1027
|
# get_countries - Retrieve the specified countries of operation for an account.
|
data/lib/moov/invoices.rb
CHANGED
|
@@ -31,9 +31,9 @@ module Moov
|
|
|
31
31
|
field :foreign_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('foreignID') } }
|
|
32
32
|
# An optional collection of line items for a transfer.
|
|
33
33
|
# When line items are provided, their total plus sales tax must equal the transfer amount.
|
|
34
|
-
field :line_items, Crystalline::Nilable.new(Models::Components::
|
|
34
|
+
field :line_items, Crystalline::Nilable.new(Models::Components::CreateTransferLineItems), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('lineItems') } }
|
|
35
35
|
|
|
36
|
-
sig { params(source: Models::Components::CreateTransferSource, destination: Models::Components::CreateTransferDestination, amount: Models::Components::Amount, facilitator_fee: T.nilable(Models::Components::FacilitatorFee), description: T.nilable(::String), metadata: T.nilable(T::Hash[Symbol, ::String]), sales_tax_amount: T.nilable(Models::Components::Amount), foreign_id: T.nilable(::String), line_items: T.nilable(Models::Components::
|
|
36
|
+
sig { params(source: Models::Components::CreateTransferSource, destination: Models::Components::CreateTransferDestination, amount: Models::Components::Amount, facilitator_fee: T.nilable(Models::Components::FacilitatorFee), description: T.nilable(::String), metadata: T.nilable(T::Hash[Symbol, ::String]), sales_tax_amount: T.nilable(Models::Components::Amount), foreign_id: T.nilable(::String), line_items: T.nilable(Models::Components::CreateTransferLineItems)).void }
|
|
37
37
|
def initialize(source:, destination:, amount:, facilitator_fee: nil, description: nil, metadata: nil, sales_tax_amount: nil, foreign_id: nil, line_items: nil)
|
|
38
38
|
@source = source
|
|
39
39
|
@destination = destination
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Moov
|
|
8
|
+
module Models
|
|
9
|
+
module Components
|
|
10
|
+
|
|
11
|
+
# Represents a single item in a transfer, including optional modifiers and quantity.
|
|
12
|
+
class CreateTransferLineItem
|
|
13
|
+
extend T::Sig
|
|
14
|
+
include Crystalline::MetadataFields
|
|
15
|
+
|
|
16
|
+
# The name of the item.
|
|
17
|
+
field :name, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('name'), required: true } }
|
|
18
|
+
# The base price of the item before applying option modifiers.
|
|
19
|
+
field :base_price, Models::Components::AmountDecimal, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('basePrice'), required: true } }
|
|
20
|
+
# The quantity of this item.
|
|
21
|
+
field :quantity, ::Integer, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('quantity'), required: true } }
|
|
22
|
+
# Optional list of modifiers applied to this item (e.g., toppings, upgrades, customizations).
|
|
23
|
+
field :options, Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::CreateTransferLineItemOption)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('options') } }
|
|
24
|
+
# Optional list of images associated with this line item.
|
|
25
|
+
field :image_i_ds, Crystalline::Nilable.new(Crystalline::Array.new(::String)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('imageIDs') } }
|
|
26
|
+
# Optional unique identifier associating the line item with a product.
|
|
27
|
+
field :product_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('productID') } }
|
|
28
|
+
|
|
29
|
+
sig { params(name: ::String, base_price: Models::Components::AmountDecimal, quantity: ::Integer, options: T.nilable(T::Array[Models::Components::CreateTransferLineItemOption]), image_i_ds: T.nilable(T::Array[::String]), product_id: T.nilable(::String)).void }
|
|
30
|
+
def initialize(name:, base_price:, quantity:, options: nil, image_i_ds: nil, product_id: nil)
|
|
31
|
+
@name = name
|
|
32
|
+
@base_price = base_price
|
|
33
|
+
@quantity = quantity
|
|
34
|
+
@options = options
|
|
35
|
+
@image_i_ds = image_i_ds
|
|
36
|
+
@product_id = product_id
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
40
|
+
def ==(other)
|
|
41
|
+
return false unless other.is_a? self.class
|
|
42
|
+
return false unless @name == other.name
|
|
43
|
+
return false unless @base_price == other.base_price
|
|
44
|
+
return false unless @quantity == other.quantity
|
|
45
|
+
return false unless @options == other.options
|
|
46
|
+
return false unless @image_i_ds == other.image_i_ds
|
|
47
|
+
return false unless @product_id == other.product_id
|
|
48
|
+
true
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
data/lib/moov/models/components/{transferlineitemvalidationerror.rbi → createtransferlineitem.rbi}
RENAMED
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
class Moov::Models::Components::
|
|
5
|
+
class Moov::Models::Components::CreateTransferLineItem
|
|
6
6
|
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class Moov::Models::Components::
|
|
11
|
-
def product_id(); end
|
|
12
|
-
def product_id=(str_); end
|
|
10
|
+
class Moov::Models::Components::CreateTransferLineItem
|
|
13
11
|
def name(); end
|
|
14
12
|
def name=(str_); end
|
|
15
13
|
def base_price(); end
|
|
16
14
|
def base_price=(str_); end
|
|
17
|
-
def options(); end
|
|
18
|
-
def options=(str_); end
|
|
19
15
|
def quantity(); end
|
|
20
16
|
def quantity=(str_); end
|
|
17
|
+
def options(); end
|
|
18
|
+
def options=(str_); end
|
|
19
|
+
def image_i_ds(); end
|
|
20
|
+
def image_i_ds=(str_); end
|
|
21
|
+
def product_id(); end
|
|
22
|
+
def product_id=(str_); end
|
|
21
23
|
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Moov
|
|
8
|
+
module Models
|
|
9
|
+
module Components
|
|
10
|
+
|
|
11
|
+
# Represents a modifier or option applied to a line item.
|
|
12
|
+
class CreateTransferLineItemOption
|
|
13
|
+
extend T::Sig
|
|
14
|
+
include Crystalline::MetadataFields
|
|
15
|
+
|
|
16
|
+
# The name of the option or modifier.
|
|
17
|
+
field :name, ::String, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('name'), required: true } }
|
|
18
|
+
# The quantity of this option.
|
|
19
|
+
field :quantity, ::Integer, { 'format_json': { 'letter_case': ::Moov::Utils.field_name('quantity'), required: true } }
|
|
20
|
+
# Optional price modification applied by this option. Can be positive, negative, or zero.
|
|
21
|
+
field :price_modifier, Crystalline::Nilable.new(Models::Components::AmountDecimal), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('priceModifier') } }
|
|
22
|
+
# Optional list of images associated with this line item option.
|
|
23
|
+
field :image_i_ds, Crystalline::Nilable.new(Crystalline::Array.new(::String)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('imageIDs') } }
|
|
24
|
+
# Optional group identifier to categorize related options (e.g., 'toppings').
|
|
25
|
+
field :group, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('group') } }
|
|
26
|
+
|
|
27
|
+
sig { params(name: ::String, quantity: ::Integer, price_modifier: T.nilable(Models::Components::AmountDecimal), image_i_ds: T.nilable(T::Array[::String]), group: T.nilable(::String)).void }
|
|
28
|
+
def initialize(name:, quantity:, price_modifier: nil, image_i_ds: nil, group: nil)
|
|
29
|
+
@name = name
|
|
30
|
+
@quantity = quantity
|
|
31
|
+
@price_modifier = price_modifier
|
|
32
|
+
@image_i_ds = image_i_ds
|
|
33
|
+
@group = group
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
37
|
+
def ==(other)
|
|
38
|
+
return false unless other.is_a? self.class
|
|
39
|
+
return false unless @name == other.name
|
|
40
|
+
return false unless @quantity == other.quantity
|
|
41
|
+
return false unless @price_modifier == other.price_modifier
|
|
42
|
+
return false unless @image_i_ds == other.image_i_ds
|
|
43
|
+
return false unless @group == other.group
|
|
44
|
+
true
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -2,18 +2,20 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
class Moov::Models::Components::
|
|
5
|
+
class Moov::Models::Components::CreateTransferLineItemOption
|
|
6
6
|
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class Moov::Models::Components::
|
|
10
|
+
class Moov::Models::Components::CreateTransferLineItemOption
|
|
11
11
|
def name(); end
|
|
12
12
|
def name=(str_); end
|
|
13
|
-
def group(); end
|
|
14
|
-
def group=(str_); end
|
|
15
|
-
def price_modifier(); end
|
|
16
|
-
def price_modifier=(str_); end
|
|
17
13
|
def quantity(); end
|
|
18
14
|
def quantity=(str_); end
|
|
15
|
+
def price_modifier(); end
|
|
16
|
+
def price_modifier=(str_); end
|
|
17
|
+
def image_i_ds(); end
|
|
18
|
+
def image_i_ds=(str_); end
|
|
19
|
+
def group(); end
|
|
20
|
+
def group=(str_); end
|
|
19
21
|
end
|
|
@@ -9,7 +9,7 @@ module Moov
|
|
|
9
9
|
module Components
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class
|
|
12
|
+
class CreateTransferLineItemOptionValidationError
|
|
13
13
|
extend T::Sig
|
|
14
14
|
include Crystalline::MetadataFields
|
|
15
15
|
|
|
@@ -22,12 +22,15 @@ module Moov
|
|
|
22
22
|
|
|
23
23
|
field :quantity, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('quantity') } }
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
field :image_i_ds, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('imageIDs') } }
|
|
26
|
+
|
|
27
|
+
sig { params(name: T.nilable(::String), group: T.nilable(::String), price_modifier: T.nilable(Models::Components::AmountDecimalValidationError), quantity: T.nilable(::String), image_i_ds: T.nilable(::String)).void }
|
|
28
|
+
def initialize(name: nil, group: nil, price_modifier: nil, quantity: nil, image_i_ds: nil)
|
|
27
29
|
@name = name
|
|
28
30
|
@group = group
|
|
29
31
|
@price_modifier = price_modifier
|
|
30
32
|
@quantity = quantity
|
|
33
|
+
@image_i_ds = image_i_ds
|
|
31
34
|
end
|
|
32
35
|
|
|
33
36
|
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
@@ -37,6 +40,7 @@ module Moov
|
|
|
37
40
|
return false unless @group == other.group
|
|
38
41
|
return false unless @price_modifier == other.price_modifier
|
|
39
42
|
return false unless @quantity == other.quantity
|
|
43
|
+
return false unless @image_i_ds == other.image_i_ds
|
|
40
44
|
true
|
|
41
45
|
end
|
|
42
46
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Moov::Models::Components::CreateTransferLineItemOptionValidationError
|
|
6
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Moov::Models::Components::CreateTransferLineItemOptionValidationError
|
|
11
|
+
def name(); end
|
|
12
|
+
def name=(str_); end
|
|
13
|
+
def group(); end
|
|
14
|
+
def group=(str_); end
|
|
15
|
+
def price_modifier(); end
|
|
16
|
+
def price_modifier=(str_); end
|
|
17
|
+
def quantity(); end
|
|
18
|
+
def quantity=(str_); end
|
|
19
|
+
def image_i_ds(); end
|
|
20
|
+
def image_i_ds=(str_); end
|
|
21
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Moov
|
|
8
|
+
module Models
|
|
9
|
+
module Components
|
|
10
|
+
|
|
11
|
+
# An optional collection of line items for a transfer.
|
|
12
|
+
# When line items are provided, their total plus sales tax must equal the transfer amount.
|
|
13
|
+
class CreateTransferLineItems
|
|
14
|
+
extend T::Sig
|
|
15
|
+
include Crystalline::MetadataFields
|
|
16
|
+
|
|
17
|
+
# The list of line items.
|
|
18
|
+
field :items, Crystalline::Array.new(Models::Components::CreateTransferLineItem), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('items'), required: true } }
|
|
19
|
+
|
|
20
|
+
sig { params(items: T::Array[Models::Components::CreateTransferLineItem]).void }
|
|
21
|
+
def initialize(items:)
|
|
22
|
+
@items = items
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
26
|
+
def ==(other)
|
|
27
|
+
return false unless other.is_a? self.class
|
|
28
|
+
return false unless @items == other.items
|
|
29
|
+
true
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
data/lib/moov/models/components/{transferlineitemsvalidationerror.rbi → createtransferlineitems.rbi}
RENAMED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
class Moov::Models::Components::
|
|
5
|
+
class Moov::Models::Components::CreateTransferLineItems
|
|
6
6
|
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class Moov::Models::Components::
|
|
10
|
+
class Moov::Models::Components::CreateTransferLineItems
|
|
11
11
|
def items(); end
|
|
12
12
|
def items=(str_); end
|
|
13
13
|
end
|
|
@@ -9,14 +9,14 @@ module Moov
|
|
|
9
9
|
module Components
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class
|
|
12
|
+
class CreateTransferLineItemsValidationError
|
|
13
13
|
extend T::Sig
|
|
14
14
|
include Crystalline::MetadataFields
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
field :items, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, Models::Components::
|
|
17
|
+
field :items, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, Models::Components::CreateTransferLineItemValidationError)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('items') } }
|
|
18
18
|
|
|
19
|
-
sig { params(items: T.nilable(T::Hash[Symbol, Models::Components::
|
|
19
|
+
sig { params(items: T.nilable(T::Hash[Symbol, Models::Components::CreateTransferLineItemValidationError])).void }
|
|
20
20
|
def initialize(items: nil)
|
|
21
21
|
@items = items
|
|
22
22
|
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Moov::Models::Components::CreateTransferLineItemsValidationError
|
|
6
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Moov::Models::Components::CreateTransferLineItemsValidationError
|
|
11
|
+
def items(); end
|
|
12
|
+
def items=(str_); end
|
|
13
|
+
end
|
|
@@ -9,7 +9,7 @@ module Moov
|
|
|
9
9
|
module Components
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class
|
|
12
|
+
class CreateTransferLineItemValidationError
|
|
13
13
|
extend T::Sig
|
|
14
14
|
include Crystalline::MetadataFields
|
|
15
15
|
|
|
@@ -20,17 +20,20 @@ module Moov
|
|
|
20
20
|
|
|
21
21
|
field :base_price, Crystalline::Nilable.new(Models::Components::AmountDecimalValidationError), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('basePrice') } }
|
|
22
22
|
|
|
23
|
-
field :options, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, Models::Components::
|
|
23
|
+
field :options, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, Models::Components::CreateTransferLineItemOptionValidationError)), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('options') } }
|
|
24
24
|
|
|
25
25
|
field :quantity, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('quantity') } }
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
field :image_i_ds, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::Moov::Utils.field_name('imageIDs') } }
|
|
28
|
+
|
|
29
|
+
sig { params(product_id: T.nilable(::String), name: T.nilable(::String), base_price: T.nilable(Models::Components::AmountDecimalValidationError), options: T.nilable(T::Hash[Symbol, Models::Components::CreateTransferLineItemOptionValidationError]), quantity: T.nilable(::String), image_i_ds: T.nilable(::String)).void }
|
|
30
|
+
def initialize(product_id: nil, name: nil, base_price: nil, options: nil, quantity: nil, image_i_ds: nil)
|
|
29
31
|
@product_id = product_id
|
|
30
32
|
@name = name
|
|
31
33
|
@base_price = base_price
|
|
32
34
|
@options = options
|
|
33
35
|
@quantity = quantity
|
|
36
|
+
@image_i_ds = image_i_ds
|
|
34
37
|
end
|
|
35
38
|
|
|
36
39
|
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
@@ -41,6 +44,7 @@ module Moov
|
|
|
41
44
|
return false unless @base_price == other.base_price
|
|
42
45
|
return false unless @options == other.options
|
|
43
46
|
return false unless @quantity == other.quantity
|
|
47
|
+
return false unless @image_i_ds == other.image_i_ds
|
|
44
48
|
true
|
|
45
49
|
end
|
|
46
50
|
end
|