Class: BancoBrasilPayments::InlineResponse200

Inherits:
Object
  • Object
show all
Defined in:
lib/bb_payments/models/inline_response_200.rb

Overview

Representação dos campos de resposta de uma solicitação de recuperação de transferência em lote.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ InlineResponse200

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
# File 'lib/bb_payments/models/inline_response_200.rb', line 72

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `BancoBrasilPayments::InlineResponse200` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `BancoBrasilPayments::InlineResponse200`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'next_index')
    self.next_index = attributes[:'next_index']
  end

  if attributes.key?(:'request_status')
    self.request_status = attributes[:'request_status']
  end

  if attributes.key?(:'payment_type')
    self.payment_type = attributes[:'payment_type']
  end

  if attributes.key?(:'request_date')
    self.request_date = attributes[:'request_date']
  end

  if attributes.key?(:'payments_total_quantity')
    self.payments_total_quantity = attributes[:'payments_total_quantity']
  end

  if attributes.key?(:'payments_total_value')
    self.payments_total_value = attributes[:'payments_total_value']
  end

  if attributes.key?(:'payments_list')
    if (value = attributes[:'payments_list']).is_a?(Array)
      self.payments_list = value
    end
  end
end

Instance Attribute Details

#next_indexObject

O valor desse campo é usado no parâmetro de consulta definido como "index" para recuperar a próxima ocorrência de pagamentos.



18
19
20
# File 'lib/bb_payments/models/inline_response_200.rb', line 18

def next_index
  @next_index
end

#payment_typeObject

Modalidade que representa o tipo de pagamento, sendo: 126 pagamento de fornecedores; 127 pagamento de salário e 128 pagamentos diversos



24
25
26
# File 'lib/bb_payments/models/inline_response_200.rb', line 24

def payment_type
  @payment_type
end

#payments_listObject

Lista de pagamentos submetidos para processamento em lote. Essa lista pode ser parcial ou total, a depender da seguinte regra: se o valor do campo "nextIndex" for menor que o valor do campo "paymentsTotalQuantity", então trata-se de lista parcial; caso contrário, trata-se de lista com todos os pagamentos.



36
37
38
# File 'lib/bb_payments/models/inline_response_200.rb', line 36

def payments_list
  @payments_list
end

#payments_total_quantityObject

Quantidade total de pagamentos a serem processados em lote. Essa informação não é a quantidade de registros retornados em "paymentsList".



30
31
32
# File 'lib/bb_payments/models/inline_response_200.rb', line 30

def payments_total_quantity
  @payments_total_quantity
end

#payments_total_valueObject

Valor montante total dos pagamentos a serem processados em lote. Esta informação não é uma soma de valores do campo "paymentValue" em "paymentsList" (formato 0.00)



33
34
35
# File 'lib/bb_payments/models/inline_response_200.rb', line 33

def payments_total_value
  @payments_total_value
end

#request_dateObject

Data da requisição (formato ddmmaaaa)



27
28
29
# File 'lib/bb_payments/models/inline_response_200.rb', line 27

def request_date
  @request_date
end

#request_statusObject

Código do estado da requisição a ser pesquisada: 1 - Requisição com todos os lançamentos com dados consistentes; 2 - Requisição com ao menos um dos lançamentos com dados inconsistentes; 3 - Requisição com todos os lançamentos com dados inconsistentes; 4 - Requisição pendente de ação pelo Conveniado - falta autorizar o pagamento; 5 - Requisição em processamento pelo Banco; 6 - Requisição Processada; 7 - Requisição Rejeitada, 8 - Preparando remessa não liberada, 9 - Requisição liberada via API, 10 - Preparando remessa liberada. As situações 1, 2 e 8 são transitórias e não requerem qualquer ação do Cliente Conveniado. situação 3 sempre será migrada para situação 7. A situação 4 Significa que, ao menos um lançamento, depende de ação do Cliente Conveniado, seja liberando ou cancelando os pagamentos. As situações 5, 6, 7, 9 e 10 não requerem qualquer ação do Cliente Conveniado. A situação 5 significa que, ao menos um lançamento, está agendado. As situações 6 e 7 são definitivas não havendo alteração posterior da situação da requisição.



21
22
23
# File 'lib/bb_payments/models/inline_response_200.rb', line 21

def request_status
  @request_status
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/bb_payments/models/inline_response_200.rb', line 39

def self.attribute_map
  {
    :'next_index' => :'nextIndex',
    :'request_status' => :'requestStatus',
    :'payment_type' => :'paymentType',
    :'request_date' => :'requestDate',
    :'payments_total_quantity' => :'paymentsTotalQuantity',
    :'payments_total_value' => :'paymentsTotalValue',
    :'payments_list' => :'paymentsList'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



158
159
160
# File 'lib/bb_payments/models/inline_response_200.rb', line 158

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



65
66
67
68
# File 'lib/bb_payments/models/inline_response_200.rb', line 65

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/bb_payments/models/inline_response_200.rb', line 52

def self.openapi_types
  {
    :'next_index' => :'Object',
    :'request_status' => :'Object',
    :'payment_type' => :'Object',
    :'request_date' => :'Object',
    :'payments_total_quantity' => :'Object',
    :'payments_total_value' => :'Object',
    :'payments_list' => :'Object'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



131
132
133
134
135
136
137
138
139
140
141
# File 'lib/bb_payments/models/inline_response_200.rb', line 131

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      next_index == o.next_index &&
      request_status == o.request_status &&
      payment_type == o.payment_type &&
      request_date == o.request_date &&
      payments_total_quantity == o.payments_total_quantity &&
      payments_total_value == o.payments_total_value &&
      payments_list == o.payments_list
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



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
# File 'lib/bb_payments/models/inline_response_200.rb', line 188

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    BancoBrasilPayments.const_get(type).build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/bb_payments/models/inline_response_200.rb', line 257

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/bb_payments/models/inline_response_200.rb', line 165

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


145
146
147
# File 'lib/bb_payments/models/inline_response_200.rb', line 145

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



151
152
153
# File 'lib/bb_payments/models/inline_response_200.rb', line 151

def hash
  [next_index, request_status, payment_type, request_date, payments_total_quantity, payments_total_value, payments_list].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



118
119
120
121
# File 'lib/bb_payments/models/inline_response_200.rb', line 118

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



233
234
235
# File 'lib/bb_payments/models/inline_response_200.rb', line 233

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/bb_payments/models/inline_response_200.rb', line 239

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



227
228
229
# File 'lib/bb_payments/models/inline_response_200.rb', line 227

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



125
126
127
# File 'lib/bb_payments/models/inline_response_200.rb', line 125

def valid?
  true
end