Class: StickyIoRestfulApiV2025731::Client
- Inherits:
-
Object
- Object
- StickyIoRestfulApiV2025731::Client
- Includes:
- CoreLibrary
- Defined in:
- lib/sticky_io_restful_api_v2025731/client.rb
Overview
sticky_io_restful_api_v2025731 client class.
Instance Attribute Summary collapse
-
#auth_managers ⇒ Object
readonly
Returns the value of attribute auth_managers.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Class Method Summary collapse
-
.from_env(**overrides) ⇒ Object
Creates a client directly from environment variables.
Instance Method Summary collapse
-
#addresses ⇒ AddressesController
Access to addresses controller.
-
#affiliates ⇒ AffiliatesController
Access to affiliates controller.
-
#attributes ⇒ AttributesController
Access to attributes controller.
-
#billing_models ⇒ BillingModelsController
Access to billing_models controller.
-
#campaigns ⇒ CampaignsController
Access to campaigns controller.
-
#categories ⇒ CategoriesController
Access to categories controller.
-
#chargeback ⇒ ChargebackController
Access to chargeback controller.
-
#communications ⇒ CommunicationsController
Access to communications controller.
-
#configurations ⇒ ConfigurationsController
Access to configurations controller.
-
#contacts ⇒ ContactsController
Access to contacts controller.
-
#coupons ⇒ CouponsController
Access to coupons controller.
-
#credits ⇒ CreditsController
Access to credits controller.
-
#custom_fields ⇒ CustomFieldsController
Access to custom_fields controller.
-
#customers ⇒ CustomersController
Access to customers controller.
-
#discount ⇒ DiscountController
Access to discount controller.
-
#gateways ⇒ GatewaysController
Access to gateways controller.
-
#images ⇒ ImagesController
Access to images controller.
-
#initialize(connection: nil, adapter: :net_http_persistent, timeout: 60, max_retries: 0, retry_interval: 1, backoff_factor: 2, retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods: %i[get put],, http_callback: nil, proxy_settings: nil, logging_configuration: nil, environment: Environment::PRODUCTION, basic_credentials: nil, bearer_credentials: nil, config: nil) ⇒ Client
constructor
A new instance of Client.
-
#initialize_auth_managers(global_config) ⇒ Object
Initializes the auth managers hash used for authenticating API calls.
-
#interests ⇒ InterestsController
Access to interests controller.
-
#inventories ⇒ InventoriesController
Access to inventories controller.
-
#line_item_custom_options ⇒ LineItemCustomOptionsController
Access to line_item_custom_options controller.
-
#line_item_management ⇒ LineItemManagementController
Access to line_item_management controller.
-
#meta ⇒ MetaController
Access to meta controller.
-
#misc ⇒ MiscController
Access to misc controller.
-
#notes ⇒ NotesController
Access to notes controller.
-
#offers ⇒ OffersController
Access to offers controller.
-
#order ⇒ OrderController
Access to order controller.
-
#orders ⇒ OrdersController
Access to orders controller.
-
#overrides ⇒ OverridesController
Access to overrides controller.
-
#payment_router ⇒ PaymentRouterController
Access to payment_router controller.
-
#payment_types_methods ⇒ PaymentTypesMethodsController
Access to payment_types_methods controller.
-
#permissions ⇒ PermissionsController
Access to permissions controller.
-
#products ⇒ ProductsController
Access to products controller.
-
#promo_codes ⇒ PromoCodesController
Access to promo_codes controller.
-
#prospects ⇒ ProspectsController
Access to prospects controller.
-
#shipping ⇒ ShippingController
Access to shipping controller.
-
#start_stop_reset ⇒ StartStopResetController
Access to start_stop_reset controller.
-
#subscription ⇒ SubscriptionController
Access to subscription controller.
-
#subscriptions ⇒ SubscriptionsController
Access to subscriptions controller.
-
#templates ⇒ TemplatesController
Access to templates controller.
-
#tokenization ⇒ TokenizationController
Access to tokenization controller.
-
#trial_workflows ⇒ TrialWorkflowsController
Access to trial_workflows controller.
-
#types ⇒ TypesController
Access to types controller.
- #user_agent_detail ⇒ Object
-
#users ⇒ UsersController
Access to users controller.
-
#variants ⇒ VariantsController
Access to variants controller.
-
#volume_discounts ⇒ VolumeDiscountsController
Access to volume_discounts controller.
-
#wallet ⇒ WalletController
Access to wallet controller.
-
#warehouse ⇒ WarehouseController
Access to warehouse controller.
Constructor Details
#initialize(connection: nil, adapter: :net_http_persistent, timeout: 60, max_retries: 0, retry_interval: 1, backoff_factor: 2, retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods: %i[get put],, http_callback: nil, proxy_settings: nil, logging_configuration: nil, environment: Environment::PRODUCTION, basic_credentials: nil, bearer_credentials: nil, config: nil) ⇒ Client
Returns a new instance of Client.
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 298 def initialize( connection: nil, adapter: :net_http_persistent, timeout: 60, max_retries: 0, retry_interval: 1, backoff_factor: 2, retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods: %i[get put], http_callback: nil, proxy_settings: nil, logging_configuration: nil, environment: Environment::PRODUCTION, basic_credentials: nil, bearer_credentials: nil, config: nil ) @config = if config.nil? Configuration.new( connection: connection, adapter: adapter, timeout: timeout, max_retries: max_retries, retry_interval: retry_interval, backoff_factor: backoff_factor, retry_statuses: retry_statuses, retry_methods: retry_methods, http_callback: http_callback, proxy_settings: proxy_settings, logging_configuration: logging_configuration, environment: environment, basic_credentials: basic_credentials, bearer_credentials: bearer_credentials ) else config end user_agent_params = BaseController.user_agent_parameters @global_configuration = GlobalConfiguration.new(client_configuration: @config) .base_uri_executor(@config.method(:get_base_uri)) .global_errors(BaseController::GLOBAL_ERRORS) .user_agent(BaseController.user_agent, agent_parameters: user_agent_params) initialize_auth_managers(@global_configuration) @global_configuration = @global_configuration.auth_managers(@auth_managers) end |
Instance Attribute Details
#auth_managers ⇒ Object (readonly)
Returns the value of attribute auth_managers.
10 11 12 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 10 def auth_managers @auth_managers end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 10 def config @config end |
Class Method Details
.from_env(**overrides) ⇒ Object
Creates a client directly from environment variables.
345 346 347 348 349 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 345 def self.from_env(**overrides) default_config = Configuration.build_default_config_from_env new_config = default_config.clone_with(**overrides) new(config: new_config) end |
Instance Method Details
#addresses ⇒ AddressesController
Access to addresses controller.
48 49 50 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 48 def addresses @addresses ||= AddressesController.new @global_configuration end |
#affiliates ⇒ AffiliatesController
Access to affiliates controller.
24 25 26 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 24 def affiliates @affiliates ||= AffiliatesController.new @global_configuration end |
#attributes ⇒ AttributesController
Access to attributes controller.
204 205 206 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 204 def attributes @attributes ||= AttributesController.new @global_configuration end |
#billing_models ⇒ BillingModelsController
Access to billing_models controller.
36 37 38 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 36 def billing_models @billing_models ||= BillingModelsController.new @global_configuration end |
#campaigns ⇒ CampaignsController
Access to campaigns controller.
42 43 44 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 42 def campaigns @campaigns ||= CampaignsController.new @global_configuration end |
#categories ⇒ CategoriesController
Access to categories controller.
210 211 212 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 210 def categories @categories ||= CategoriesController.new @global_configuration end |
#chargeback ⇒ ChargebackController
Access to chargeback controller.
246 247 248 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 246 def chargeback @chargeback ||= ChargebackController.new @global_configuration end |
#communications ⇒ CommunicationsController
Access to communications controller.
72 73 74 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 72 def communications @communications ||= CommunicationsController.new @global_configuration end |
#configurations ⇒ ConfigurationsController
Access to configurations controller.
192 193 194 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 192 def configurations @configurations ||= ConfigurationsController.new @global_configuration end |
#contacts ⇒ ContactsController
Access to contacts controller.
78 79 80 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 78 def contacts @contacts ||= ContactsController.new @global_configuration end |
#coupons ⇒ CouponsController
Access to coupons controller.
90 91 92 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 90 def coupons @coupons ||= CouponsController.new @global_configuration end |
#credits ⇒ CreditsController
Access to credits controller.
156 157 158 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 156 def credits @credits ||= CreditsController.new @global_configuration end |
#custom_fields ⇒ CustomFieldsController
Access to custom_fields controller.
96 97 98 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 96 def custom_fields @custom_fields ||= CustomFieldsController.new @global_configuration end |
#customers ⇒ CustomersController
Access to customers controller.
102 103 104 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 102 def customers @customers ||= CustomersController.new @global_configuration end |
#discount ⇒ DiscountController
Access to discount controller.
150 151 152 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 150 def discount @discount ||= DiscountController.new @global_configuration end |
#gateways ⇒ GatewaysController
Access to gateways controller.
108 109 110 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 108 def gateways @gateways ||= GatewaysController.new @global_configuration end |
#images ⇒ ImagesController
Access to images controller.
114 115 116 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 114 def images @images ||= ImagesController.new @global_configuration end |
#initialize_auth_managers(global_config) ⇒ Object
Initializes the auth managers hash used for authenticating API calls.
336 337 338 339 340 341 342 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 336 def initialize_auth_managers(global_config) @auth_managers = {} http_client_config = global_config.client_configuration %w[basic bearer].each { |auth| @auth_managers[auth] = nil } @auth_managers['basic'] = Basic.new(http_client_config.basic_credentials) @auth_managers['bearer'] = Bearer.new(http_client_config.bearer_credentials) end |
#interests ⇒ InterestsController
Access to interests controller.
66 67 68 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 66 def interests @interests ||= InterestsController.new @global_configuration end |
#inventories ⇒ InventoriesController
Access to inventories controller.
258 259 260 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 258 def inventories @inventories ||= InventoriesController.new @global_configuration end |
#line_item_custom_options ⇒ LineItemCustomOptionsController
Access to line_item_custom_options controller.
168 169 170 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 168 def @line_item_custom_options ||= LineItemCustomOptionsController.new @global_configuration end |
#line_item_management ⇒ LineItemManagementController
Access to line_item_management controller.
174 175 176 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 174 def line_item_management @line_item_management ||= LineItemManagementController.new @global_configuration end |
#meta ⇒ MetaController
Access to meta controller.
30 31 32 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 30 def @meta ||= MetaController.new @global_configuration end |
#misc ⇒ MiscController
Access to misc controller.
294 295 296 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 294 def misc @misc ||= MiscController.new @global_configuration end |
#notes ⇒ NotesController
Access to notes controller.
132 133 134 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 132 def notes @notes ||= NotesController.new @global_configuration end |
#offers ⇒ OffersController
Access to offers controller.
198 199 200 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 198 def offers @offers ||= OffersController.new @global_configuration end |
#order ⇒ OrderController
Access to order controller.
270 271 272 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 270 def order @order ||= OrderController.new @global_configuration end |
#orders ⇒ OrdersController
Access to orders controller.
186 187 188 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 186 def orders @orders ||= OrdersController.new @global_configuration end |
#overrides ⇒ OverridesController
Access to overrides controller.
162 163 164 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 162 def overrides @overrides ||= OverridesController.new @global_configuration end |
#payment_router ⇒ PaymentRouterController
Access to payment_router controller.
282 283 284 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 282 def payment_router @payment_router ||= PaymentRouterController.new @global_configuration end |
#payment_types_methods ⇒ PaymentTypesMethodsController
Access to payment_types_methods controller.
54 55 56 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 54 def payment_types_methods @payment_types_methods ||= PaymentTypesMethodsController.new @global_configuration end |
#permissions ⇒ PermissionsController
Access to permissions controller.
18 19 20 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 18 def @permissions ||= PermissionsController.new @global_configuration end |
#products ⇒ ProductsController
Access to products controller.
144 145 146 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 144 def products @products ||= ProductsController.new @global_configuration end |
#promo_codes ⇒ PromoCodesController
Access to promo_codes controller.
84 85 86 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 84 def promo_codes @promo_codes ||= PromoCodesController.new @global_configuration end |
#prospects ⇒ ProspectsController
Access to prospects controller.
222 223 224 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 222 def prospects @prospects ||= ProspectsController.new @global_configuration end |
#shipping ⇒ ShippingController
Access to shipping controller.
228 229 230 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 228 def shipping @shipping ||= ShippingController.new @global_configuration end |
#start_stop_reset ⇒ StartStopResetController
Access to start_stop_reset controller.
138 139 140 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 138 def start_stop_reset @start_stop_reset ||= StartStopResetController.new @global_configuration end |
#subscription ⇒ SubscriptionController
Access to subscription controller.
276 277 278 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 276 def subscription @subscription ||= SubscriptionController.new @global_configuration end |
#subscriptions ⇒ SubscriptionsController
Access to subscriptions controller.
180 181 182 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 180 def subscriptions @subscriptions ||= SubscriptionsController.new @global_configuration end |
#templates ⇒ TemplatesController
Access to templates controller.
126 127 128 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 126 def templates @templates ||= TemplatesController.new @global_configuration end |
#tokenization ⇒ TokenizationController
Access to tokenization controller.
234 235 236 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 234 def tokenization @tokenization ||= TokenizationController.new @global_configuration end |
#trial_workflows ⇒ TrialWorkflowsController
Access to trial_workflows controller.
252 253 254 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 252 def trial_workflows @trial_workflows ||= TrialWorkflowsController.new @global_configuration end |
#types ⇒ TypesController
Access to types controller.
120 121 122 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 120 def types @types ||= TypesController.new @global_configuration end |
#user_agent_detail ⇒ Object
12 13 14 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 12 def user_agent_detail config.user_agent_detail end |
#users ⇒ UsersController
Access to users controller.
240 241 242 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 240 def users @users ||= UsersController.new @global_configuration end |
#variants ⇒ VariantsController
Access to variants controller.
216 217 218 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 216 def variants @variants ||= VariantsController.new @global_configuration end |
#volume_discounts ⇒ VolumeDiscountsController
Access to volume_discounts controller.
288 289 290 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 288 def volume_discounts @volume_discounts ||= VolumeDiscountsController.new @global_configuration end |
#wallet ⇒ WalletController
Access to wallet controller.
60 61 62 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 60 def wallet @wallet ||= WalletController.new @global_configuration end |
#warehouse ⇒ WarehouseController
Access to warehouse controller.
264 265 266 |
# File 'lib/sticky_io_restful_api_v2025731/client.rb', line 264 def warehouse @warehouse ||= WarehouseController.new @global_configuration end |