Class: Reach::REST::Api::Authentix::AuthenticationTrialStatItemContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ AuthenticationTrialStatItemContext

Initialize the AuthenticationTrialStatItemContext

Parameters:

  • version (Version)

    Version that contains the resource



48
49
50
51
52
53
54
55
56
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 48

def initialize(version)
    super(version)

    # Path Solution
    @solution = {  }
    @uri = "/authentix/v1/authenticationTrialStats"

    
end

Instance Method Details

#fetch(dest: :unset, trial_status: :unset, channel: :unset, configuration_id: :unset, authentication_id: :unset, country: :unset, sent_at: :unset, sent_after: :unset, sent_before: :unset) ⇒ AuthenticationTrialStatItemInstance

Fetch the AuthenticationTrialStatItemInstance

Parameters:

  • dest (String) (defaults to: :unset)

    Filter authentication trials sent only to this phone number or email. The phone number must be in the E.164 format.

  • trial_status (String) (defaults to: :unset)

    Filter authentication trials with the specified status.

  • channel (String) (defaults to: :unset)

    Filter authentication trials sent via the specified channel.

  • configuration_id (String) (defaults to: :unset)

    Filter authentication trials from the configuration whose ID matches the specified one.

  • authentication_id (String) (defaults to: :unset)

    Filter authentication trials from the authentication whose ID matches the specified one.

  • country (String) (defaults to: :unset)

    Filter authentication trials sent to the specified destination country (in ISO 3166-1 alpha-2). Only possible when ‘dest` is a phone number.

  • sent_at (Time) (defaults to: :unset)

    Filter authentication trials created at the specified date. Must be in ISO 8601 format.

  • sent_after (Time) (defaults to: :unset)

    Filter authentication trials created after the specified datetime. Must be in ISO 8601 format.

  • sent_before (Time) (defaults to: :unset)

    Filter authentication trials created before the specified datetime. Must be in ISO 8601 format.

Returns:



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 69

def fetch(
    dest: :unset, 
    trial_status: :unset, 
    channel: :unset, 
    configuration_id: :unset, 
    authentication_id: :unset, 
    country: :unset, 
    sent_at: :unset, 
    sent_after: :unset, 
    sent_before: :unset
)

    baseParams = {
    }
    params = Reach::Values.of(baseParams.merge({
    
        'dest' => dest,
        'trialStatus' => trial_status,
        'channel' => channel,
        'configurationId' => configuration_id,
        'authenticationId' => authentication_id,
        'country' => country,
        'sentAt' => Reach.serialize_iso8601_datetime(sent_at),
        'sentAfter' => Reach.serialize_iso8601_datetime(sent_after),
        'sentBefore' => Reach.serialize_iso8601_datetime(sent_before),
    }))
    
    
    payload = @version.fetch('GET', @uri, params: params)
    AuthenticationTrialStatItemInstance.new(
        @version,
        payload,
    )
end

#inspectObject

Provide a detailed, user friendly representation



114
115
116
117
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 114

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Reach.Api.Authentix.AuthenticationTrialStatItemContext #{context}>"
end

#to_sObject

Provide a user friendly representation



107
108
109
110
# File 'lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb', line 107

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Reach.Api.Authentix.AuthenticationTrialStatItemContext #{context}>"
end