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, oauth_2credentials: nil, thingspace_oauth_credentials: nil, vz_m2m_token: 'TODO: Replace', config: nil) ⇒ Client

Returns a new instance of Client.



454
455
456
457
458
459
460
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
# File 'lib/verizon/client.rb', line 454

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, oauth_2credentials: nil,
  thingspace_oauth_credentials: nil, vz_m2m_token: 'TODO: Replace',
  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,
                oauth_2credentials: oauth_2credentials,
                thingspace_oauth_credentials: thingspace_oauth_credentials,
                vz_m2m_token: vz_m2m_token
              )
            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)
                                             .global_header('VZ-M2M-Token', @config.vz_m2m_token)

  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:



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

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

#account_requestsAccountRequestsController

Access to account_requests controller.

Returns:



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

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

#account_subscriptionsAccountSubscriptionsController

Access to account_subscriptions controller.

Returns:



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

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

#accountsAccountsController

Access to accounts controller.

Returns:



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

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

#anomaly_settingsAnomalySettingsController

Access to anomaly_settings controller.

Returns:



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

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

#anomaly_triggersAnomalyTriggersController

Access to anomaly_triggers controller.

Returns:



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

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

#anomaly_triggers_v2AnomalyTriggersV2Controller

Access to anomaly_triggers_v2 controller.

Returns:



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

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

#billingBillingController

Access to billing controller.

Returns:



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

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

#campaigns_v2CampaignsV2Controller

Access to campaigns_v2 controller.

Returns:



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

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

#campaigns_v3CampaignsV3Controller

Access to campaigns_v3 controller.

Returns:



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

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

#client_loggingClientLoggingController

Access to client_logging controller.

Returns:



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

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

#cloud_connector_devicesCloudConnectorDevicesController

Access to cloud_connector_devices controller.

Returns:



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

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

#cloud_connector_subscriptionsCloudConnectorSubscriptionsController

Access to cloud_connector_subscriptions controller.

Returns:



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

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

#configuration_filesConfigurationFilesController

Access to configuration_files controller.

Returns:



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

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

#connectivity_callbacksConnectivityCallbacksController

Access to connectivity_callbacks controller.

Returns:



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

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

#device_actionsDeviceActionsController

Access to device_actions controller.

Returns:



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

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

#device_diagnosticsDeviceDiagnosticsController

Access to device_diagnostics controller.

Returns:



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

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

#device_groupsDeviceGroupsController

Access to device_groups controller.

Returns:



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

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

#device_location_callbacksDeviceLocationCallbacksController

Access to device_location_callbacks controller.

Returns:



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

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

#device_managementDeviceManagementController

Access to device_management controller.

Returns:



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

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

#device_monitoringDeviceMonitoringController

Access to device_monitoring controller.

Returns:



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

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

#device_profile_managementDeviceProfileManagementController

Access to device_profile_management controller.

Returns:



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

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

#device_reportsDeviceReportsController

Access to device_reports controller.

Returns:



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

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

#device_service_managementDeviceServiceManagementController

Access to device_service_management controller.

Returns:



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

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

#device_sms_messagingDeviceSMSMessagingController

Access to device_sms_messaging controller.

Returns:



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

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

#devices_location_subscriptionsDevicesLocationSubscriptionsController

Access to devices_location_subscriptions controller.

Returns:



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

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

#devices_locationsDevicesLocationsController

Access to devices_locations controller.

Returns:



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

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

#diagnostics_callbacksDiagnosticsCallbacksController

Access to diagnostics_callbacks controller.

Returns:



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

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

#diagnostics_factory_resetDiagnosticsFactoryResetController

Access to diagnostics_factory_reset controller.

Returns:



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

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

#diagnostics_historyDiagnosticsHistoryController

Access to diagnostics_history controller.

Returns:



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

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

#diagnostics_observationsDiagnosticsObservationsController

Access to diagnostics_observations controller.

