Sha256: 0481fc76ce6c8c944be2aed63fd53d0f6f2b9210872874fc2fc1ae34ae0b4243

Contents?: true

Size: 767 Bytes

Versions: 10

Compression:

Stored size: 767 Bytes

Contents

module Services
  module Hubspot
    module Contacts
      class ArchiveBatch
        def initialize(ids, access_token)
          @ids = ids
          @access_token = access_token
        end

        def call
          ids_object = ::Hubspot::Crm::Contacts::BatchInputSimplePublicObjectId.new(
            inputs: @ids
          )
          batch_api.archive_batch(body: ids_object , auth_names: 'oauth2')
        end

        private

        def batch_api
          config = ::Hubspot::Crm::Contacts::Configuration.new do |config|
            config.access_token = @access_token
          end
          api_client = ::Hubspot::Crm::Contacts::ApiClient.new(config)
          ::Hubspot::Crm::Contacts::BatchApi.new(api_client)
        end
      end
    end
  end
end

Version data entries

10 entries across 5 versions & 1 rubygems

Version Path
hubspot-api-client-2.3.2 sample-apps/rate-limits-redis-sample-app/app/lib/services/hubspot/contacts/archive_batch.rb
hubspot-api-client-2.3.2 sample-apps/leaky-bucket-app/app/lib/services/hubspot/contacts/archive_batch.rb
hubspot-api-client-2.3.1 sample-apps/leaky-bucket-app/app/lib/services/hubspot/contacts/archive_batch.rb
hubspot-api-client-2.3.1 sample-apps/rate-limits-redis-sample-app/app/lib/services/hubspot/contacts/archive_batch.rb
hubspot-api-client-2.2.0 sample-apps/rate-limits-redis-sample-app/app/lib/services/hubspot/contacts/archive_batch.rb
hubspot-api-client-2.2.0 sample-apps/leaky-bucket-app/app/lib/services/hubspot/contacts/archive_batch.rb
hubspot-api-client-2.1.0 sample-apps/rate-limits-redis-sample-app/app/lib/services/hubspot/contacts/archive_batch.rb
hubspot-api-client-2.1.0 sample-apps/leaky-bucket-app/app/lib/services/hubspot/contacts/archive_batch.rb
hubspot-api-client-2.0.0 sample-apps/leaky-bucket-app/app/lib/services/hubspot/contacts/archive_batch.rb
hubspot-api-client-2.0.0 sample-apps/rate-limits-redis-sample-app/app/lib/services/hubspot/contacts/archive_batch.rb