Sha256: 23742143b4ebf7f851a8a35993de8cd5e723a2567f88287dba41f86e9a307a68

Contents?: true

Size: 564 Bytes

Versions: 2

Compression:

Stored size: 564 Bytes

Contents

module Services
  module Hubspot
    module Contacts
      class Update
        def initialize(id, properties)
          @id = id
          @properties = properties
        end

        def call
          basic_api = ::Hubspot::Crm::Contacts::BasicApi.new
          params = { auth_names: 'oauth2', body: contact_input }
          basic_api.update(@id, params)
        end

        private

        def contact_input
          @contact_input ||= ::Hubspot::Crm::Objects::SimplePublicObjectInput.new(properties: @properties)
        end
      end
    end
  end
end

Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
hubspot-api-client-2.0.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/update.rb
hubspot-api-client-2.0.0 sample-apps/oauth-app/app/lib/services/hubspot/contacts/update.rb