Class: Verizon::Client

Inherits:
Object
  • Object
show all
Includes:
CoreLibrary
Defined in:
lib/verizon/client.rb

Overview

verizon client class.

Instance Attribute Summary collapse

Instance Method Summary collapse

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, environment: Environment::PRODUCTION, thingspace_oauth_credentials: nil, vz_m2m_token_credentials: nil, config: nil) ⇒ Client

Returns a new instance of Client.



461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# File 'lib/verizon/client.rb', line 461

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,
  environment: Environment::PRODUCTION, thingspace_oauth_credentials: nil,
  vz_m2m_token_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,
                environment: environment,
                thingspace_oauth_credentials: thingspace_oauth_credentials,
                vz_m2m_token_credentials: vz_m2m_token_credentials
              )
            else
              config
            end

  @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)

  initialize_auth_managers(@global_configuration)
  @global_configuration = @global_configuration.auth_managers(@auth_managers)
end

Instance Attribute Details

#auth_managersObject (readonly)

Returns the value of attribute auth_managers.



10
11
12
# File 'lib/verizon/client.rb', line 10

def auth_managers
  @auth_managers
end

#configObject (readonly)

Returns the value of attribute config.



10
11
12
# File 'lib/verizon/client.rb', line 10

def config
  @config
end

Instance Method Details

#account_devicesAccountDevicesController

Access to account_devices controller.

Returns:



253
254
255
# File 'lib/verizon/client.rb', line 253

def 
  @account_devices ||= AccountDevicesController.new @global_configuration
end

#account_requestsAccountRequestsController

Access to account_requests controller.

Returns:



73
74
75
# File 'lib/verizon/client.rb', line 73

def 
  @account_requests ||= AccountRequestsController.new @global_configuration
end

#account_subscriptionsAccountSubscriptionsController

Access to account_subscriptions controller.

Returns:



271
272
273
# File 'lib/verizon/client.rb', line 271

def 
  @account_subscriptions ||= AccountSubscriptionsController.new @global_configuration
end

#accountsAccountsController

Access to accounts controller.

Returns:



43
44
45
# File 'lib/verizon/client.rb', line 43

def accounts
  @accounts ||= AccountsController.new @global_configuration
end

#anomaly_settingsAnomalySettingsController

Access to anomaly_settings controller.

Returns:



355
356
357
# File 'lib/verizon/client.rb', line 355

def anomaly_settings
  @anomaly_settings ||= AnomalySettingsController.new @global_configuration
end

#anomaly_triggersAnomalyTriggersController

Access to anomaly_triggers controller.

Returns:



361
362
363
# File 'lib/verizon/client.rb', line 361

def anomaly_triggers
  @anomaly_triggers ||= AnomalyTriggersController.new @global_configuration
end

#anomaly_triggers_v2AnomalyTriggersV2Controller

Access to anomaly_triggers_v2 controller.

Returns:



367
368
369
# File 'lib/verizon/client.rb', line 367

def anomaly_triggers_v2
  @anomaly_triggers_v2 ||= AnomalyTriggersV2Controller.new @global_configuration
end

#billingBillingController

Access to billing controller.

Returns:



139
140
141
# File 'lib/verizon/client.rb', line 139

def billing
  @billing ||= BillingController.new @global_configuration
end

#campaigns_v2CampaignsV2Controller

Access to campaigns_v2 controller.

Returns:



187
188
189
# File 'lib/verizon/client.rb', line 187

def campaigns_v2
  @campaigns_v2 ||= CampaignsV2Controller.new @global_configuration
end

#campaigns_v3CampaignsV3Controller

Access to campaigns_v3 controller.

Returns:



235
236
237
# File 'lib/verizon/client.rb', line 235

def campaigns_v3
  @campaigns_v3 ||= CampaignsV3Controller.new @global_configuration
end

#client_loggingClientLoggingController

Access to client_logging controller.

