|
| 1 | +# frozen_string_literal: true |
| 2 | + |
| 3 | +module Orb |
| 4 | + module Models |
| 5 | + # @see Orb::Resources::CreditBlocks#list_invoices |
| 6 | + class CreditBlockListInvoicesResponse < Orb::Internal::Type::BaseModel |
| 7 | + # @!attribute block |
| 8 | + # The Credit Block resource models prepaid credits within Orb. |
| 9 | + # |
| 10 | + # @return [Orb::Models::CreditBlockListInvoicesResponse::Block] |
| 11 | + required :block, -> { Orb::Models::CreditBlockListInvoicesResponse::Block } |
| 12 | + |
| 13 | + # @!attribute invoices |
| 14 | + # |
| 15 | + # @return [Array<Orb::Models::CreditBlockListInvoicesResponse::Invoice>] |
| 16 | + required :invoices, |
| 17 | + -> { Orb::Internal::Type::ArrayOf[Orb::Models::CreditBlockListInvoicesResponse::Invoice] } |
| 18 | + |
| 19 | + # @!method initialize(block:, invoices:) |
| 20 | + # @param block [Orb::Models::CreditBlockListInvoicesResponse::Block] The Credit Block resource models prepaid credits within Orb. |
| 21 | + # |
| 22 | + # @param invoices [Array<Orb::Models::CreditBlockListInvoicesResponse::Invoice>] |
| 23 | + |
| 24 | + # @see Orb::Models::CreditBlockListInvoicesResponse#block |
| 25 | + class Block < Orb::Internal::Type::BaseModel |
| 26 | + # @!attribute id |
| 27 | + # |
| 28 | + # @return [String] |
| 29 | + required :id, String |
| 30 | + |
| 31 | + # @!attribute balance |
| 32 | + # |
| 33 | + # @return [Float] |
| 34 | + required :balance, Float |
| 35 | + |
| 36 | + # @!attribute effective_date |
| 37 | + # |
| 38 | + # @return [Time, nil] |
| 39 | + required :effective_date, Time, nil?: true |
| 40 | + |
| 41 | + # @!attribute expiry_date |
| 42 | + # |
| 43 | + # @return [Time, nil] |
| 44 | + required :expiry_date, Time, nil?: true |
| 45 | + |
| 46 | + # @!attribute filters |
| 47 | + # |
| 48 | + # @return [Array<Orb::Models::CreditBlockListInvoicesResponse::Block::Filter>] |
| 49 | + required :filters, |
| 50 | + -> { Orb::Internal::Type::ArrayOf[Orb::Models::CreditBlockListInvoicesResponse::Block::Filter] } |
| 51 | + |
| 52 | + # @!attribute maximum_initial_balance |
| 53 | + # |
| 54 | + # @return [Float, nil] |
| 55 | + required :maximum_initial_balance, Float, nil?: true |
| 56 | + |
| 57 | + # @!attribute metadata |
| 58 | + # User specified key-value pairs for the resource. If not present, this defaults |
| 59 | + # to an empty dictionary. Individual keys can be removed by setting the value to |
| 60 | + # `null`, and the entire metadata mapping can be cleared by setting `metadata` to |
| 61 | + # `null`. |
| 62 | + # |
| 63 | + # @return [Hash{Symbol=>String}] |
| 64 | + required :metadata, Orb::Internal::Type::HashOf[String] |
| 65 | + |
| 66 | + # @!attribute per_unit_cost_basis |
| 67 | + # |
| 68 | + # @return [String, nil] |
| 69 | + required :per_unit_cost_basis, String, nil?: true |
| 70 | + |
| 71 | + # @!attribute status |
| 72 | + # |
| 73 | + # @return [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::Status] |
| 74 | + required :status, enum: -> { Orb::Models::CreditBlockListInvoicesResponse::Block::Status } |
| 75 | + |
| 76 | + # @!method initialize(id:, balance:, effective_date:, expiry_date:, filters:, maximum_initial_balance:, metadata:, per_unit_cost_basis:, status:) |
| 77 | + # Some parameter documentations has been truncated, see |
| 78 | + # {Orb::Models::CreditBlockListInvoicesResponse::Block} for more details. |
| 79 | + # |
| 80 | + # The Credit Block resource models prepaid credits within Orb. |
| 81 | + # |
| 82 | + # @param id [String] |
| 83 | + # |
| 84 | + # @param balance [Float] |
| 85 | + # |
| 86 | + # @param effective_date [Time, nil] |
| 87 | + # |
| 88 | + # @param expiry_date [Time, nil] |
| 89 | + # |
| 90 | + # @param filters [Array<Orb::Models::CreditBlockListInvoicesResponse::Block::Filter>] |
| 91 | + # |
| 92 | + # @param maximum_initial_balance [Float, nil] |
| 93 | + # |
| 94 | + # @param metadata [Hash{Symbol=>String}] User specified key-value pairs for the resource. If not present, this defaults t |
| 95 | + # |
| 96 | + # @param per_unit_cost_basis [String, nil] |
| 97 | + # |
| 98 | + # @param status [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::Status] |
| 99 | + |
| 100 | + class Filter < Orb::Internal::Type::BaseModel |
| 101 | + # @!attribute field |
| 102 | + # The property of the price to filter on. |
| 103 | + # |
| 104 | + # @return [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::Filter::Field] |
| 105 | + required :field, enum: -> { Orb::Models::CreditBlockListInvoicesResponse::Block::Filter::Field } |
| 106 | + |
| 107 | + # @!attribute operator |
| 108 | + # Should prices that match the filter be included or excluded. |
| 109 | + # |
| 110 | + # @return [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::Filter::Operator] |
| 111 | + required :operator, enum: -> { Orb::Models::CreditBlockListInvoicesResponse::Block::Filter::Operator } |
| 112 | + |
| 113 | + # @!attribute values |
| 114 | + # The IDs or values that match this filter. |
| 115 | + # |
| 116 | + # @return [Array<String>] |
| 117 | + required :values, Orb::Internal::Type::ArrayOf[String] |
| 118 | + |
| 119 | + # @!method initialize(field:, operator:, values:) |
| 120 | + # @param field [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::Filter::Field] The property of the price to filter on. |
| 121 | + # |
| 122 | + # @param operator [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Block::Filter::Operator] Should prices that match the filter be included or excluded. |
| 123 | + # |
| 124 | + # @param values [Array<String>] The IDs or values that match this filter. |
| 125 | + |
| 126 | + # The property of the price to filter on. |
| 127 | + # |
| 128 | + # @see Orb::Models::CreditBlockListInvoicesResponse::Block::Filter#field |
| 129 | + module Field |
| 130 | + extend Orb::Internal::Type::Enum |
| 131 | + |
| 132 | + PRICE_ID = :price_id |
| 133 | + ITEM_ID = :item_id |
| 134 | + PRICE_TYPE = :price_type |
| 135 | + CURRENCY = :currency |
| 136 | + PRICING_UNIT_ID = :pricing_unit_id |
| 137 | + |
| 138 | + # @!method self.values |
| 139 | + # @return [Array<Symbol>] |
| 140 | + end |
| 141 | + |
| 142 | + # Should prices that match the filter be included or excluded. |
| 143 | + # |
| 144 | + # @see Orb::Models::CreditBlockListInvoicesResponse::Block::Filter#operator |
| 145 | + module Operator |
| 146 | + extend Orb::Internal::Type::Enum |
| 147 | + |
| 148 | + INCLUDES = :includes |
| 149 | + EXCLUDES = :excludes |
| 150 | + |
| 151 | + # @!method self.values |
| 152 | + # @return [Array<Symbol>] |
| 153 | + end |
| 154 | + end |
| 155 | + |
| 156 | + # @see Orb::Models::CreditBlockListInvoicesResponse::Block#status |
| 157 | + module Status |
| 158 | + extend Orb::Internal::Type::Enum |
| 159 | + |
| 160 | + ACTIVE = :active |
| 161 | + PENDING_PAYMENT = :pending_payment |
| 162 | + |
| 163 | + # @!method self.values |
| 164 | + # @return [Array<Symbol>] |
| 165 | + end |
| 166 | + end |
| 167 | + |
| 168 | + class Invoice < Orb::Internal::Type::BaseModel |
| 169 | + # @!attribute id |
| 170 | + # |
| 171 | + # @return [String] |
| 172 | + required :id, String |
| 173 | + |
| 174 | + # @!attribute customer |
| 175 | + # |
| 176 | + # @return [Orb::Models::CustomerMinified] |
| 177 | + required :customer, -> { Orb::CustomerMinified } |
| 178 | + |
| 179 | + # @!attribute invoice_number |
| 180 | + # |
| 181 | + # @return [String] |
| 182 | + required :invoice_number, String |
| 183 | + |
| 184 | + # @!attribute status |
| 185 | + # |
| 186 | + # @return [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Invoice::Status] |
| 187 | + required :status, enum: -> { Orb::Models::CreditBlockListInvoicesResponse::Invoice::Status } |
| 188 | + |
| 189 | + # @!attribute subscription |
| 190 | + # |
| 191 | + # @return [Orb::Models::SubscriptionMinified, nil] |
| 192 | + required :subscription, -> { Orb::SubscriptionMinified }, nil?: true |
| 193 | + |
| 194 | + # @!method initialize(id:, customer:, invoice_number:, status:, subscription:) |
| 195 | + # @param id [String] |
| 196 | + # @param customer [Orb::Models::CustomerMinified] |
| 197 | + # @param invoice_number [String] |
| 198 | + # @param status [Symbol, Orb::Models::CreditBlockListInvoicesResponse::Invoice::Status] |
| 199 | + # @param subscription [Orb::Models::SubscriptionMinified, nil] |
| 200 | + |
| 201 | + # @see Orb::Models::CreditBlockListInvoicesResponse::Invoice#status |
| 202 | + module Status |
| 203 | + extend Orb::Internal::Type::Enum |
| 204 | + |
| 205 | + ISSUED = :issued |
| 206 | + PAID = :paid |
| 207 | + SYNCED = :synced |
| 208 | + VOID = :void |
| 209 | + DRAFT = :draft |
| 210 | + |
| 211 | + # @!method self.values |
| 212 | + # @return [Array<Symbol>] |
| 213 | + end |
| 214 | + end |
| 215 | + end |
| 216 | + end |
| 217 | +end |
0 commit comments