Class: Amocrm::Models::LeadCreateParams::Body

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/amocrm/models/lead_create_params.rb

Defined Under Namespace

Classes: CustomFieldsValue, Embedded, TagsToAdd

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(id: nil, color: nil, name: nil) ⇒ Object

Parameters:

  • id (Integer) (defaults to: nil)
  • color (String) (defaults to: nil)
  • name (String) (defaults to: nil)


19
20
21
22
23
24
25
26
27
28
29
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
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
# File 'lib/amocrm/models/lead_create_params.rb', line 19

class Body < Amocrm::Internal::Type::BaseModel
  # @!attribute _embedded
  #   Embedded entities (lead/contact/company/source)
  #
  #   @return [Amocrm::Models::LeadCreateParams::Body::Embedded, nil]
  optional :_embedded, -> { Amocrm::LeadCreateParams::Body::Embedded }

  # @!attribute closed_at
  #
  #   @return [Integer, nil]
  optional :closed_at, Integer

  # @!attribute created_at
  #
  #   @return [Integer, nil]
  optional :created_at, Integer

  # @!attribute created_by
  #
  #   @return [Integer, nil]
  optional :created_by, Integer

  # @!attribute custom_fields_values
  #   Custom fields payload
  #
  #   @return [Array<Amocrm::Models::LeadCreateParams::Body::CustomFieldsValue>, nil]
  optional :custom_fields_values,
           -> { Amocrm::Internal::Type::ArrayOf[Amocrm::LeadCreateParams::Body::CustomFieldsValue] }

  # @!attribute group_id
  #
  #   @return [Integer, nil]
  optional :group_id, Integer

  # @!attribute loss_reason_id
  #
  #   @return [Integer, nil]
  optional :loss_reason_id, Integer

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

  # @!attribute pipeline_id
  #
  #   @return [Integer, nil]
  optional :pipeline_id, Integer

  # @!attribute price
  #
  #   @return [Integer, nil]
  optional :price, Integer

  # @!attribute request_id
  #   Client-side request id
  #
  #   @return [String, nil]
  optional :request_id, String

  # @!attribute responsible_user_id
  #
  #   @return [Integer, nil]
  optional :responsible_user_id, Integer

  # @!attribute status_id
  #
  #   @return [Integer, nil]
  optional :status_id, Integer

  # @!attribute tags_to_add
  #   Tags to attach
  #
  #   @return [Array<Amocrm::Models::LeadCreateParams::Body::TagsToAdd>, nil]
  optional :tags_to_add, -> { Amocrm::Internal::Type::ArrayOf[Amocrm::LeadCreateParams::Body::TagsToAdd] }

  # @!attribute updated_at
  #
  #   @return [Integer, nil]
  optional :updated_at, Integer

  # @!attribute updated_by
  #
  #   @return [Integer, nil]
  optional :updated_by, Integer

  # @!attribute visitor_uid
  #   Website visitor uid from tracking; links this lead to a site visit
  #
  #   @return [String, nil]
  optional :visitor_uid, String

  # @!method initialize(_embedded: nil, closed_at: nil, created_at: nil, created_by: nil, custom_fields_values: nil, group_id: nil, loss_reason_id: nil, name: nil, pipeline_id: nil, price: nil, request_id: nil, responsible_user_id: nil, status_id: nil, tags_to_add: nil, updated_at: nil, updated_by: nil, visitor_uid: nil)
  #   @param _embedded [Amocrm::Models::LeadCreateParams::Body::Embedded] Embedded entities (lead/contact/company/source)
  #
  #   @param closed_at [Integer]
  #
  #   @param created_at [Integer]
  #
  #   @param created_by [Integer]
  #
  #   @param custom_fields_values [Array<Amocrm::Models::LeadCreateParams::Body::CustomFieldsValue>] Custom fields payload
  #
  #   @param group_id [Integer]
  #
  #   @param loss_reason_id [Integer]
  #
  #   @param name [String]
  #
  #   @param pipeline_id [Integer]
  #
  #   @param price [Integer]
  #
  #   @param request_id [String] Client-side request id
  #
  #   @param responsible_user_id [Integer]
  #
  #   @param status_id [Integer]
  #
  #   @param tags_to_add [Array<Amocrm::Models::LeadCreateParams::Body::TagsToAdd>] Tags to attach
  #
  #   @param updated_at [Integer]
  #
  #   @param updated_by [Integer]
  #
  #   @param visitor_uid [String] Website visitor uid from tracking; links this lead to a site visit

  # @see Amocrm::Models::LeadCreateParams::Body#_embedded
  class Embedded < Amocrm::Internal::Type::BaseModel
    # @!attribute companies
    #
    #   @return [Array<Amocrm::Models::LeadCreateParams::Body::Embedded::Company>, nil]
    optional :companies,
             -> { Amocrm::Internal::Type::ArrayOf[Amocrm::LeadCreateParams::Body::Embedded::Company] }

    # @!attribute contacts
    #
    #   @return [Array<Amocrm::Models::LeadCreateParams::Body::Embedded::Contact>, nil]
    optional :contacts,
             -> { Amocrm::Internal::Type::ArrayOf[Amocrm::LeadCreateParams::Body::Embedded::Contact] }

    # @!attribute metadata
    #
    #   @return [Amocrm::Models::LeadCreateParams::Body::Embedded::Metadata, nil]
    optional :metadata, -> { Amocrm::LeadCreateParams::Body::Embedded::Metadata }

    # @!attribute source
    #
    #   @return [Amocrm::Models::LeadCreateParams::Body::Embedded::Source, nil]
    optional :source, -> { Amocrm::LeadCreateParams::Body::Embedded::Source }

    # @!attribute tags
    #
    #   @return [Array<Amocrm::Models::LeadCreateParams::Body::Embedded::Tag>, nil]
    optional :tags, -> { Amocrm::Internal::Type::ArrayOf[Amocrm::LeadCreateParams::Body::Embedded::Tag] }

    # @!method initialize(companies: nil, contacts: nil, metadata: nil, source: nil, tags: nil)
    #   Embedded entities (lead/contact/company/source)
    #
    #   @param companies [Array<Amocrm::Models::LeadCreateParams::Body::Embedded::Company>]
    #   @param contacts [Array<Amocrm::Models::LeadCreateParams::Body::Embedded::Contact>]
    #   @param metadata [Amocrm::Models::LeadCreateParams::Body::Embedded::Metadata]
    #   @param source [Amocrm::Models::LeadCreateParams::Body::Embedded::Source]
    #   @param tags [Array<Amocrm::Models::LeadCreateParams::Body::Embedded::Tag>]

    class Company < Amocrm::Internal::Type::BaseModel
      # @!attribute id
      #
      #   @return [Integer, nil]
      optional :id, Integer

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

      # @!method initialize(id: nil, name: nil)
      #   @param id [Integer]
      #   @param name [String]
    end

    class Contact < Amocrm::Internal::Type::BaseModel
      # @!attribute id
      #
      #   @return [Integer, nil]
      optional :id, Integer

      # @!attribute custom_fields_values
      #   Custom fields payload (same as contact create API)
      #
      #   @return [Array<Amocrm::Models::LeadCreateParams::Body::Embedded::Contact::CustomFieldsValue>, nil]
      optional :custom_fields_values,
               -> { Amocrm::Internal::Type::ArrayOf[Amocrm::LeadCreateParams::Body::Embedded::Contact::CustomFieldsValue] }

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

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

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

      # @!method initialize(id: nil, custom_fields_values: nil, first_name: nil, last_name: nil, name: nil)
      #   @param id [Integer]
      #
      #   @param custom_fields_values [Array<Amocrm::Models::LeadCreateParams::Body::Embedded::Contact::CustomFieldsValue>] Custom fields payload (same as contact create API)
      #
      #   @param first_name [String]
      #
      #   @param last_name [String]
      #
      #   @param name [String]

      class CustomFieldsValue < Amocrm::Internal::Type::BaseModel
        # @!attribute values
        #   Values for the field (multiple values allowed)
        #
        #   @return [Array<Amocrm::Models::LeadCreateParams::Body::Embedded::Contact::CustomFieldsValue::Value>]
        required :values,
                 -> { Amocrm::Internal::Type::ArrayOf[Amocrm::LeadCreateParams::Body::Embedded::Contact::CustomFieldsValue::Value] }

        # @!attribute field_code
        #   Field code (e.g. PHONE/EMAIL)
        #
        #   @return [String, nil]
        optional :field_code, String

        # @!attribute field_id
        #   Use either field_id or field_code (e.g. PHONE/EMAIL)
        #
        #   @return [Integer, nil]
        optional :field_id, Integer

        # @!method initialize(values:, field_code: nil, field_id: nil)
        #   @param values [Array<Amocrm::Models::LeadCreateParams::Body::Embedded::Contact::CustomFieldsValue::Value>] Values for the field (multiple values allowed)
        #
        #   @param field_code [String] Field code (e.g. PHONE/EMAIL)
        #
        #   @param field_id [Integer] Use either field_id or field_code (e.g. PHONE/EMAIL)

        class Value < Amocrm::Internal::Type::BaseModel
          # @!attribute value
          #
          #   @return [String, Integer, Boolean]
          required :value,
                   union: -> { Amocrm::LeadCreateParams::Body::Embedded::Contact::CustomFieldsValue::Value::Value }

          # @!attribute enum_code
          #   Option code for list/select custom fields (if you use code instead of id)
          #
          #   @return [String, nil]
          optional :enum_code, String

          # @!attribute enum_id
          #   Option id for list/select custom fields (one of predefined options)
          #
          #   @return [Integer, nil]
          optional :enum_id, Integer

          # @!method initialize(value:, enum_code: nil, enum_id: nil)
          #   @param value [String, Integer, Boolean]
          #
          #   @param enum_code [String] Option code for list/select custom fields (if you use code instead of id)
          #
          #   @param enum_id [Integer] Option id for list/select custom fields (one of predefined options)

          # @see Amocrm::Models::LeadCreateParams::Body::Embedded::Contact::CustomFieldsValue::Value#value
          module Value
            extend Amocrm::Internal::Type::Union

            variant String

            variant Integer

            variant Amocrm::Internal::Type::Boolean

            # @!method self.variants
            #   @return [Array(String, Integer, Boolean)]
          end
        end
      end
    end

    # @see Amocrm::Models::LeadCreateParams::Body::Embedded#metadata
    class Metadata < Amocrm::Internal::Type::BaseModel
      # @!attribute category
      #   Unsorted category
      #
      #   @return [Symbol, Amocrm::Models::LeadCreateParams::Body::Embedded::Metadata::Category, nil]
      optional :category, enum: -> { Amocrm::LeadCreateParams::Body::Embedded::Metadata::Category }

      # @!attribute form_id
      #   Form id in your system (string or numeric)
      #
      #   @return [String, Integer, nil]
      optional :form_id, union: -> { Amocrm::LeadCreateParams::Body::Embedded::Metadata::FormID }

      # @!attribute form_name
      #   Form name (shown in amoCRM)
      #
      #   @return [String, nil]
      optional :form_name, String

      # @!attribute form_page
      #   Page URL where form lives
      #
      #   @return [String, nil]
      optional :form_page, String

      # @!attribute form_sent_at
      #   Unix timestamp (seconds) when the form was submitted
      #
      #   @return [Integer, nil]
      optional :form_sent_at, Integer

      # @!attribute form_type
      #   Form type code from amoCRM, use only if you know it
      #
      #   @return [Integer, nil]
      optional :form_type, Integer

      # @!attribute ip
      #   IP address of the submitter
      #
      #   @return [String, nil]
      optional :ip, String

      # @!attribute referer
      #   Referrer URL
      #
      #   @return [String, nil]
      optional :referer, String

      # @!attribute visitor_uid
      #   Visitor uid from tracking, if you have it
      #
      #   @return [String, nil]
      optional :visitor_uid, String

      # @!method initialize(category: nil, form_id: nil, form_name: nil, form_page: nil, form_sent_at: nil, form_type: nil, ip: nil, referer: nil, visitor_uid: nil)
      #   @param category [Symbol, Amocrm::Models::LeadCreateParams::Body::Embedded::Metadata::Category] Unsorted category
      #
      #   @param form_id [String, Integer] Form id in your system (string or numeric)
      #
      #   @param form_name [String] Form name (shown in amoCRM)
      #
      #   @param form_page [String] Page URL where form lives
      #
      #   @param form_sent_at [Integer] Unix timestamp (seconds) when the form was submitted
      #
      #   @param form_type [Integer] Form type code from amoCRM, use only if you know it
      #
      #   @param ip [String] IP address of the submitter
      #
      #   @param referer [String] Referrer URL
      #
      #   @param visitor_uid [String] Visitor uid from tracking, if you have it

      # Unsorted category
      #
      # @see Amocrm::Models::LeadCreateParams::Body::Embedded::Metadata#category
      module Category
        extend Amocrm::Internal::Type::Enum

        SIP = :sip
        FORMS = :forms
        CHATS = :chats
        MAIL = :mail

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

      # Form id in your system (string or numeric)
      #
      # @see Amocrm::Models::LeadCreateParams::Body::Embedded::Metadata#form_id
      module FormID
        extend Amocrm::Internal::Type::Union

        variant String

        variant Integer

        # @!method self.variants
        #   @return [Array(String, Integer)]
      end
    end

    # @see Amocrm::Models::LeadCreateParams::Body::Embedded#source
    class Source < Amocrm::Internal::Type::BaseModel
      # @!attribute external_id
      #   External id in your system
      #
      #   @return [String, Integer, Boolean, nil]
      optional :external_id, union: -> { Amocrm::LeadCreateParams::Body::Embedded::Source::ExternalID }

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

      # @!method initialize(external_id: nil, type: nil)
      #   @param external_id [String, Integer, Boolean] External id in your system
      #
      #   @param type [String] Source type

      # External id in your system
      #
      # @see Amocrm::Models::LeadCreateParams::Body::Embedded::Source#external_id
      module ExternalID
        extend Amocrm::Internal::Type::Union

        variant String

        variant Integer

        variant Amocrm::Internal::Type::Boolean

        # @!method self.variants
        #   @return [Array(String, Integer, Boolean)]
      end
    end

    class Tag < Amocrm::Internal::Type::BaseModel
      # @!attribute id
      #
      #   @return [Integer, nil]
      optional :id, Integer

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

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

      # @!method initialize(id: nil, color: nil, name: nil)
      #   @param id [Integer]
      #   @param color [String]
      #   @param name [String]
    end
  end

  class CustomFieldsValue < Amocrm::Internal::Type::BaseModel
    # @!attribute values
    #   Values for the field (multiple values allowed)
    #
    #   @return [Array<Amocrm::Models::LeadCreateParams::Body::CustomFieldsValue::Value>]
    required :values,
             -> { Amocrm::Internal::Type::ArrayOf[Amocrm::LeadCreateParams::Body::CustomFieldsValue::Value] }

    # @!attribute field_code
    #   Field code (e.g. PHONE/EMAIL)
    #
    #   @return [String, nil]
    optional :field_code, String

    # @!attribute field_id
    #   Use either field_id or field_code (e.g. PHONE/EMAIL)
    #
    #   @return [Integer, nil]
    optional :field_id, Integer

    # @!method initialize(values:, field_code: nil, field_id: nil)
    #   @param values [Array<Amocrm::Models::LeadCreateParams::Body::CustomFieldsValue::Value>] Values for the field (multiple values allowed)
    #
    #   @param field_code [String] Field code (e.g. PHONE/EMAIL)
    #
    #   @param field_id [Integer] Use either field_id or field_code (e.g. PHONE/EMAIL)

    class Value < Amocrm::Internal::Type::BaseModel
      # @!attribute value
      #
      #   @return [String, Integer, Boolean]
      required :value, union: -> { Amocrm::LeadCreateParams::Body::CustomFieldsValue::Value::Value }

      # @!attribute enum_code
      #   Option code for list/select custom fields (if you use code instead of id)
      #
      #   @return [String, nil]
      optional :enum_code, String

      # @!attribute enum_id
      #   Option id for list/select custom fields (one of predefined options)
      #
      #   @return [Integer, nil]
      optional :enum_id, Integer

      # @!method initialize(value:, enum_code: nil, enum_id: nil)
      #   @param value [String, Integer, Boolean]
      #
      #   @param enum_code [String] Option code for list/select custom fields (if you use code instead of id)
      #
      #   @param enum_id [Integer] Option id for list/select custom fields (one of predefined options)

      # @see Amocrm::Models::LeadCreateParams::Body::CustomFieldsValue::Value#value
      module Value
        extend Amocrm::Internal::Type::Union

        variant String

        variant Integer

        variant Amocrm::Internal::Type::Boolean

        # @!method self.variants
        #   @return [Array(String, Integer, Boolean)]
      end
    end
  end

  class TagsToAdd < Amocrm::Internal::Type::BaseModel
    # @!attribute id
    #
    #   @return [Integer, nil]
    optional :id, Integer

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

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

    # @!method initialize(id: nil, color: nil, name: nil)
    #   @param id [Integer]
    #   @param color [String]
    #   @param name [String]
  end
