Class: Io::Flow::V0::Clients::ChannelViesRegistrations

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ChannelViesRegistrations

Returns a new instance of ChannelViesRegistrations.



5458
5459
5460
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5458

def initialize(client)
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
end

Instance Method Details

#delete_by_key(channel_id, key) ⇒ Object



5477
5478
5479
5480
5481
5482
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5477

def delete_by_key(channel_id, key)
  HttpClient::Preconditions.assert_class('channel_id', channel_id, String)
  HttpClient::Preconditions.assert_class('key', key, String)
  r = @client.request("/channel/#{CGI.escape(channel_id)}/vies/registrations/#{CGI.escape(key)}").delete
  nil
end

#post(channel_id, channel_vies_registration_form) ⇒ Object



5462
5463
5464
5465
5466
5467
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5462

def post(channel_id, channel_vies_registration_form)
  HttpClient::Preconditions.assert_class('channel_id', channel_id, String)
  (x = channel_vies_registration_form; x.is_a?(::Io::Flow::V0::Models::ChannelViesRegistrationForm) ? x : ::Io::Flow::V0::Models::ChannelViesRegistrationForm.new(x))
  r = @client.request("/channel/#{CGI.escape(channel_id)}/vies/registrations").with_json(channel_vies_registration_form.to_json).post
  ::Io::Flow::V0::Models::ChannelViesRegistration.new(r)
end

#put_by_key(channel_id, key, channel_vies_registration_form) ⇒ Object



5469
5470
5471
5472
5473
5474
5475
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5469

def put_by_key(channel_id, key, channel_vies_registration_form)
  HttpClient::Preconditions.assert_class('channel_id', channel_id, String)
  HttpClient::Preconditions.assert_class('key', key, String)
  (x = channel_vies_registration_form; x.is_a?(::Io::Flow::V0::Models::ChannelViesRegistrationForm) ? x : ::Io::Flow::V0::Models::ChannelViesRegistrationForm.new(x))
  r = @client.request("/channel/#{CGI.escape(channel_id)}/vies/registrations/#{CGI.escape(key)}").with_json(channel_vies_registration_form.to_json).put
  ::Io::Flow::V0::Models::ChannelViesRegistration.new(r)
end