Class: Yext::Api::AdministrativeApi::Account

Inherits:
Utils::ApiBase
  • Object
show all
Includes:
Concerns::AccountRelations
Defined in:
lib/yext/api/administrative_api/account.rb

Overview

:administrative_api:

:account:
  :actions:
    - :action: :index
      :method: :get
      :endpoint: https://api.yext.com/v2/accounts
      :path_regex: v2/accounts
      :default_version: 20161012
      :documentation: http://developer.yext.com/docs/administrative-api/#operation/listAccounts
      :sandbox_only: false
    - :action: :show
      :method: :get
      :endpoint: https://api.yext.com/v2/accounts/{accountId}
      :path_regex: v2/accounts/\w+
      :default_version: 20161012
      :documentation: http://developer.yext.com/docs/administrative-api/#operation/getAccount
      :sandbox_only: false
    - :action: :update
      :method: :put
      :endpoint: https://api.yext.com/v2/accounts/{accountId}
      :path_regex: v2/accounts/\w+
      :default_version: 20161012
      :documentation: http://developer.yext.com/docs/administrative-api/#operation/updateAccount
      :sandbox_only: false

Instance Method Summary collapse

Methods included from Concerns::AccountRelations

#accountId=

Methods included from Concerns::FaradayConnection

faraday_connection

Instance Method Details

#saveObject

The save action only allows the saving of the account_id and the accountName

Furthermore, the account_id cannot be changed by the partner, but only by the customer themselves.



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/yext/api/administrative_api/account.rb', line 37

def save
  return unless Yext::Api::Validators::AccountValidator.new(self).valid?

  updates             = { account_id: , accountName: accountName }
  updates[:accountId] = accountId if accountId != 

  scope.with(Yext::Api::Concerns::AccountChild.("")).
      where(updates).
      put

  
end