Sha256: ad029df57021832b85e0e775fb104e02c70b3fb7c58d55b2b856499f197557dd

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

# frozen_string_literal: true

module Yext
  module Api
    module Validators
      # A Validator for account updates to verify that the update is valid.
      class AccountValidator < ::Validation::Validator
        include ::Validation
        extend ::Validation::Rules

        def initialize(obj)
          # Ensure that the accountId field exists by cloning the Account and setting it.
          obj           = Yext::Api::AdministrativeApi::Account.new(obj.attributes)
          obj.accountId = obj[:accountId]

          super(obj)
        end

        rule :accountId, :not_empty
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yext-api-0.1.11 lib/yext/api/validators/account_validator.rb