Class: PaysecureApiDocumentationLive::Client
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- PaysecureApiDocumentationLive::Client
- Includes:
- CoreLibrary
- Defined in:
- lib/paysecure_api_documentation_live/client.rb,
lib/paysecure_api_documentation_live/models/client.rb
Overview
Client Model.
Instance Attribute Summary collapse
-
#auth_managers ⇒ Object
readonly
Returns the value of attribute auth_managers.
-
#city ⇒ String
TODO: Write general description for this method.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#country ⇒ String
TODO: Write general description for this method.
-
#date_of_birth ⇒ String
TODO: Write general description for this method.
-
#email ⇒ String
TODO: Write general description for this method.
-
#full_name ⇒ String
TODO: Write general description for this method.
-
#phone ⇒ String
TODO: Write general description for this method.
-
#state_code ⇒ String
TODO: Write general description for this method.
-
#street_address ⇒ String
TODO: Write general description for this method.
-
#zip_code ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_env(**overrides) ⇒ Object
Creates a client directly from environment variables.
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#ap_is ⇒ ApIsApi
Access to ap_is controller.
-
#cashier_ap_is ⇒ CashierApIsApi
Access to cashier_ap_is controller.
-
#client ⇒ Api
Access to client controller.
-
#get_balance_api ⇒ GetBalanceApi
Access to get_balance_api controller.
-
#get_balance_api_v2_orchestration ⇒ GetBalanceApiV2OrchestrationApi
Access to get_balance_api_v2_orchestration controller.
-
#global_collection ⇒ GlobalCollectionApi
Access to global_collection controller.
-
#initialize(email:, street_address:, city:, full_name:, zip_code:, country:, date_of_birth:, state_code:, phone:, additional_properties: nil) ⇒ Client
constructor
A new instance of Client.
-
#initialize_auth_managers(global_config) ⇒ Object
Initializes the auth managers hash used for authenticating API calls.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#m_paypal_wallet ⇒ MPaypalWalletApi
Access to m_paypal_wallet controller.
-
#m_virtual_cards_payout ⇒ MVirtualCardsPayoutApi
Access to m_virtual_cards_payout controller.
-
#payin ⇒ PayinApi
Access to payin controller.
-
#payin_ap_is ⇒ PayinApIsApi
Access to payin_ap_is controller.
-
#payout ⇒ PayoutApi
Access to payout controller.
-
#payout_ap_is ⇒ PayoutApIsApi
Access to payout_ap_is controller.
-
#payout_manual_review ⇒ PayoutManualReviewApi
Access to payout_manual_review controller.
-
#refund_api ⇒ RefundApi
Access to refund_api controller.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
-
#transaction_reporting ⇒ TransactionReportingApi
Access to transaction_reporting controller.
-
#trust_score ⇒ TrustScoreApi
Access to trust_score controller.
- #user_agent_detail ⇒ Object
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(email:, street_address:, city:, full_name:, zip_code:, country:, date_of_birth:, state_code:, phone:, additional_properties: nil) ⇒ Client
Returns a new instance of Client.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 112 def initialize( connection: nil, adapter: :net_http_persistent, timeout: 30, 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, bearer_auth_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, bearer_auth_credentials: bearer_auth_credentials ) else config end user_agent_params = BaseApi.user_agent_parameters @global_configuration = GlobalConfiguration.new(client_configuration: @config) .base_uri_executor(@config.method(:get_base_uri)) .global_errors(BaseApi::GLOBAL_ERRORS) .user_agent(BaseApi.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/paysecure_api_documentation_live/client.rb', line 10 def auth_managers @auth_managers end |
#city ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 22 def city @city end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 10 def config @config end |
#country ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 34 def country @country end |
#date_of_birth ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 38 def date_of_birth @date_of_birth end |
#email ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 14 def email @email end |
#full_name ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 26 def full_name @full_name end |
#phone ⇒ String
TODO: Write general description for this method
46 47 48 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 46 def phone @phone end |
#state_code ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 42 def state_code @state_code end |
#street_address ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 18 def street_address @street_address end |
#zip_code ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 30 def zip_code @zip_code end |
Class Method Details
.from_env(**overrides) ⇒ Object
Creates a client directly from environment variables.
157 158 159 160 161 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 157 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 |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 92 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. email = hash.key?('email') ? hash['email'] : nil street_address = hash.key?('street_address') ? hash['street_address'] : nil city = hash.key?('city') ? hash['city'] : nil full_name = hash.key?('full_name') ? hash['full_name'] : nil zip_code = hash.key?('zip_code') ? hash['zip_code'] : nil country = hash.key?('country') ? hash['country'] : nil date_of_birth = hash.key?('date_of_birth') ? hash['date_of_birth'] : nil state_code = hash.key?('stateCode') ? hash['stateCode'] : nil phone = hash.key?('phone') ? hash['phone'] : nil # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. Client.new(email: email, street_address: street_address, city: city, full_name: full_name, zip_code: zip_code, country: country, date_of_birth: date_of_birth, state_code: state_code, phone: phone, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 49 def self.names @_hash = {} if @_hash.nil? @_hash['email'] = 'email' @_hash['street_address'] = 'street_address' @_hash['city'] = 'city' @_hash['full_name'] = 'full_name' @_hash['zip_code'] = 'zip_code' @_hash['country'] = 'country' @_hash['date_of_birth'] = 'date_of_birth' @_hash['state_code'] = 'stateCode' @_hash['phone'] = 'phone' @_hash end |
.nullables ⇒ Object
An array for nullable fields
69 70 71 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 69 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
64 65 66 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 64 def self.optionals [] end |
Instance Method Details
#ap_is ⇒ ApIsApi
Access to ap_is controller.
18 19 20 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 18 def ap_is @ap_is ||= ApIsApi.new @global_configuration end |
#cashier_ap_is ⇒ CashierApIsApi
Access to cashier_ap_is controller.
78 79 80 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 78 def cashier_ap_is @cashier_ap_is ||= CashierApIsApi.new @global_configuration end |
#client ⇒ Api
Access to client controller.
108 109 110 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 108 def client @client ||= Api.new @global_configuration end |
#get_balance_api ⇒ GetBalanceApi
Access to get_balance_api controller.
36 37 38 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 36 def get_balance_api @get_balance_api ||= GetBalanceApi.new @global_configuration end |
#get_balance_api_v2_orchestration ⇒ GetBalanceApiV2OrchestrationApi
Access to get_balance_api_v2_orchestration controller.
90 91 92 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 90 def get_balance_api_v2_orchestration @get_balance_api_v2_orchestration ||= GetBalanceApiV2OrchestrationApi.new @global_configuration end |
#global_collection ⇒ GlobalCollectionApi
Access to global_collection controller.
96 97 98 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 96 def global_collection @global_collection ||= GlobalCollectionApi.new @global_configuration end |
#initialize_auth_managers(global_config) ⇒ Object
Initializes the auth managers hash used for authenticating API calls.
149 150 151 152 153 154 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 149 def initialize_auth_managers(global_config) @auth_managers = {} http_client_config = global_config.client_configuration %w[bearer].each { |auth| @auth_managers[auth] = nil } @auth_managers['bearer'] = Oauth2.new(http_client_config.bearer_auth_credentials) end |
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
137 138 139 140 141 142 143 144 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 137 def inspect class_name = self.class.name.split('::').last "<#{class_name} email: #{@email.inspect}, street_address: #{@street_address.inspect}, city:"\ " #{@city.inspect}, full_name: #{@full_name.inspect}, zip_code: #{@zip_code.inspect},"\ " country: #{@country.inspect}, date_of_birth: #{@date_of_birth.inspect}, state_code:"\ " #{@state_code.inspect}, phone: #{@phone.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#m_paypal_wallet ⇒ MPaypalWalletApi
Access to m_paypal_wallet controller.
60 61 62 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 60 def m_paypal_wallet @m_paypal_wallet ||= MPaypalWalletApi.new @global_configuration end |
#m_virtual_cards_payout ⇒ MVirtualCardsPayoutApi
Access to m_virtual_cards_payout controller.
66 67 68 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 66 def m_virtual_cards_payout @m_virtual_cards_payout ||= MVirtualCardsPayoutApi.new @global_configuration end |
#payin ⇒ PayinApi
Access to payin controller.
54 55 56 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 54 def @payin ||= PayinApi.new @global_configuration end |
#payin_ap_is ⇒ PayinApIsApi
Access to payin_ap_is controller.
24 25 26 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 24 def @payin_ap_is ||= PayinApIsApi.new @global_configuration end |
#payout ⇒ PayoutApi
Access to payout controller.
48 49 50 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 48 def payout @payout ||= PayoutApi.new @global_configuration end |
#payout_ap_is ⇒ PayoutApIsApi
Access to payout_ap_is controller.
30 31 32 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 30 def payout_ap_is @payout_ap_is ||= PayoutApIsApi.new @global_configuration end |
#payout_manual_review ⇒ PayoutManualReviewApi
Access to payout_manual_review controller.
102 103 104 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 102 def payout_manual_review @payout_manual_review ||= PayoutManualReviewApi.new @global_configuration end |
#refund_api ⇒ RefundApi
Access to refund_api controller.
42 43 44 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 42 def refund_api @refund_api ||= RefundApi.new @global_configuration end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
128 129 130 131 132 133 134 |
# File 'lib/paysecure_api_documentation_live/models/client.rb', line 128 def to_s class_name = self.class.name.split('::').last "<#{class_name} email: #{@email}, street_address: #{@street_address}, city: #{@city},"\ " full_name: #{@full_name}, zip_code: #{@zip_code}, country: #{@country}, date_of_birth:"\ " #{@date_of_birth}, state_code: #{@state_code}, phone: #{@phone}, additional_properties:"\ " #{@additional_properties}>" end |
#transaction_reporting ⇒ TransactionReportingApi
Access to transaction_reporting controller.
84 85 86 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 84 def transaction_reporting @transaction_reporting ||= TransactionReportingApi.new @global_configuration end |
#trust_score ⇒ TrustScoreApi
Access to trust_score controller.
72 73 74 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 72 def trust_score @trust_score ||= TrustScoreApi.new @global_configuration end |
#user_agent_detail ⇒ Object
12 13 14 |
# File 'lib/paysecure_api_documentation_live/client.rb', line 12 def user_agent_detail config.user_agent_detail end |