Sha256: eb4d2f1e209ce93fe557cbe65ed5fee24e8cc72aa74f8e6a3a7eb97017ce04f0

Contents?: true

Size: 743 Bytes

Versions: 15

Compression:

Stored size: 743 Bytes

Contents

module Services
  module Hubspot
    module Contacts
      class Search
        def initialize(email:)
          @email = email
        end

        def call
          search_api = ::Hubspot::Crm::Contacts::SearchApi.new
          search_api.do_search(body: search_request, auth_names: 'oauth2').results
        end

        private

        def search_request
          filter = ::Hubspot::Crm::Contacts::Filter.new(
            property_name: 'email',
            operator: 'EQ',
            value: @email
          )
          filter_group = ::Hubspot::Crm::Contacts::FilterGroup.new(filters: [filter])
          ::Hubspot::Crm::Contacts::PublicObjectSearchRequest.new(filter_groups: [filter_group])
        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/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-7.0.0 sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-6.0.0 sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-5.0.0 sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-4.0.0 sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-3.3.0 sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-3.2.0 sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-3.1.1 sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-3.1.0.pre.beta sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-3.0.0.pre.beta sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-2.3.2 sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-2.3.1 sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-2.2.0 sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-2.1.0 sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb
hubspot-api-client-2.0.0 sample-apps/companies-app/app/lib/services/hubspot/contacts/search.rb