end

Instance Attribute Details

#_embeddedAmocrm::Models::LeadCreateParams::Body::Embedded?

Embedded entities (lead/contact/company/source)



24
# File 'lib/amocrm/models/lead_create_params.rb', line 24

optional :_embedded, -> { Amocrm::LeadCreateParams::Body::Embedded }

#closed_atInteger?

Returns:

  • (Integer, nil)


29
# File 'lib/amocrm/models/lead_create_params.rb', line 29

optional :closed_at, Integer

#created_atInteger?

Returns:

  • (Integer, nil)


34
# File 'lib/amocrm/models/lead_create_params.rb', line 34

optional :created_at, Integer

#created_byInteger?

Returns:

  • (Integer, nil)


39
# File 'lib/amocrm/models/lead_create_params.rb', line 39

optional :created_by, Integer

#custom_fields_valuesArray<Amocrm::Models::LeadCreateParams::Body::CustomFieldsValue>?

Custom fields payload



45
46
# File 'lib/amocrm/models/lead_create_params.rb', line 45

optional :custom_fields_values,
-> { Amocrm::Internal::Type::ArrayOf[Amocrm::LeadCreateParams::Body::CustomFieldsValue] }

#group_idInteger?

Returns:

  • (Integer, nil)


51
# File 'lib/amocrm/models/lead_create_params.rb', line 51