Returns:



205
206
207
# File 'lib/verizon/client.rb', line 205

def client_logging
  @client_logging ||= ClientLoggingController.new @global_configuration
end

#cloud_connector_devicesCloudConnectorDevicesController

Access to cloud_connector_devices controller.

Returns:



331
332
333
# File 'lib/verizon/client.rb', line 331

def cloud_connector_devices
  @cloud_connector_devices ||= CloudConnectorDevicesController.new @global_configuration
end

#cloud_connector_subscriptionsCloudConnectorSubscriptionsController

Access to cloud_connector_subscriptions controller.

Returns:



325
326
327
# File 'lib/verizon/client.rb', line 325

def cloud_connector_subscriptions
  @cloud_connector_subscriptions ||= CloudConnectorSubscriptionsController.new @global_configuration
end

#configuration_filesConfigurationFilesController

Access to configuration_files controller.

Returns:



217
218
219
# File 'lib/verizon/client.rb', line 217

def configuration_files
  @configuration_files ||= ConfigurationFilesController.new @global_configuration
end

#connectivity_callbacksConnectivityCallbacksController

Access to connectivity_callbacks controller.

Returns:



67
68
69
# File 'lib/verizon/client.rb', line 67

def connectivity_callbacks
  @connectivity_callbacks ||= ConnectivityCallbacksController.new @global_configuration
end

#device_actionsDeviceActionsController

Access to device_actions controller.

Returns:



397
398
399
# File 'lib/verizon/client.rb', line 397

def device_actions
  @device_actions ||= DeviceActionsController.new @global_configuration
end

#device_diagnosticsDeviceDiagnosticsController

Access to device_diagnostics controller.

Returns:



85
86
87
# File 'lib/verizon/client.rb', line 85

def device_diagnostics
  @device_diagnostics ||= DeviceDiagnosticsController.new @global_configuration
end

#device_groupsDeviceGroupsController

Access to device_groups controller.

Returns:



49
50
51
# File 'lib/verizon/client.rb', line 49

def device_groups
  @device_groups ||= DeviceGroupsController.new @global_configuration
end

#device_location_callbacksDeviceLocationCallbacksController

Access to device_location_callbacks controller.

Returns:



127
128
129
# File 'lib/verizon/client.rb', line 127

def device_location_callbacks
  @device_location_callbacks ||= DeviceLocationCallbacksController.new @global_configuration
end

#device_managementDeviceManagementController

Access to device_management controller.

Returns:



37
38
39
# File 'lib/verizon/client.rb', line 37

def device_management
  @device_management ||= DeviceManagementController.new @global_configuration
end

#device_monitoringDeviceMonitoringController

Access to device_monitoring controller.

Returns:



97
98
99
# File 'lib/verizon/client.rb', line 97

def device_monitoring
  @device_monitoring ||= DeviceMonitoringController.new @global_configuration
end

#device_profile_managementDeviceProfileManagementController

Access to device_profile_management controller.

Returns:



91
92
93
# File 'lib/verizon/client.rb', line 91

def device_profile_management
  @device_profile_management ||= DeviceProfileManagementController.new @global_configuration
end

#device_reportsDeviceReportsController

Access to device_reports controller.

Returns:



343
344
345
# File 'lib/verizon/client.rb', line 343

def device_reports
  @device_reports ||= DeviceReportsController.new @global_configuration
end

#device_service_managementDeviceServiceManagementController

Access to device_service_management controller.

Returns:



337
338
339
# File 'lib/verizon/client.rb', line 337

def device_service_management
  @device_service_management ||= DeviceServiceManagementController.new @global_configuration
end

#device_sms_messagingDeviceSMSMessagingController

Access to device_sms_messaging controller.

Returns:



391
392
393
# File 'lib/verizon/client.rb', line 391

def device_sms_messaging
  @device_sms_messaging ||= DeviceSMSMessagingController.new @global_configuration
