Class: BigCommerce::ManagementAPI::Endpoint

Inherits:
Object
  • Object
show all
Defined in:
lib/big_commerce/management_api/endpoint.rb

Defined Under Namespace

Classes: Response

Constant Summary collapse

HOST =
"api.bigcommerce.com"
PORT =
443
USER_AGENT =
"BigCommerce Management API Client v#{BigCommerce::ManagementAPI::VERSION} (Ruby v#{RUBY_VERSION})"
CONTENT_TYPE =
"Content-Type"
CONTENT_TYPE_JSON =
"application/json"
JSON_CONTENT_TYPES =
[CONTENT_TYPE_JSON, "application/problem+json"].freeze
RESULT_KEY =
"data"

Instance Method Summary collapse

Constructor Details

#initialize(store_hash, auth_token, options = nil) ⇒ Endpoint

Returns a new instance of Endpoint.

Raises:

  • (ArgumentError)


146
147
148
149
150
151
152
153
# File 'lib/big_commerce/management_api/endpoint.rb', line 146

def initialize(store_hash, auth_token, options = nil)
  raise ArgumentError, "store hash required" if store_hash.to_s.empty?
  raise ArgumentError, "auth token required" if auth_token.to_s.empty?

  @store_hash = store_hash
  @auth_token = auth_token
  @options = options || {}
end