Class: Hubspot::User

Inherits:
Resource show all
Defined in:
lib/hubspot/user.rb

Overview

ORM for hubspot users

Hubspot users consist mostly of read_only attributes (you can add custom properties). As such we extend this class to ensure that we retrieve useful data back from the API and provide helper methods to resolve hubspot fields e.g. user.email calls user.hs_email etc

Constant Summary

Constants inherited from Resource

Resource::METADATA_FIELDS

Constants included from ResourceFilter::FilterGroupMethods

ResourceFilter::FilterGroupMethods::OPERATOR_MAP

Constants inherited from ApiClient

ApiClient::MAX_RETRIES, ApiClient::RETRY_WAIT_TIME

Instance Attribute Summary

Attributes inherited from Resource

#changes, #id, #metadata, #properties

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

all, archive, batch_read, batch_read_all, #changes?, create, custom_properties, #delete, find, find!, find_by, find_by!, #initialize, #initialize_from_api, list, #method_missing, #persisted?, properties, property, read_only_properties, #resource_name, resource_name, #respond_to_missing?, #save, #save!, search, select, updatable_properties, update, #update, #update_attributes, where

Methods included from ResourceFilter::FilterGroupMethods

#build_filter_groups, #extract_property_and_operator

Methods inherited from ApiClient

delete, get, #handle_response, handle_response, log_request, patch, post

Constructor Details

This class inherits a constructor from Hubspot::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Hubspot::Resource

Class Method Details

.required_propertiesObject



11
12
13
# File 'lib/hubspot/user.rb', line 11

def required_properties
  %w[hs_email hs_given_name hs_family_name]
end

Instance Method Details

#emailObject



26
27
28
# File 'lib/hubspot/user.rb', line 26

def email
  hs_email
end

#first_nameObject Also known as: firstname



16
17
18
# File 'lib/hubspot/user.rb', line 16

def first_name
  hs_given_name
end

#last_nameObject Also known as: lastname



21
22
23
# File 'lib/hubspot/user.rb', line 21

def last_name
  hs_family_name
end