Class: Io::Flow::V0::Clients::TaxRegistrations
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::TaxRegistrations
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
- #delete_by_key(organization, key) ⇒ Object
-
#initialize(client) ⇒ TaxRegistrations
constructor
A new instance of TaxRegistrations.
- #post(organization, tax_registration_form) ⇒ Object
- #put_by_key(organization, key, tax_registration_form) ⇒ Object
Constructor Details
#initialize(client) ⇒ TaxRegistrations
Returns a new instance of TaxRegistrations.
2974 2975 2976 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2974 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end |
Instance Method Details
#delete_by_key(organization, key) ⇒ Object
2993 2994 2995 2996 2997 2998 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2993 def delete_by_key(organization, key) HttpClient::Preconditions.assert_class('organization', organization, String) HttpClient::Preconditions.assert_class('key', key, String) r = @client.request("/#{CGI.escape(organization)}/tax/registrations/#{CGI.escape(key)}").delete nil end |
#post(organization, tax_registration_form) ⇒ Object
2978 2979 2980 2981 2982 2983 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2978 def post(organization, tax_registration_form) HttpClient::Preconditions.assert_class('organization', organization, String) (x = tax_registration_form; x.is_a?(::Io::Flow::V0::Models::TaxRegistrationForm) ? x : ::Io::Flow::V0::Models::TaxRegistrationForm.new(x)) r = @client.request("/#{CGI.escape(organization)}/tax/registrations").with_json(tax_registration_form.to_json).post ::Io::Flow::V0::Models::TaxRegistration.new(r) end |
#put_by_key(organization, key, tax_registration_form) ⇒ Object
2985 2986 2987 2988 2989 2990 2991 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2985 def put_by_key(organization, key, tax_registration_form) HttpClient::Preconditions.assert_class('organization', organization, String) HttpClient::Preconditions.assert_class('key', key, String) (x = tax_registration_form; x.is_a?(::Io::Flow::V0::Models::TaxRegistrationForm) ? x : ::Io::Flow::V0::Models::TaxRegistrationForm.new(x)) r = @client.request("/#{CGI.escape(organization)}/tax/registrations/#{CGI.escape(key)}").with_json(tax_registration_form.to_json).put ::Io::Flow::V0::Models::TaxRegistration.new(r) end |