Class: Mailfloss::Resources::Account
- Defined in:
- lib/mailfloss/resources.rb,
sig/resources.rbs
Overview
GET/PATCH /account
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#get ⇒ Types::account
GET /account — the authenticated account holder.
-
#update(name: :__omit__, organization: :__omit__, phone: :__omit__, vat_id: :__omit__, country: :__omit__, address: :__omit__, notifications: :__omit__) ⇒ Hash
PATCH /account — update writable account & settings fields.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Mailfloss::Resources::Base
Instance Method Details
#get ⇒ Types::account
GET /account — the authenticated account holder.
115 116 117 |
# File 'lib/mailfloss/resources.rb', line 115 def get client.request(:get, "/account") end |
#update(name: :__omit__, organization: :__omit__, phone: :__omit__, vat_id: :__omit__, country: :__omit__, address: :__omit__, notifications: :__omit__) ⇒ Hash
PATCH /account — update writable account & settings fields. Only the provided keys are sent.
131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/mailfloss/resources.rb', line 131 def update(name: :__omit__, organization: :__omit__, phone: :__omit__, vat_id: :__omit__, country: :__omit__, address: :__omit__, notifications: :__omit__) body = {} body[:name] = name unless name == :__omit__ body[:organization] = organization unless organization == :__omit__ body[:phone] = phone unless phone == :__omit__ body[:vat_id] = vat_id unless vat_id == :__omit__ body[:country] = country unless country == :__omit__ body[:address] = address unless address == :__omit__ body[:notifications] = notifications unless notifications == :__omit__ client.request(:patch, "/account", body: body) end |