optional :group_id, Integer

#loss_reason_idInteger?

Returns:

  • (Integer, nil)


56
# File 'lib/amocrm/models/lead_create_params.rb', line 56

optional :loss_reason_id, Integer

#nameString?

Returns:

  • (String, nil)


61
# File 'lib/amocrm/models/lead_create_params.rb', line 61

optional :name, String

#pipeline_idInteger?

Returns:

  • (Integer, nil)


66
# File 'lib/amocrm/models/lead_create_params.rb', line 66

optional :pipeline_id, Integer

#priceInteger?

Returns:

  • (Integer, nil)


71
# File 'lib/amocrm/models/lead_create_params.rb', line 71

optional :price, Integer

#request_idString?

Client-side request id

Returns:

  • (String, nil)


77
# File 'lib/amocrm/models/lead_create_params.rb', line 77

optional :request_id, String

#responsible_user_idInteger?

Returns:

  • (Integer, nil)


82
# File 'lib/amocrm/models/lead_create_params.rb', line 82

optional :responsible_user_id, Integer

#status_idInteger?

Returns:

  • (Integer, nil)


87
# File 'lib/amocrm/models/lead_create_params.rb', line 87

optional :status_id, Integer

#tags_to_addArray<Amocrm::Models::LeadCreateParams::Body::TagsToAdd>?

Tags to attach



93
# File 'lib/amocrm/models/lead_create_params.rb', line 93

optional :tags_to_add, -> { Amocrm::Internal::Type::ArrayOf[Amocrm::LeadCreateParams::Body::TagsToAdd] }

#updated_atInteger?

Returns:

  • (Integer, nil)


98
# File 'lib/amocrm/models/lead_create_params.rb', line 98

optional :updated_at, Integer

#updated_byInteger?

Returns:

  • (Integer, nil)


103
# File 'lib/amocrm/models/lead_create_params.rb', line 103

optional :updated_by, Integer

#visitor_uidString?

Website visitor uid from tracking; links this lead to a site visit

Returns:

  • (String, nil)


109
# File 'lib/amocrm/models/lead_create_params.rb', line 109

optional :visitor_uid, String

Class Method Details

.variantsArray(String, Integer, Boolean)

Returns:

  • (Array(String, Integer, Boolean))


# File 'lib/amocrm/models/lead_create_params.rb', line 535