Returns:



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

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

#diagnostics_settingsDiagnosticsSettingsController

Access to diagnostics_settings controller.

Returns:



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

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

#diagnostics_subscriptionsDiagnosticsSubscriptionsController

Access to diagnostics_subscriptions controller.

Returns:



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

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

#e_uicc_device_profile_managementEUICCDeviceProfileManagementController

Access to e_uicc_device_profile_management controller.

Returns:



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

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

#exclusionsExclusionsController

Access to exclusions controller.

Returns:



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

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

#firmware_v1FirmwareV1Controller

Access to firmware_v1 controller.

Returns:



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

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

#firmware_v3FirmwareV3Controller

Access to firmware_v3 controller.

Returns:



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

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

#fixed_wireless_qualificationFixedWirelessQualificationController

Access to fixed_wireless_qualification controller.

Returns:



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

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

#global_reportingGlobalReportingController

Access to global_reporting controller.

Returns:



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

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

#hyper_precise_location_callbacksHyperPreciseLocationCallbacksController

Access to hyper_precise_location_callbacks controller.

Returns:



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

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)



491
492
493
494
495
496
497
498
499
# File 'lib/verizon/client.rb', line 491

def initialize_auth_managers(global_config)
  @auth_managers = {}
  http_client_config = global_config.client_configuration
  %w[oAuth2 thingspace_oauth].each { |auth| @auth_managers[auth] = nil }
  @auth_managers['oAuth2'] = Oauth2.new(http_client_config.oauth_2credentials, global_config)
  @auth_managers['thingspace_oauth'] = ThingspaceOauth.new(
    http_client_config.thingspace_oauth_credentials, global_config
  )
end

#m_5g_edge_platformsM5gEdgePlatformsController

Access to m_5g_edge_platforms controller.

Returns:



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

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

#managing_e_sim_profilesManagingESIMProfilesController

Access to managing_e_sim_profiles controller.

Returns:



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

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

#mecMECController

Access to mec controller.

Returns:



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

def mec
  @mec ||= MECController.new @global_configuration
end

#oauth_2Object

Returns the configured authentication oAuth2 instance.



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

def oauth_2
  @auth_managers['oAuth2']
end

#oauth_authorizationOauthAuthorizationController

Access to oauth_authorization controller.

Returns:



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

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

#performance_metricsPerformanceMetricsController

Access to performance_metrics controller.

Returns:



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

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

#promotion_period_informationPromotionPeriodInformationController

Access to promotion_period_information controller.

Returns:



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

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

#retrieve_the_triggersRetrieveTheTriggersController

Access to retrieve_the_triggers controller.

Returns:



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

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

#server_loggingServerLoggingController

Access to server_logging controller.

Returns:



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

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

#service_endpointsServiceEndpointsController

Access to service_endpoints controller.

Returns:



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

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

#service_plansServicePlansController

Access to service_plans controller.

Returns:



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

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

#service_profilesServiceProfilesController

Access to service_profiles controller.

Returns:



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

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

#session_managementSessionManagementController

Access to session_management controller.

Returns:



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

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

#sim_actionsSIMActionsController

Access to sim_actions controller.

Returns:



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

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:



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

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

#smsSMSController

Access to sms controller.

Returns:



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

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

#software_management_callbacks_v1SoftwareManagementCallbacksV1Controller

Access to software_management_callbacks_v1 controller.

Returns:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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

#targetsTargetsController

Access to targets controller.

Returns:



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

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:



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

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.



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

def thingspace_oauth
  @auth_managers['thingspace_oauth']
end

#update_triggersUpdateTriggersController

Access to update_triggers controller.

Returns:



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

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

#usage_trigger_managementUsageTriggerManagementController

Access to usage_trigger_management controller.

Returns:



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

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

#wireless_network_performanceWirelessNetworkPerformanceController

Access to wireless_network_performance controller.

Returns:



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

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