Module: MethodRuby::Models::EntityCreateParams::Body

Extended by:
Internal::Type::Union
Defined in:
lib/method_ruby/models/entity_create_params.rb

Defined Under Namespace

Classes: Corporation, Individual

Instance Method Summary collapse

Methods included from Internal::Type::Union

==, ===, coerce, dump, hash, inspect, to_sorbet_type, variants

Methods included from Internal::Util::SorbetRuntimeSupport

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

Methods included from Internal::Type::Converter

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

Instance Method Details

#initialize(first_name:, last_name:, dob: nil, email: nil, phone: nil) ⇒ Object

Parameters:

  • first_name (String)
  • last_name (String)
  • dob (Date) (defaults to: nil)
  • email (String) (defaults to: nil)
  • phone (String) (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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/method_ruby/models/entity_create_params.rb', line 31

module Body
  extend MethodRuby::Internal::Type::Union

  discriminator :type

  variant :individual, -> { MethodRuby::EntityCreateParams::Body::Individual }

  variant :corporation, -> { MethodRuby::EntityCreateParams::Body::Corporation }

  class Individual < MethodRuby::Internal::Type::BaseModel
    # @!attribute individual
    #
    #   @return [MethodRuby::Models::EntityCreateParams::Body::Individual::Individual]
    required :individual, -> { MethodRuby::EntityCreateParams::Body::Individual::Individual }

    # @!attribute type
    #
    #   @return [Symbol, :individual]
    required :type, const: :individual

    # @!attribute address
    #
    #   @return [MethodRuby::Models::Address, nil]
    optional :address, -> { MethodRuby::Address }

    # @!attribute metadata
    #   Custom metadata associated with the resource
    #
    #   @return [Hash{Symbol=>Object}, nil]
    optional :metadata,
             MethodRuby::Internal::Type::HashOf[MethodRuby::Internal::Type::Unknown],
             nil?: true

    # @!method initialize(individual:, address: nil, metadata: nil, type: :individual)
    #   @param individual [MethodRuby::Models::EntityCreateParams::Body::Individual::Individual]
    #
    #   @param address [MethodRuby::Models::Address]
    #
    #   @param metadata [Hash{Symbol=>Object}, nil] Custom metadata associated with the resource
    #
    #   @param type [Symbol, :individual]

    # @see MethodRuby::Models::EntityCreateParams::Body::Individual#individual
    class Individual < MethodRuby::Internal::Type::BaseModel
      # @!attribute first_name
      #
      #   @return [String]
      required :first_name, String

      # @!attribute last_name
      #
      #   @return [String]
      required :last_name, String

      # @!attribute dob
      #
      #   @return [Date, nil]
      optional :dob, Date

      # @!attribute email
      #
      #   @return [String, nil]
      optional :email, String

      # @!attribute phone
      #
      #   @return [String, nil]
      optional :phone, String

      # @!method initialize(first_name:, last_name:, dob: nil, email: nil, phone: nil)
      #   @param first_name [String]
      #   @param last_name [String]
      #   @param dob [Date]
      #   @param email [String]
      #   @param phone [String]
    end
  end

  class Corporation < MethodRuby::Internal::Type::BaseModel
    # @!attribute corporation
    #
    #   @return [MethodRuby::Models::EntityCreateParams::Body::Corporation::Corporation]
    required :corporation, -> { MethodRuby::EntityCreateParams::Body::Corporation::Corporation }

    # @!attribute type
    #
    #   @return [Symbol, :corporation]
    required :type, const: :corporation

    # @!attribute address
    #
    #   @return [MethodRuby::Models::Address, nil]
    optional :address, -> { MethodRuby::Address }

    # @!attribute metadata
    #   Custom metadata associated with the resource
    #
    #   @return [Hash{Symbol=>Object}, nil]
    optional :metadata,
             MethodRuby::Internal::Type::HashOf[MethodRuby::Internal::Type::Unknown],
             nil?: true

    # @!method initialize(corporation:, address: nil, metadata: nil, type: :corporation)
    #   @param corporation [MethodRuby::Models::EntityCreateParams::Body::Corporation::Corporation]
    #
    #   @param address [MethodRuby::Models::Address]
    #
    #   @param metadata [Hash{Symbol=>Object}, nil] Custom metadata associated with the resource
    #
    #   @param type [Symbol, :corporation]

    # @see MethodRuby::Models::EntityCreateParams::Body::Corporation#corporation
    class Corporation < MethodRuby::Internal::Type::BaseModel
      # @!attribute name
      #
      #   @return [String]
      required :name, String

      # @!attribute dba
      #
      #   @return [String, nil]
      optional :dba, String

      # @!attribute ein
      #
      #   @return [String, nil]
      optional :ein, String

      # @!attribute owners
      #
      #   @return [Array<MethodRuby::Models::EntityCorporationOwner>, nil]
      optional :owners, -> { MethodRuby::Internal::Type::ArrayOf[MethodRuby::EntityCorporationOwner] }

      # @!method initialize(name:, dba: nil, ein: nil, owners: nil)
      #   @param name [String]
      #   @param dba [String]
      #   @param ein [String]
      #   @param owners [Array<MethodRuby::Models::EntityCorporationOwner>]
    end
  end

  # @!method self.variants
  #   @return [Array(MethodRuby::Models::EntityCreateParams::Body::Individual, MethodRuby::Models::EntityCreateParams::Body::Corporation)]
end