Class: PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rb

Defined Under Namespace

Modules: Source, State

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(config_id:, phone_number:, source:, state:, timestamp:, reason: nil) ⇒ Object

Some parameter documentations has been truncated, see PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event for more details.

Parameters:



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rb', line 30

class Event < PreludeSDK::Internal::Type::BaseModel
  # @!attribute config_id
  #   The subscription configuration ID.
  #
  #   @return [String]
  required :config_id, String

  # @!attribute phone_number
  #   The phone number in E.164 format.
  #
  #   @return [String]
  required :phone_number, String

  # @!attribute source
  #   How the subscription state was changed:
  #
  #   - `MO_KEYWORD` - User sent a keyword (STOP/START)
  #   - `API` - Changed via API
  #   - `CSV_IMPORT` - Imported from CSV
  #   - `CARRIER_DISCONNECT` - Automatically unsubscribed due to carrier disconnect
  #
  #   @return [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::Source]
  required :source,
           enum: -> { PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::Source }

  # @!attribute state
  #   The subscription state after this event:
  #
  #   - `SUB` - Subscribed (user can receive marketing messages)
  #   - `UNSUB` - Unsubscribed (user has opted out)
  #
  #   @return [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::State]
  required :state,
           enum: -> { PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::State }

  # @!attribute timestamp
  #   The date and time when the event occurred.
  #
  #   @return [Time]
  required :timestamp, Time

  # @!attribute reason
  #   Additional context about the state change (e.g., the keyword that was sent).
  #
  #   @return [String, nil]
  optional :reason, String

  # @!method initialize(config_id:, phone_number:, source:, state:, timestamp:, reason: nil)
  #   Some parameter documentations has been truncated, see
  #   {PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event} for
  #   more details.
  #
  #   @param config_id [String] The subscription configuration ID.
  #
  #   @param phone_number [String] The phone number in E.164 format.
  #
  #   @param source [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::Source] How the subscription state was changed:
  #
  #   @param state [Symbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::State] The subscription state after this event:
  #
  #   @param timestamp [Time] The date and time when the event occurred.
  #
  #   @param reason [String] Additional context about the state change (e.g., the keyword that was sent).

  # How the subscription state was changed:
  #
  # - `MO_KEYWORD` - User sent a keyword (STOP/START)
  # - `API` - Changed via API
  # - `CSV_IMPORT` - Imported from CSV
  # - `CARRIER_DISCONNECT` - Automatically unsubscribed due to carrier disconnect
  #
  # @see PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event#source
  module Source
    extend PreludeSDK::Internal::Type::Enum

    MO_KEYWORD = :MO_KEYWORD
    API = :API
    CSV_IMPORT = :CSV_IMPORT
    CARRIER_DISCONNECT = :CARRIER_DISCONNECT

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # The subscription state after this event:
  #
  # - `SUB` - Subscribed (user can receive marketing messages)
  # - `UNSUB` - Unsubscribed (user has opted out)
  #
  # @see PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event#state
  module State
    extend PreludeSDK::Internal::Type::Enum

    SUB = :SUB
    UNSUB = :UNSUB

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#config_idString

The subscription configuration ID.

Returns:

  • (String)


35
# File 'lib/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rb', line 35

required :config_id, String

#phone_numberString

The phone number in E.164 format.

Returns:

  • (String)


41
# File 'lib/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rb', line 41

required :phone_number, String

#reasonString?

Additional context about the state change (e.g., the keyword that was sent).

Returns:

  • (String, nil)


75
# File 'lib/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rb', line 75

optional :reason, String

#sourceSymbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::Source

How the subscription state was changed:

  • ‘MO_KEYWORD` - User sent a keyword (STOP/START)

  • ‘API` - Changed via API

  • ‘CSV_IMPORT` - Imported from CSV

  • ‘CARRIER_DISCONNECT` - Automatically unsubscribed due to carrier disconnect



52
53
# File 'lib/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rb', line 52

required :source,
enum: -> { PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::Source }

#stateSymbol, PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::State

The subscription state after this event:

  • ‘SUB` - Subscribed (user can receive marketing messages)

  • ‘UNSUB` - Unsubscribed (user has opted out)



62
63
# File 'lib/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rb', line 62

required :state,
enum: -> { PreludeSDK::Models::NotifyListSubscriptionPhoneNumberEventsResponse::Event::State }

#timestampTime

The date and time when the event occurred.

Returns:

  • (Time)


69
# File 'lib/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rb', line 69

required :timestamp, Time

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/prelude_sdk/models/notify_list_subscription_phone_number_events_response.rb', line 110