end

#devices_location_subscriptionsDevicesLocationSubscriptionsController

Access to devices_location_subscriptions controller.

Returns:



121
122
123
# File 'lib/verizon/client.rb', line 121

def devices_location_subscriptions
  @devices_location_subscriptions ||= DevicesLocationSubscriptionsController.new @global_configuration
end

#devices_locationsDevicesLocationsController

Access to devices_locations controller.

Returns:



109
110
111
# File 'lib/verizon/client.rb', line 109

def devices_locations
  @devices_locations ||= DevicesLocationsController.new @global_configuration
end

#diagnostics_callbacksDiagnosticsCallbacksController

Access to diagnostics_callbacks controller.

Returns:



307
308
309
# File 'lib/verizon/client.rb', line 307

def diagnostics_callbacks
  @diagnostics_callbacks ||= DiagnosticsCallbacksController.new @global_configuration
end

#diagnostics_factory_resetDiagnosticsFactoryResetController

Access to diagnostics_factory_reset controller.

Returns:



313
314
315
# File 'lib/verizon/client.rb', line 313

def diagnostics_factory_reset
  @diagnostics_factory_reset ||= DiagnosticsFactoryResetController.new @global_configuration
end

#diagnostics_historyDiagnosticsHistoryController

Access to diagnostics_history controller.

Returns:



295
296
297
# File 'lib/verizon/client.rb', line 295

def diagnostics_history
  @diagnostics_history ||= DiagnosticsHistoryController.new @global_configuration
end

#diagnostics_observationsDiagnosticsObservationsController

Access to diagnostics_observations controller.

Returns:



289
290
291
# File 'lib/verizon/client.rb', line 289

def diagnostics_observations
  @diagnostics_observations ||= DiagnosticsObservationsController.new @global_configuration
end

#diagnostics_settingsDiagnosticsSettingsController

Access to diagnostics_settings controller.

Returns:



301
302
303
# File 'lib/verizon/client.rb', line 301

def diagnostics_settings
  @diagnostics_settings ||= DiagnosticsSettingsController.new @global_configuration
end

#diagnostics_subscriptionsDiagnosticsSubscriptionsController

Access to diagnostics_subscriptions controller.

Returns:



283
284
285
# File 'lib/verizon/client.rb', line 283

def diagnostics_subscriptions
  @diagnostics_subscriptions ||= DiagnosticsSubscriptionsController.new @global_configuration
end

#e_uicc_device_profile_managementEUICCDeviceProfileManagementController

Access to e_uicc_device_profile_management controller.

Returns:



103
104
105
# File 'lib/verizon/client.rb', line 103

def e_uicc_device_profile_management
  @e_uicc_device_profile_management ||= EUICCDeviceProfileManagementController.new @global_configuration
end

#exclusionsExclusionsController

Access to exclusions controller.

Returns:



115
116
117
# File 'lib/verizon/client.rb', line 115

def exclusions
  @exclusions ||= ExclusionsController.new @global_configuration
end

#firmware_v1FirmwareV1Controller

Access to firmware_v1 controller.

Returns:



157
158
159
# File 'lib/verizon/client.rb', line 157

def firmware_v1
  @firmware_v1 ||= FirmwareV1Controller.new @global_configuration
end

#firmware_v3FirmwareV3Controller

Access to firmware_v3 controller.

Returns:



247
248
249
# File 'lib/verizon/client.rb', line 247

def firmware_v3
  @firmware_v3 ||= FirmwareV3Controller.new @global_configuration
end

#fixed_wireless_qualificationFixedWirelessQualificationController

Access to fixed_wireless_qualification controller.

Returns:



379
380
381
# File 'lib/verizon/client.rb', line 379

def fixed_wireless_qualification
  @fixed_wireless_qualification ||= FixedWirelessQualificationController.new @global_configuration
end

#global_reportingGlobalReportingController

Access to global_reporting controller.

