Sha256: d1d7bc27ade990e0452ffb7ab2381eac536ee2254b0722bfec68b26d6aaa9c6e

Contents?: true

Size: 709 Bytes

Versions: 15

Compression:

Stored size: 709 Bytes

Contents

module Services
  module Hubspot
    module Properties
      class Update
        def initialize(name, params)
          @name = name
          @params = params
        end

        def call
          core_api = ::Hubspot::Crm::Properties::CoreApi.new
          params = { auth_names: 'oauth2', body: property_update }
          core_api.update('contact', @name, params)
        end

        private

        def property_update
          @params.filter! do |(key, value)|
            ::Hubspot::Crm::Properties::PropertyUpdate.attribute_map.keys.include?(key.to_sym)
          end
          @property_update ||= ::Hubspot::Crm::Properties::PropertyUpdate.new(@params)
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
hubspot-api-client-7.1.0 sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-7.0.0 sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-6.0.0 sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-5.0.0 sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-4.0.0 sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-3.3.0 sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-3.2.0 sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-3.1.1 sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-3.1.0.pre.beta sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-3.0.0.pre.beta sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-2.3.2 sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-2.3.1 sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-2.2.0 sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-2.1.0 sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb
hubspot-api-client-2.0.0 sample-apps/contacts-app/app/lib/services/hubspot/properties/update.rb