Class: Yext::Api::Utils::Configuration

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/yext/api/utils/configuration.rb

Overview

A configuration class for global configurations for interfacing with the Yext API.

The class is a Singleton class to simplify accessing the configuration.

Documentation for how the various configurations are used within Yext can be found here:

http://developer.yext.com/docs/administrative-api/#section/Policies-and-Conventions

Initialization:

Some values within the

The configurations:

account_id

*required*
default: "me"
The ID of the account which you are interfacing with.

If the default value of "me" is used, the account_id will default to the account which owns the
api_key.

api_key

*required*
The API key for the Yext Application which is being used to submit the request through.

api_version

The version of the Yext API that the request would like to use for any given API call.

If left as nil, the gem will try to use the most up-to-date known version of all APIs whenever
possible, and future updates will adjust the defaults for each call to the most recent known
version of the API.

To keep your application stable, you should set this value to a static known value (such as
the date the project using the Yext API first started development).

The Yext API will accept a default of "20161012" to use the initially released v2 API.

validation_level

The validation level to use for a request.  Yext defaults this to "strict".  You can set this to
"lenient" to allow more lenient error and warning handling on your requests.

Validation should be a value from Yext::Api::Enumerations::Validation

yext_username

The username of a Yext User that the call is being made on the behalf of.  This will affect the
logging of who made a change.

yext_user_id

The id of a Yext User that the call is being made on the behalf of.  This will affect the
logging of who made a change.

sandbox

Boolean that indicates if the gem should use the production or sandbox URL.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



69
70
71
# File 'lib/yext/api/utils/configuration.rb', line 69

def initialize
  read_from_environment_variables
end

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



61
62
63
# File 'lib/yext/api/utils/configuration.rb', line 61

def 
  @account_id
end

#api_keyObject

Returns the value of attribute api_key.



61
62
63
# File 'lib/yext/api/utils/configuration.rb', line 61

def api_key
  @api_key
end

#api_versionObject

Returns the value of attribute api_version.



61
62
63
# File 'lib/yext/api/utils/configuration.rb', line 61

def api_version
  @api_version
end

#sandboxObject

Returns the value of attribute sandbox.



61
62
63
# File 'lib/yext/api/utils/configuration.rb', line 61

def sandbox
  @sandbox
end

#validation_levelObject

Returns the value of attribute validation_level.



67
68
69
# File 'lib/yext/api/utils/configuration.rb', line 67

def validation_level
  @validation_level
end

#yext_user_idObject

Returns the value of attribute yext_user_id.



61
62
63
# File 'lib/yext/api/utils/configuration.rb', line 61

def yext_user_id
  @yext_user_id
end

#yext_usernameObject

Returns the value of attribute yext_username.



61
62
63
# File 'lib/yext/api/utils/configuration.rb', line 61

def yext_username
  @yext_username
end

Instance Method Details

#param_account_idObject



82
83
84
# File 'lib/yext/api/utils/configuration.rb', line 82

def 
   || "me"
end