Returns:



439
440
441
# File 'lib/verizon/client.rb', line 439

def global_reporting
  @global_reporting ||= GlobalReportingController.new @global_configuration
end

#hyper_precise_location_callbacksHyperPreciseLocationCallbacksController

Access to hyper_precise_location_callbacks controller.

Returns:



349
350
351
# File 'lib/verizon/client.rb', line 349

def hyper_precise_location_callbacks
  @hyper_precise_location_callbacks ||= HyperPreciseLocationCallbacksController.new @global_configuration
end

#initialize_auth_managers(global_config) ⇒ Object

Initializes the auth managers hash used for authenticating API calls.

Parameters:

  • global_config (GlobalConfiguration)

    The global configuration of the SDK)



495
496
497
498
499
500
501
502
503
# File 'lib/verizon/client.rb', line 495

def initialize_auth_managers(global_config)
  @auth_managers = {}
  http_client_config = global_config.client_configuration
  %w[thingspace_oauth VZ-M2M-Token].each { |auth| @auth_managers[auth] = nil }
  @auth_managers['thingspace_oauth'] = ThingspaceOauth.new(
    http_client_config.thingspace_oauth_credentials, global_config
  )
  @auth_managers['VZ-M2M-Token'] = VZM2mToken.new(http_client_config.vz_m2m_token_credentials)
end

#m_5g_bi_device_actionsM5gBIDeviceActionsController

Access to m_5g_bi_device_actions controller.

Returns:



451
452
453
# File 'lib/verizon/client.rb', line 451

def m_5g_bi_device_actions
  @m_5g_bi_device_actions ||= M5gBIDeviceActionsController.new @global_configuration
end

#m_5g_edge_platformsM5gEdgePlatformsController

Access to m_5g_edge_platforms controller.

Returns:



19
20
21
# File 'lib/verizon/client.rb', line 19

def m_5g_edge_platforms
  @m_5g_edge_platforms ||= M5gEdgePlatformsController.new @global_configuration
end

#m_v2_triggersMV2TriggersController

Access to m_v2_triggers controller.

Returns:



445
446
447
# File 'lib/verizon/client.rb', line 445

def m_v2_triggers
  @m_v2_triggers ||= MV2TriggersController.new @global_configuration
end

#managing_e_sim_profilesManagingESIMProfilesController

Access to managing_e_sim_profiles controller.

Returns:



385
386
387
# File 'lib/verizon/client.rb', line 385

def managing_e_sim_profiles
  @managing_e_sim_profiles ||= ManagingESIMProfilesController.new @global_configuration
end

#oauth_authorizationOauthAuthorizationController

Access to oauth_authorization controller.

Returns:



457
458
459
# File 'lib/verizon/client.rb', line 457

def oauth_authorization
  @oauth_authorization ||= OauthAuthorizationController.new @global_configuration
end

#performance_metricsPerformanceMetricsController

Access to performance_metrics controller.

Returns:



277
278
279
# File 'lib/verizon/client.rb', line 277

def performance_metrics
  @performance_metrics ||= PerformanceMetricsController.new @global_configuration
end

#promotion_period_informationPromotionPeriodInformationController

Access to promotion_period_information controller.

Returns:



415
416
417
# File 'lib/verizon/client.rb', line 415

def promotion_period_information
  @promotion_period_information ||= PromotionPeriodInformationController.new @global_configuration
end

#pwnPWNController

Access to pwn controller.

Returns:



409
410
411
# File 'lib/verizon/client.rb', line 409

def pwn
  @pwn ||= PWNController.new @global_configuration
end

#retrieve_the_triggersRetrieveTheTriggersController

Access to retrieve_the_triggers controller.

Returns:



421
422
423
# File 'lib/verizon/client.rb', line 421

def retrieve_the_triggers
  @retrieve_the_triggers ||= RetrieveTheTriggersController.new @global_configuration
end

