Class: SurgeAPI::Models::Message::Attachment

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/surge_api/models/message.rb,
sig/surge_api/models/message.rbs

Defined Under Namespace

Modules: Type

Instance Attribute 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(id: nil, type: nil, url: nil) ⇒ Object

An Attachment is a file that can be sent with a message.

Parameters:

  • id (String) (defaults to: nil)

    Unique identifier for the object.

  • type (Symbol, SurgeAPI::Models::Message::Attachment::Type) (defaults to: nil)

    The type of attachment.

  • url (String) (defaults to: nil)

    The URL of the attachment.



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
# File 'lib/surge_api/models/message.rb', line 69

class Attachment < SurgeAPI::Internal::Type::BaseModel
  # @!attribute id
  #   Unique identifier for the object.
  #
  #   @return [String, nil]
  optional :id, String

  # @!attribute type
  #   The type of attachment.
  #
  #   @return [Symbol, SurgeAPI::Models::Message::Attachment::Type, nil]
  optional :type, enum: -> { SurgeAPI::Message::Attachment::Type }

  # @!attribute url
  #   The URL of the attachment.
  #
  #   @return [String, nil]
  optional :url, String

  # @!method initialize(id: nil, type: nil, url: nil)
  #   An Attachment is a file that can be sent with a message.
  #
  #   @param id [String] Unique identifier for the object.
  #
  #   @param type [Symbol, SurgeAPI::Models::Message::Attachment::Type] The type of attachment.
  #
  #   @param url [String] The URL of the attachment.

  # The type of attachment.
  #
  # @see SurgeAPI::Models::Message::Attachment#type
  module Type
    extend SurgeAPI::Internal::Type::Enum

    FILE = :file
    IMAGE = :image
    LINK = :link
    CONTACT = :contact
    VIDEO = :video

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

Instance Attribute Details

#idString?

Unique identifier for the object.

Parameters:

  • (String)

Returns:

  • (String, nil)


74
# File 'lib/surge_api/models/message.rb', line 74

optional :id, String

#typeSymbol, ...

The type of attachment.



80
# File 'lib/surge_api/models/message.rb', line 80

optional :type, enum: -> { SurgeAPI::Message::Attachment::Type }

#urlString?

The URL of the attachment.

Parameters:

  • (String)

Returns:

  • (String, nil)


86
# File 'lib/surge_api/models/message.rb', line 86

optional :url, String

Instance Method Details

#to_hash{

Returns:

  • ({)


93
# File 'sig/surge_api/models/message.rbs', line 93

def to_hash: -> {