Class: Trycourier::Models::NotificationGetContent::Block

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/trycourier/models/notification_get_content.rb

Defined Under Namespace

Modules: Content, Locale, Type

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(children: nil, parent: nil) ⇒ Object

Parameters:

  • children (String, nil) (defaults to: nil)
  • parent (String, nil) (defaults to: nil)


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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/trycourier/models/notification_get_content.rb', line 31

class Block < Trycourier::Internal::Type::BaseModel
  # @!attribute id
  #
  #   @return [String]
  required :id, String

  # @!attribute type
  #
  #   @return [Symbol, Trycourier::Models::NotificationGetContent::Block::Type]
  required :type, enum: -> { Trycourier::NotificationGetContent::Block::Type }

  # @!attribute alias_
  #
  #   @return [String, nil]
  optional :alias_, String, api_name: :alias, nil?: true

  # @!attribute checksum
  #
  #   @return [String, nil]
  optional :checksum, String, nil?: true

  # @!attribute content
  #
  #   @return [String, Trycourier::Models::NotificationGetContent::Block::Content::NotificationContentHierarchy, nil]
  optional :content, union: -> { Trycourier::NotificationGetContent::Block::Content }, nil?: true

  # @!attribute context
  #
  #   @return [String, nil]
  optional :context, String, nil?: true

  # @!attribute locales
  #
  #   @return [Hash{Symbol=>String, Trycourier::Models::NotificationGetContent::Block::Locale::NotificationContentHierarchy}, nil]
  optional :locales,
           -> {
             Trycourier::Internal::Type::HashOf[union: Trycourier::NotificationGetContent::Block::Locale]
           },
           nil?: true

  # @!method initialize(id:, type:, alias_: nil, checksum: nil, content: nil, context: nil, locales: nil)
  #   @param id [String]
  #   @param type [Symbol, Trycourier::Models::NotificationGetContent::Block::Type]
  #   @param alias_ [String, nil]
  #   @param checksum [String, nil]
  #   @param content [String, Trycourier::Models::NotificationGetContent::Block::Content::NotificationContentHierarchy, nil]
  #   @param context [String, nil]
  #   @param locales [Hash{Symbol=>String, Trycourier::Models::NotificationGetContent::Block::Locale::NotificationContentHierarchy}, nil]

  # @see Trycourier::Models::NotificationGetContent::Block#type
  module Type
    extend Trycourier::Internal::Type::Enum

    ACTION = :action
    DIVIDER = :divider
    IMAGE = :image
    JSONNET = :jsonnet
    LIST = :list
    MARKDOWN = :markdown
    QUOTE = :quote
    TEMPLATE = :template
    TEXT = :text

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

  # @see Trycourier::Models::NotificationGetContent::Block#content
  module Content
    extend Trycourier::Internal::Type::Union

    variant String

    variant -> { Trycourier::NotificationGetContent::Block::Content::NotificationContentHierarchy }

    class NotificationContentHierarchy < Trycourier::Internal::Type::BaseModel
      # @!attribute children
      #
      #   @return [String, nil]
      optional :children, String, nil?: true

      # @!attribute parent
      #
      #   @return [String, nil]
      optional :parent, String, nil?: true

      # @!method initialize(children: nil, parent: nil)
      #   @param children [String, nil]
      #   @param parent [String, nil]
    end

    # @!method self.variants
    #   @return [Array(String, Trycourier::Models::NotificationGetContent::Block::Content::NotificationContentHierarchy)]
  end

  module Locale
    extend Trycourier::Internal::Type::Union

    variant String

    variant -> { Trycourier::NotificationGetContent::Block::Locale::NotificationContentHierarchy }

    class NotificationContentHierarchy < Trycourier::Internal::Type::BaseModel
      # @!attribute children
      #
      #   @return [String, nil]
      optional :children, String, nil?: true

      # @!attribute parent
      #
      #   @return [String, nil]
      optional :parent, String, nil?: true

      # @!method initialize(children: nil, parent: nil)
      #   @param children [String, nil]
      #   @param parent [String, nil]
    end

    # @!method self.variants
    #   @return [Array(String, Trycourier::Models::NotificationGetContent::Block::Locale::NotificationContentHierarchy)]
  end
end

Instance Attribute Details

#alias_String?

Returns:

  • (String, nil)


45
# File 'lib/trycourier/models/notification_get_content.rb', line 45

optional :alias_, String, api_name: :alias, nil?: true

#checksumString?

Returns:

  • (String, nil)


50
# File 'lib/trycourier/models/notification_get_content.rb', line 50

optional :checksum, String, nil?: true

#contentString, ...



55
# File 'lib/trycourier/models/notification_get_content.rb', line 55

optional :content, union: -> { Trycourier::NotificationGetContent::Block::Content }, nil?: true

#contextString?

Returns:

  • (String, nil)


60
# File 'lib/trycourier/models/notification_get_content.rb', line 60

optional :context, String, nil?: true

#idString

Returns:

  • (String)


35
# File 'lib/trycourier/models/notification_get_content.rb', line 35

required :id, String

#localesHash{Symbol=>String, Trycourier::Models::NotificationGetContent::Block::Locale::NotificationContentHierarchy}?



65
66
67
68
69
# File 'lib/trycourier/models/notification_get_content.rb', line 65

optional :locales,
-> {
  Trycourier::Internal::Type::HashOf[union: Trycourier::NotificationGetContent::Block::Locale]
},
nil?: true

#typeSymbol, Trycourier::Models::NotificationGetContent::Block::Type



40
# File 'lib/trycourier/models/notification_get_content.rb', line 40

required :type, enum: -> { Trycourier::NotificationGetContent::Block::Type }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/trycourier/models/notification_get_content.rb', line 94


.variantsArray(String, Trycourier::Models::NotificationGetContent::Block::Content::NotificationContentHierarchy)



# File 'lib/trycourier/models/notification_get_content.rb', line 122