Class: Yext::Api::Utils::Configuration
- Inherits:
-
Object
- Object
- Yext::Api::Utils::Configuration
- 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
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
-
#validation_level ⇒ Object
Returns the value of attribute validation_level.
-
#yext_user_id ⇒ Object
Returns the value of attribute yext_user_id.
-
#yext_username ⇒ Object
Returns the value of attribute yext_username.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #param_account_id ⇒ Object
Constructor Details
#initialize ⇒ Configuration
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_id ⇒ Object
Returns the value of attribute account_id.
61 62 63 |
# File 'lib/yext/api/utils/configuration.rb', line 61 def account_id @account_id end |
#api_key ⇒ Object
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_version ⇒ Object
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 |
#sandbox ⇒ Object
Returns the value of attribute sandbox.
61 62 63 |
# File 'lib/yext/api/utils/configuration.rb', line 61 def sandbox @sandbox end |
#validation_level ⇒ Object
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_id ⇒ Object
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_username ⇒ Object
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_id ⇒ Object
82 83 84 |
# File 'lib/yext/api/utils/configuration.rb', line 82 def param_account_id account_id || "me" end |