#server_loggingServerLoggingController

Access to server_logging controller.

Returns:



211
212
213
# File 'lib/verizon/client.rb', line 211

def server_logging
  @server_logging ||= ServerLoggingController.new @global_configuration
end

#service_endpointsServiceEndpointsController

Access to service_endpoints controller.

Returns:



25
26
27
# File 'lib/verizon/client.rb', line 25

def service_endpoints
  @service_endpoints ||= ServiceEndpointsController.new @global_configuration
end

#service_plansServicePlansController

Access to service_plans controller.

Returns:



79
80
81
# File 'lib/verizon/client.rb', line 79

def service_plans
  @service_plans ||= ServicePlansController.new @global_configuration
end

#service_profilesServiceProfilesController

Access to service_profiles controller.

Returns:



31
32
33
# File 'lib/verizon/client.rb', line 31

def service_profiles
  @service_profiles ||= ServiceProfilesController.new @global_configuration
end

#session_managementSessionManagementController

Access to session_management controller.

Returns:



61
62
63
# File 'lib/verizon/client.rb', line 61

def session_management
  @session_management ||= SessionManagementController.new @global_configuration
end

#sim_actionsSIMActionsController

Access to sim_actions controller.

Returns:



433
434
435
# File 'lib/verizon/client.rb', line 433

def sim_actions
  @sim_actions ||= SIMActionsController.new @global_configuration
end

#sim_secure_for_io_t_licensesSIMSecureForIoTLicensesController

Access to sim_secure_for_io_t_licenses controller.

Returns:



265
266
267
# File 'lib/verizon/client.rb', line 265

def sim_secure_for_io_t_licenses
  @sim_secure_for_io_t_licenses ||= SIMSecureForIoTLicensesController.new @global_configuration
end

#smsSMSController

Access to sms controller.

Returns:



55
56
57
# File 'lib/verizon/client.rb', line 55

def sms
  @sms ||= SMSController.new @global_configuration
end

#software_management_callbacks_v1SoftwareManagementCallbacksV1Controller

Access to software_management_callbacks_v1 controller.

Returns:



163
164
165
# File 'lib/verizon/client.rb', line 163

def software_management_callbacks_v1
  @software_management_callbacks_v1 ||= SoftwareManagementCallbacksV1Controller.new @global_configuration
end

#software_management_callbacks_v2SoftwareManagementCallbacksV2Controller

Access to software_management_callbacks_v2 controller.

Returns:



193
194
195
# File 'lib/verizon/client.rb', line 193

def software_management_callbacks_v2
  @software_management_callbacks_v2 ||= SoftwareManagementCallbacksV2Controller.new @global_configuration
end

#software_management_callbacks_v3SoftwareManagementCallbacksV3Controller

Access to software_management_callbacks_v3 controller.

Returns:



259
260
261
# File 'lib/verizon/client.rb', line 259

def software_management_callbacks_v3
  @software_management_callbacks_v3 ||= SoftwareManagementCallbacksV3Controller.new @global_configuration
end

#software_management_licenses_v1SoftwareManagementLicensesV1Controller

Access to software_management_licenses_v1 controller.

Returns:



151
152
153
# File 'lib/verizon/client.rb', line 151

def software_management_licenses_v1
  @software_management_licenses_v1 ||= SoftwareManagementLicensesV1Controller.new @global_configuration
end

#software_management_licenses_v2SoftwareManagementLicensesV2Controller

Access to software_management_licenses_v2 controller.

Returns:



181
182
183
# File 'lib/verizon/client.rb', line 181

def software_management_licenses_v2
  @software_management_licenses_v2 ||= SoftwareManagementLicensesV2Controller.new @global_configuration
end

#software_management_licenses_v3SoftwareManagementLicensesV3Controller

Access to software_management_licenses_v3 controller.

Returns:



229
230
231
# File 'lib/verizon/client.rb', line 229

