Class: Unit::Transaction::PatchTagsRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/transaction/patch_tags_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_id, transaction_id, tags = nil) ⇒ PatchTagsRequest

Returns a new instance of PatchTagsRequest.

Parameters:

  • (defaults to: nil)
    • optional



13
14
15
16
17
# File 'lib/unit/models/transaction/patch_tags_request.rb', line 13

def initialize(, transaction_id, tags = nil)
  @account_id = 
  @transaction_id = transaction_id
  @tags = tags
end

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



8
9
10
# File 'lib/unit/models/transaction/patch_tags_request.rb', line 8

def 
  @account_id
end

#tagsObject

Returns the value of attribute tags.



8
9
10
# File 'lib/unit/models/transaction/patch_tags_request.rb', line 8

def tags
  @tags
end

#transaction_idObject

Returns the value of attribute transaction_id.



8
9
10
# File 'lib/unit/models/transaction/patch_tags_request.rb', line 8

def transaction_id
  @transaction_id
end

Instance Method Details

#to_json_apiObject



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/unit/models/transaction/patch_tags_request.rb', line 19

def to_json_api
  payload = {
    "data": {
      "type": "transaction",
      "attributes": {
        "tags": tags
      }
    }
  }
  payload[:data][:attributes].compact!
  payload.to_json
end