Class: GenesisRuby::Api::Requests::NonFinancial::Payee::AssociatePayeeWithOwners
- Inherits:
-
Base::NonFinancial::Payee::Base
- Object
- GenesisRuby::Api::Request
- Base::NonFinancial::Payee::Base
- GenesisRuby::Api::Requests::NonFinancial::Payee::AssociatePayeeWithOwners
- Defined in:
- lib/genesis_ruby/api/requests/non_financial/payee/associate_payee_with_owners.rb
Overview
Associate Owners with a specific Payee.
Constant Summary
Constants inherited from GenesisRuby::Api::Request
GenesisRuby::Api::Request::AUTH_TYPE_BASIC, GenesisRuby::Api::Request::AUTH_TYPE_TOKEN, GenesisRuby::Api::Request::METHOD_DELETE, GenesisRuby::Api::Request::METHOD_GET, GenesisRuby::Api::Request::METHOD_PATCH, GenesisRuby::Api::Request::METHOD_POST, GenesisRuby::Api::Request::METHOD_PUT, GenesisRuby::Api::Request::PORT_HTTPS, GenesisRuby::Api::Request::PROTOCOL_HTTPS
Instance Attribute Summary collapse
-
#payee_unique_id ⇒ Object
Returns the value of attribute payee_unique_id.
Attributes inherited from GenesisRuby::Api::Request
Instance Method Summary collapse
-
#add_owner(unique_id:, **options) ⇒ Object
Add a single owner to the owners collection.
-
#initialize(configuration, _builder_interface = nil) ⇒ AssociatePayeeWithOwners
constructor
Associate Payee With Owners initialization.
-
#owners=(value) ⇒ Object
Assign owners collection with validation.
Methods inherited from GenesisRuby::Api::Request
Constructor Details
#initialize(configuration, _builder_interface = nil) ⇒ AssociatePayeeWithOwners
Associate Payee With Owners initialization
14 15 16 17 18 |
# File 'lib/genesis_ruby/api/requests/non_financial/payee/associate_payee_with_owners.rb', line 14 def initialize(configuration, _builder_interface = nil) super configuration self.request_path = 'payee/:payee_unique_id/owners' end |
Instance Attribute Details
#payee_unique_id ⇒ Object
Returns the value of attribute payee_unique_id.
11 12 13 |
# File 'lib/genesis_ruby/api/requests/non_financial/payee/associate_payee_with_owners.rb', line 11 def payee_unique_id @payee_unique_id end |
Instance Method Details
#add_owner(unique_id:, **options) ⇒ Object
Add a single owner to the owners collection
21 22 23 24 25 26 27 28 |
# File 'lib/genesis_ruby/api/requests/non_financial/payee/associate_payee_with_owners.rb', line 21 def add_owner(unique_id:, **) raise GenesisRuby::InvalidArgumentError, 'Owner unique_id must be a String' unless unique_id.is_a?(String) raise GenesisRuby::InvalidArgumentError, 'Owner unique_id is required' if unique_id.empty? validate_percent_ownership([:percent_ownership]) if .key?(:percent_ownership) owners << { unique_id: unique_id }.merge() end |
#owners=(value) ⇒ Object
Assign owners collection with validation
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/genesis_ruby/api/requests/non_financial/payee/associate_payee_with_owners.rb', line 31 def owners=(value) if value.nil? @owners = nil elsif !value.is_a?(Array) raise GenesisRuby::InvalidArgumentError, 'Owners must be an Array' else validate_owners_collection(value) @owners = value end end |