Module: Zoom::Actions::Billing

Included in:
Client
Defined in:
lib/zoom/actions/billing.rb

Instance Method Summary collapse

Instance Method Details

#billing_get(*args) ⇒ Object



6
7
8
9
10
# File 'lib/zoom/actions/billing.rb', line 6

def billing_get(*args)
  params = Zoom::Params.new(Utils.extract_options!(args))
  params.require(:account_id)
  Utils.parse_response self.class.get("/accounts/#{params[:account_id]}/billing", headers: request_headers)
end

#billing_plans_list(*args) ⇒ Object



18
19
20
21
22
# File 'lib/zoom/actions/billing.rb', line 18

def billing_plans_list(*args)
  params = Zoom::Params.new(Utils.extract_options!(args))
  params.require(:account_id)
  Utils.parse_response self.class.get("/accounts/#{params[:account_id]}/plans", headers: request_headers)
end

#billing_plans_subscribe(*args) ⇒ Object



30
31
32
33
34
35
# File 'lib/zoom/actions/billing.rb', line 30

def billing_plans_subscribe(*args)
  params = Zoom::Params.new(Utils.extract_options!(args))
  # TODO: Move to constants and do some data validation
  params.require(:account_id, contact: %i[first_name last_name email phone_number address city state zip country], plan_base: %i[type hosts]).permit(:plan_recording, contact: [:apt], plan_zoom_rooms: %i[type hosts], plan_room_connector: %i[type hosts], plan_large_meeting: [], plan_webinar: [], plan_audio: %i[type tollfree_countries premium_countries callout_countries ddi_numbers], plan_phone: { plan_base: %i[type hosts], plan_calling: [], plan_number: [] })
  Utils.parse_response self.class.post("/accounts/#{params[:account_id]}/plans", body: params.except(:account_id).to_json, headers: request_headers)
end

#billing_plans_usage(*args) ⇒ Object



24
25
26
27
28
# File 'lib/zoom/actions/billing.rb', line 24

def billing_plans_usage(*args)
  params = Zoom::Params.new(Utils.extract_options!(args))
  params.require(:account_id)
  Utils.parse_response self.class.get("/accounts/#{params[:account_id]}/plans/usage", headers: request_headers)
end

#billing_update(*args) ⇒ Object



12
13
14
15
16
# File 'lib/zoom/actions/billing.rb', line 12

def billing_update(*args)
  params = Zoom::Params.new(Utils.extract_options!(args))
  params.require(:account_id).permit(%i[first_name last_name email phone_number address apt city state zip country])
  Utils.parse_response self.class.patch("/accounts/#{params[:account_id]}/billing", body: params.except(:account_id).to_json, headers: request_headers)
end