Class: FlexOps::Client
- Inherits:
-
Object
- Object
- FlexOps::Client
- Defined in:
- lib/flexops/client.rb
Instance Attribute Summary collapse
-
#analytics ⇒ Object
readonly
Returns the value of attribute analytics.
-
#api_keys ⇒ Object
readonly
Returns the value of attribute api_keys.
-
#auth ⇒ Object
readonly
Returns the value of attribute auth.
-
#carriers ⇒ Object
readonly
Returns the value of attribute carriers.
-
#email_templates ⇒ Object
readonly
Returns the value of attribute email_templates.
-
#hs_codes ⇒ Object
readonly
Returns the value of attribute hs_codes.
-
#insurance ⇒ Object
readonly
Returns the value of attribute insurance.
-
#inventory ⇒ Object
readonly
Returns the value of attribute inventory.
-
#offsets ⇒ Object
readonly
Returns the value of attribute offsets.
-
#orders ⇒ Object
readonly
Returns the value of attribute orders.
-
#pickups ⇒ Object
readonly
Returns the value of attribute pickups.
-
#recurring_shipments ⇒ Object
readonly
Returns the value of attribute recurring_shipments.
-
#reports ⇒ Object
readonly
Returns the value of attribute reports.
-
#returns ⇒ Object
readonly
Returns the value of attribute returns.
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
-
#scan_forms ⇒ Object
readonly
Returns the value of attribute scan_forms.
-
#shipping ⇒ Object
readonly
Returns the value of attribute shipping.
-
#wallet ⇒ Object
readonly
Returns the value of attribute wallet.
-
#webhooks ⇒ Object
readonly
Returns the value of attribute webhooks.
-
#workspace_id ⇒ Object
Returns the value of attribute workspace_id.
-
#workspaces ⇒ Object
readonly
Returns the value of attribute workspaces.
Instance Method Summary collapse
-
#initialize(api_key: nil, access_token: nil, base_url: "https://gateway.flexops.io", workspace_id: nil, timeout: 30) ⇒ Client
constructor
A new instance of Client.
- #set_access_token(token) ⇒ Object
- #set_api_key(key) ⇒ Object
Constructor Details
#initialize(api_key: nil, access_token: nil, base_url: "https://gateway.flexops.io", workspace_id: nil, timeout: 30) ⇒ Client
Returns a new instance of Client.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/flexops/client.rb', line 17 def initialize(api_key: nil, access_token: nil, base_url: "https://gateway.flexops.io", workspace_id: nil, timeout: 30) @http = HttpClient.new(base_url: base_url, api_key: api_key, access_token: access_token, timeout: timeout) @workspace_id = workspace_id ws_id_proc = -> { @workspace_id } @auth = Resources::Auth.new(@http) @workspaces = Resources::Workspaces.new(@http, ws_id_proc) @shipping = Resources::Shipping.new(@http, ws_id_proc) @carriers = Resources::Carriers.new(@http) @webhooks = Resources::Webhooks.new(@http, ws_id_proc) @wallet = Resources::Wallet.new(@http, ws_id_proc) @insurance = Resources::Insurance.new(@http, ws_id_proc) @returns = Resources::Returns.new(@http, ws_id_proc) @api_keys = Resources::ApiKeys.new(@http, ws_id_proc) @analytics = Resources::Analytics.new(@http) @orders = Resources::Orders.new(@http) @inventory = Resources::Inventory.new(@http) @pickups = Resources::Pickups.new(@http, ws_id_proc) @scan_forms = Resources::ScanForms.new(@http, ws_id_proc) @rules = Resources::Rules.new(@http, ws_id_proc) @offsets = Resources::Offsets.new(@http, ws_id_proc) @hs_codes = Resources::HsCodes.new(@http, ws_id_proc) @recurring_shipments = Resources::RecurringShipments.new(@http, ws_id_proc) @email_templates = Resources::EmailTemplates.new(@http, ws_id_proc) @reports = Resources::Reports.new(@http, ws_id_proc) end |
Instance Attribute Details
#analytics ⇒ Object (readonly)
Returns the value of attribute analytics.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def analytics @analytics end |
#api_keys ⇒ Object (readonly)
Returns the value of attribute api_keys.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def api_keys @api_keys end |
#auth ⇒ Object (readonly)
Returns the value of attribute auth.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def auth @auth end |
#carriers ⇒ Object (readonly)
Returns the value of attribute carriers.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def carriers @carriers end |
#email_templates ⇒ Object (readonly)
Returns the value of attribute email_templates.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def email_templates @email_templates end |
#hs_codes ⇒ Object (readonly)
Returns the value of attribute hs_codes.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def hs_codes @hs_codes end |
#insurance ⇒ Object (readonly)
Returns the value of attribute insurance.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def insurance @insurance end |
#inventory ⇒ Object (readonly)
Returns the value of attribute inventory.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def inventory @inventory end |
#offsets ⇒ Object (readonly)
Returns the value of attribute offsets.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def offsets @offsets end |
#orders ⇒ Object (readonly)
Returns the value of attribute orders.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def orders @orders end |
#pickups ⇒ Object (readonly)
Returns the value of attribute pickups.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def pickups @pickups end |
#recurring_shipments ⇒ Object (readonly)
Returns the value of attribute recurring_shipments.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def recurring_shipments @recurring_shipments end |
#reports ⇒ Object (readonly)
Returns the value of attribute reports.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def reports @reports end |
#returns ⇒ Object (readonly)
Returns the value of attribute returns.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def returns @returns end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def rules @rules end |
#scan_forms ⇒ Object (readonly)
Returns the value of attribute scan_forms.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def scan_forms @scan_forms end |
#shipping ⇒ Object (readonly)
Returns the value of attribute shipping.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def shipping @shipping end |
#wallet ⇒ Object (readonly)
Returns the value of attribute wallet.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def wallet @wallet end |
#webhooks ⇒ Object (readonly)
Returns the value of attribute webhooks.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def webhooks @webhooks end |
#workspace_id ⇒ Object
Returns the value of attribute workspace_id.
11 12 13 |
# File 'lib/flexops/client.rb', line 11 def workspace_id @workspace_id end |
#workspaces ⇒ Object (readonly)
Returns the value of attribute workspaces.
12 13 14 |
# File 'lib/flexops/client.rb', line 12 def workspaces @workspaces end |
Instance Method Details
#set_access_token(token) ⇒ Object
45 46 47 |
# File 'lib/flexops/client.rb', line 45 def set_access_token(token) @http.set_access_token(token) end |
#set_api_key(key) ⇒ Object
49 50 51 |
# File 'lib/flexops/client.rb', line 49 def set_api_key(key) @http.set_api_key(key) end |