Class: SurgeAPI::Models::AccountStatus::Capability

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/surge_api/models/account_status.rb

Defined Under Namespace

Modules: Status Classes: Error

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(field:, message:, type:) ⇒ Object

Some parameter documentations has been truncated, see Error for more details.

Parameters:

  • field (String)

    A dot-delimited string representing the field that has an error, as in ‘organiza

  • message (String)

    A human-readable string explaining the error.

  • type (String)

    A slug for the error type



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

class Capability < SurgeAPI::Internal::Type::BaseModel
  # @!attribute errors
  #   A list of errors that will need corrected before capability is available to
  #   account.
  #
  #   @return [Array<SurgeAPI::Models::AccountStatus::Capability::Error>]
  required :errors, -> { SurgeAPI::Internal::Type::ArrayOf[SurgeAPI::AccountStatus::Capability::Error] }

  # @!attribute fields_needed
  #   A list of missing fields that are required for the capability. Nested field
  #   names are dot-delimited, as in `organization.address.region`.
  #
  #   @return [Array<String>]
  required :fields_needed, SurgeAPI::Internal::Type::ArrayOf[String]

  # @!attribute status
  #   Whether the account is ready for the capability, has errors that need corrected,
  #   or is incomplete and requires missing data. If account has both missing and
  #   invalid fields, `error` will be preferred over `incomplete`.
  #
  #   @return [Symbol, SurgeAPI::Models::AccountStatus::Capability::Status]
  required :status, enum: -> { SurgeAPI::AccountStatus::Capability::Status }

  # @!method initialize(errors:, fields_needed:, status:)
  #   Some parameter documentations has been truncated, see
  #   {SurgeAPI::Models::AccountStatus::Capability} for more details.
  #
  #   @param errors [Array<SurgeAPI::Models::AccountStatus::Capability::Error>] A list of errors that will need corrected before capability is available to acco
  #
  #   @param fields_needed [Array<String>] A list of missing fields that are required for the capability. Nested field name
  #
  #   @param status [Symbol, SurgeAPI::Models::AccountStatus::Capability::Status] Whether the account is ready for the capability, has errors that need corrected,

  class Error < SurgeAPI::Internal::Type::BaseModel
    # @!attribute field
    #   A dot-delimited string representing the field that has an error, as in
    #   `organization.contact.phone_number`.
    #
    #   @return [String]
    required :field, String

    # @!attribute message
    #   A human-readable string explaining the error.
    #
    #   @return [String]
    required :message, String

    # @!attribute type
    #   A slug for the error type
    #
    #   @return [String]
    required :type, String

    # @!method initialize(field:, message:, type:)
    #   Some parameter documentations has been truncated, see
    #   {SurgeAPI::Models::AccountStatus::Capability::Error} for more details.
    #
    #   @param field [String] A dot-delimited string representing the field that has an error, as in `organiza
    #
    #   @param message [String] A human-readable string explaining the error.
    #
    #   @param type [String] A slug for the error type
  end

  # Whether the account is ready for the capability, has errors that need corrected,
  # or is incomplete and requires missing data. If account has both missing and
  # invalid fields, `error` will be preferred over `incomplete`.
  #
  # @see SurgeAPI::Models::AccountStatus::Capability#status
  module Status
    extend SurgeAPI::Internal::Type::Enum

    ERROR = :error
    INCOMPLETE = :incomplete
    READY = :ready

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

Instance Attribute Details

#errorsArray<SurgeAPI::Models::AccountStatus::Capability::Error>

A list of errors that will need corrected before capability is available to account.



28
# File 'lib/surge_api/models/account_status.rb', line 28

required :errors, -> { SurgeAPI::Internal::Type::ArrayOf[SurgeAPI::AccountStatus::Capability::Error] }

#fields_neededArray<String>

A list of missing fields that are required for the capability. Nested field names are dot-delimited, as in ‘organization.address.region`.

Returns:

  • (Array<String>)


35
# File 'lib/surge_api/models/account_status.rb', line 35

required :fields_needed, SurgeAPI::Internal::Type::ArrayOf[String]

#statusSymbol, SurgeAPI::Models::AccountStatus::Capability::Status

Whether the account is ready for the capability, has errors that need corrected, or is incomplete and requires missing data. If account has both missing and invalid fields, ‘error` will be preferred over `incomplete`.



43
# File 'lib/surge_api/models/account_status.rb', line 43

required :status, enum: -> { SurgeAPI::AccountStatus::Capability::Status }