def software_management_licenses_v3
  @software_management_licenses_v3 ||= SoftwareManagementLicensesV3Controller.new @global_configuration
end

#software_management_reports_v1SoftwareManagementReportsV1Controller

Access to software_management_reports_v1 controller.

Returns:



169
170
171
# File 'lib/verizon/client.rb', line 169

def software_management_reports_v1
  @software_management_reports_v1 ||= SoftwareManagementReportsV1Controller.new @global_configuration
end

#software_management_reports_v2SoftwareManagementReportsV2Controller

Access to software_management_reports_v2 controller.

Returns:



199
200
201
# File 'lib/verizon/client.rb', line 199

def software_management_reports_v2
  @software_management_reports_v2 ||= SoftwareManagementReportsV2Controller.new @global_configuration
end

#software_management_reports_v3SoftwareManagementReportsV3Controller

Access to software_management_reports_v3 controller.

Returns:



241
242
243
# File 'lib/verizon/client.rb', line 241

def software_management_reports_v3
  @software_management_reports_v3 ||= SoftwareManagementReportsV3Controller.new @global_configuration
end

#software_management_subscriptions_v1SoftwareManagementSubscriptionsV1Controller

Access to software_management_subscriptions_v1 controller.

Returns:



145
146
147
# File 'lib/verizon/client.rb', line 145

def software_management_subscriptions_v1
  @software_management_subscriptions_v1 ||= SoftwareManagementSubscriptionsV1Controller.new @global_configuration
end

#software_management_subscriptions_v2SoftwareManagementSubscriptionsV2Controller

Access to software_management_subscriptions_v2 controller.

Returns:



175
176
177
# File 'lib/verizon/client.rb', line 175

def software_management_subscriptions_v2
  @software_management_subscriptions_v2 ||= SoftwareManagementSubscriptionsV2Controller.new @global_configuration
end

#software_management_subscriptions_v3SoftwareManagementSubscriptionsV3Controller

Access to software_management_subscriptions_v3 controller.

Returns:



223
224
225
# File 'lib/verizon/client.rb', line 223

def software_management_subscriptions_v3
  @software_management_subscriptions_v3 ||= SoftwareManagementSubscriptionsV3Controller.new @global_configuration
end

#targetsTargetsController

Access to targets controller.

Returns:



319
320
321
# File 'lib/verizon/client.rb', line 319

def targets
  @targets ||= TargetsController.new @global_configuration
end

#thing_space_quality_of_service_api_actionsThingSpaceQualityOfServiceAPIActionsController

Access to thing_space_quality_of_service_api_actions controller.

Returns:



403
404
405
# File 'lib/verizon/client.rb', line 403

def thing_space_quality_of_service_api_actions
  @thing_space_quality_of_service_api_actions ||= ThingSpaceQualityOfServiceAPIActionsController.new @global_configuration
end

#thingspace_oauthObject

Returns the configured authentication thingspace_oauth instance.



13
14
15
# File 'lib/verizon/client.rb', line 13

def thingspace_oauth
  @auth_managers['thingspace_oauth']
end

#update_triggersUpdateTriggersController

Access to update_triggers controller.

Returns:



427
428
429
# File 'lib/verizon/client.rb', line 427

def update_triggers
  @update_triggers ||= UpdateTriggersController.new @global_configuration
end

#usage_trigger_managementUsageTriggerManagementController

Access to usage_trigger_management controller.

Returns:



133
134
135
# File 'lib/verizon/client.rb', line 133

def usage_trigger_management
  @usage_trigger_management ||= UsageTriggerManagementController.new @global_configuration
end

#wireless_network_performanceWirelessNetworkPerformanceController

Access to wireless_network_performance controller.

Returns:



373
374
375
# File 'lib/verizon/client.rb', line 373

def wireless_network_performance
  @wireless_network_performance ||= WirelessNetworkPerformanceController.new @global_configuration
end