Sha256: af9d706fef949564384d23a9662ad342a40f570ba94be2a2164a49946b5baf1e

Contents?: true

Size: 680 Bytes

Versions: 21

Compression:

Stored size: 680 Bytes

Contents

module Services
  module Hubspot
    module Contacts
      class GetById
        def initialize(id)
          @id = id
        end

        def call
          basic_api = ::Hubspot::Crm::Contacts::BasicApi.new
          basic_api.get_by_id(
            @id,
            auth_names: 'oauth2',
            properties: properties_to_display
          )
        end

        private

        def properties_to_display
          properties = Services::Hubspot::Properties::GetAll.new.call
          properties.filter! { |p| p.type == 'string' && !p.modification_metadata.read_only_value }
          properties.map(&:name) + %w[hubspot_owner_id]
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
hubspot-api-client-9.0.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-8.0.1 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-8.0.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-7.3.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-7.2.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-7.1.1 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-7.1.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-7.0.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-6.0.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-5.0.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-4.0.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-3.3.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-3.2.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-3.1.1 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-3.1.0.pre.beta sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-3.0.0.pre.beta sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-2.3.2 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-2.3.1 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-2.2.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb
hubspot-api-client-2.1.0 sample-apps/contacts-app/app/lib/services/hubspot/contacts/get_by_id.rb