starkinfra 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/lib/brcodepreview/brcodepreview.rb +12 -8
  3. data/lib/cardmethod/cardmethod.rb +1 -1
  4. data/lib/creditholmes/creditholmes.rb +160 -0
  5. data/lib/creditnote/creditnote.rb +19 -18
  6. data/lib/creditnote/invoice/discount.rb +1 -1
  7. data/lib/creditnote/invoice/invoice.rb +4 -3
  8. data/lib/creditnote/log.rb +16 -17
  9. data/lib/creditpreview/creditpreview.rb +2 -8
  10. data/lib/dynamicbrcode/dynamicbrcode.rb +3 -3
  11. data/lib/event/attempt.rb +1 -1
  12. data/lib/event/event.rb +1 -1
  13. data/lib/individualdocument/individualdocument.rb +165 -0
  14. data/lib/individualdocument/log.rb +125 -0
  15. data/lib/individualidentity/individualidentity.rb +193 -0
  16. data/lib/individualidentity/log.rb +124 -0
  17. data/lib/issuingcard/issuingcard.rb +11 -12
  18. data/lib/issuingcard/log.rb +19 -19
  19. data/lib/issuingdesign/issuingdesign.rb +138 -0
  20. data/lib/issuingembossingkit/issuingembossingkit.rb +121 -0
  21. data/lib/issuingembossingrequest/issuingembossingrequest.rb +210 -0
  22. data/lib/issuingembossingrequest/log.rb +128 -0
  23. data/lib/issuingholder/issuingholder.rb +8 -7
  24. data/lib/issuingholder/log.rb +17 -17
  25. data/lib/issuinginvoice/issuinginvoice.rb +6 -5
  26. data/lib/issuinginvoice/log.rb +16 -16
  27. data/lib/issuingproduct/issuingproduct.rb +2 -2
  28. data/lib/issuingpurchase/issuingpurchase.rb +15 -11
  29. data/lib/issuingpurchase/log.rb +15 -15
  30. data/lib/issuingrestock/issuingrestock.rb +162 -0
  31. data/lib/issuingrestock/log.rb +127 -0
  32. data/lib/issuingstock/issuingstock.rb +138 -0
  33. data/lib/issuingstock/log.rb +130 -0
  34. data/lib/issuingtransaction/issuingtransaction.rb +7 -6
  35. data/lib/issuingwithdrawal/issuingwithdrawal.rb +8 -11
  36. data/lib/pixchargeback/log.rb +12 -12
  37. data/lib/pixclaim/log.rb +13 -13
  38. data/lib/pixclaim/pixclaim.rb +4 -4
  39. data/lib/pixdomain/pixdomain.rb +1 -1
  40. data/lib/pixinfraction/log.rb +18 -18
  41. data/lib/pixinfraction/pixinfraction.rb +3 -3
  42. data/lib/pixkey/log.rb +18 -18
  43. data/lib/pixkey/pixkey.rb +4 -3
  44. data/lib/pixrequest/log.rb +22 -18
  45. data/lib/pixrequest/pixrequest.rb +3 -0
  46. data/lib/pixreversal/log.rb +1 -1
  47. data/lib/pixstatement/pixstatement.rb +1 -1
  48. data/lib/starkinfra.rb +13 -0
  49. data/lib/staticbrcode/staticbrcode.rb +8 -2
  50. data/lib/utils/bacenid.rb +1 -1
  51. data/lib/utils/request.rb +1 -1
  52. data/lib/webhook/webhook.rb +9 -9
  53. metadata +15 -2
@@ -13,7 +13,7 @@ module StarkInfra
13
13
  # is generated for the entity. This log is never generated by the
14
14
  # user.
15
15
  #
16
- # ## Attributes:
16
+ # ## Attributes (return-only):
17
17
  # - id [string]: unique id returned when the log is created. ex: '5656565656565656'
18
18
  # - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
19
19
  # - type [string]: type of the PixChargeback event which triggered the log creation. Options: 'created', 'failed', 'delivering', 'delivered', 'closed', 'canceled'
@@ -29,9 +29,9 @@ module StarkInfra
29
29
  @chargeback = chargeback
30
30
  end
31
31
 
32
- # # Retrieve a specific Log
32
+ # # Retrieve a specific PixChargeback::Log
33
33
  #
34
- # Receive a single Log object previously created by the Stark Infra API by passing its id
34
+ # Receive a single PixChargeback::Log object previously created by the Stark Infra API by passing its id
35
35
  #
36
36
  # ## Parameters (required):
37
37
  # - id [string]: object unique id. ex: '5656565656565656'
@@ -40,26 +40,26 @@ module StarkInfra
40
40
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
41
41
  #
42
42
  # ## Return:
43
- # - Log object with updated attributes
43
+ # - PixChargeback::Log object with updated attributes
44
44
  def self.get(id, user: nil)
45
45
  StarkInfra::Utils::Rest.get_id(id: id, user: user, **resource)
46
46
  end
47
47
 
48
- # # Retrieve Logs
48
+ # # Retrieve PixChargeback::Logs
49
49
  #
50
- # Receive a generator of Log objects previously created in the Stark Infra API
50
+ # Receive a generator of PixChargeback::Log objects previously created in the Stark Infra API
51
51
  #
52
52
  # ## Parameters (optional):
53
- # - ids [list of strings, default nil]: Log ids to filter PixChargeback Logs. ex: ['5656565656565656']
54
53
  # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
55
54
  # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
56
55
  # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
57
56
  # - types [list of strings, default nil]: filter retrieved objects by types. Options: 'created', 'failed', 'delivering', 'delivered', 'closed', 'canceled'
58
57
  # - chargeback_ids [list of strings, default nil]: list of PixChargeback ids to filter retrieved objects. ex: %w[5656565656565656 4545454545454545]
58
+ # - ids [list of strings, default nil]: Log ids to filter PixChargeback Logs. ex: ['5656565656565656']
59
59
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
60
60
  #
61
61
  # ## Return:
62
- # - generator of Log objects with updated attributes
62
+ # - generator of PixChargeback::Log objects with updated attributes
63
63
  def self.query(ids: nil, limit: nil, after: nil, before: nil, types: nil, chargeback_ids: nil, user: nil)
64
64
  after = StarkInfra::Utils::Checks.check_date(after)
65
65
  before = StarkInfra::Utils::Checks.check_date(before)
@@ -75,23 +75,23 @@ module StarkInfra
75
75
  )
76
76
  end
77
77
 
78
- # # Retrieve paged Logs
78
+ # # Retrieve paged PixChargeback::Logs
79
79
  #
80
- # Receive a list of up to 100 Log objects previously created in the Stark Infra API and the cursor to the next page.
80
+ # Receive a list of up to 100 PixChargeback::Log objects previously created in the Stark Infra API and the cursor to the next page.
81
81
  # Use this function instead of query if you want to manually page your chargebacks.
82
82
  #
83
83
  # ## Parameters (optional):
84
84
  # - cursor [string, default nil]: cursor returned on the previous page function call
85
- # - ids [list of strings, default nil]: Log ids to filter PixChargeback Logs. ex: ['5656565656565656']
86
85
  # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
87
86
  # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
88
87
  # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
89
88
  # - types [list of strings, default nil]: filter retrieved objects by types. Options: 'created', 'failed', 'delivering', 'delivered', 'closed', 'canceled'
90
89
  # - chargeback_ids [list of strings, default nil]: list of PixChargeback ids to filter retrieved objects. ex: %w[5656565656565656 4545454545454545]
90
+ # - ids [list of strings, default nil]: Log ids to filter PixChargeback Logs. ex: ['5656565656565656']
91
91
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
92
92
  #
93
93
  # ## Return:
94
- # - list of Log objects with updated attributes
94
+ # - list of PixChargeback::Log objects with updated attributes
95
95
  # - cursor to retrieve the next page of Log objects
96
96
  def self.page(cursor: nil, ids: nil, limit: nil, after: nil, before: nil, types: nil, chargeback_ids: nil, user: nil)
97
97
  after = StarkInfra::Utils::Checks.check_date(after)
data/lib/pixclaim/log.rb CHANGED
@@ -13,13 +13,13 @@ module StarkInfra
13
13
  # is generated for the entity. This log is never generated by the
14
14
  # user.
15
15
  #
16
- # ## Attributes:
16
+ # ## Attributes (return-only):
17
17
  # - id [string]: unique id returned when the log is created. ex: '5656565656565656'
18
- # - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
18
+ # - claim [PixClaim]: PixClaim entity to which the log refers to.
19
19
  # - type [string]: type of the PixClaim event which triggered the log creation. Options: 'created', 'failed', 'delivering', 'delivered', 'confirming', 'confirmed', 'success', 'canceling', 'canceled'.
20
20
  # - errors [list of strings]: list of errors linked to this PixClaim event.
21
21
  # - reason [string]: reason why the PixClaim was modified, resulting in the Log. Options: 'fraud', 'userRequested', 'accountClosure', 'defaultOperation', 'reconciliation'
22
- # - claim [PixClaim]: PixClaim entity to which the log refers to.
22
+ # - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
23
23
  class Log < StarkInfra::Utils::Resource
24
24
  attr_reader :id, :created, :type, :errors, :reason, :claim
25
25
  def initialize(id:, created:, type:, errors:, reason:, claim:)
@@ -31,9 +31,9 @@ module StarkInfra
31
31
  @claim = claim
32
32
  end
33
33
 
34
- # # Retrieve a specific Log
34
+ # # Retrieve a specific PixClaim::Log
35
35
  #
36
- # Receive a single Log object previously created by the Stark Infra API by passing its id
36
+ # Receive a single PixClaim::Log object previously created by the Stark Infra API by passing its id
37
37
  #
38
38
  # ## Parameters (required):
39
39
  # - id [string]: object unique id. ex: '5656565656565656'
@@ -42,26 +42,26 @@ module StarkInfra
42
42
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
43
43
  #
44
44
  # ## Return:
45
- # - Log object with updated attributes
45
+ # - PixClaim::Log object with updated attributes
46
46
  def self.get(id, user: nil)
47
47
  StarkInfra::Utils::Rest.get_id(id: id, user: user, **resource)
48
48
  end
49
49
 
50
- # # Retrieve Logs
50
+ # # Retrieve PixClaim::Logs
51
51
  #
52
- # Receive a generator of Log objects previously created in the Stark Infra API
52
+ # Receive a generator of PixClaim::Log objects previously created in the Stark Infra API
53
53
  #
54
54
  # ## Parameters (optional):
55
- # - ids [list of strings, default nil]: Log ids to filter PixClaim Logs. ex: ['5656565656565656']
56
55
  # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
57
56
  # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
58
57
  # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
59
58
  # - types [list of strings, default nil]: filter PixClaim Logs by their types. Options: 'created', 'failed', 'delivering', 'delivered', 'confirming', 'confirmed', 'success', 'canceling', 'canceled'.
60
59
  # - claim_ids [list of strings, default nil]: list of PixClaim ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
60
+ # - ids [list of strings, default nil]: Log ids to filter PixClaim Logs. ex: ['5656565656565656']
61
61
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
62
62
  #
63
63
  # ## Return:
64
- # - generator of Log objects with updated attributes
64
+ # - generator of PixClaim::Log objects with updated attributes
65
65
  def self.query(ids: nil, limit: nil, after: nil, before: nil, types: nil, claim_ids: nil, user: nil)
66
66
  after = StarkInfra::Utils::Checks.check_date(after)
67
67
  before = StarkInfra::Utils::Checks.check_date(before)
@@ -77,19 +77,19 @@ module StarkInfra
77
77
  )
78
78
  end
79
79
 
80
- # # Retrieve paged Logs
80
+ # # Retrieve paged PixClaim::Logs
81
81
  #
82
- # Receive a list of up to 100 Log objects previously created in the Stark Infra API and the cursor to the next page.
82
+ # Receive a list of up to 100 PixClaim::Log objects previously created in the Stark Infra API and the cursor to the next page.
83
83
  # Use this function instead of query if you want to manually page your claims.
84
84
  #
85
85
  # ## Parameters (optional):
86
- # - ids [list of strings, default nil]: Log ids to filter PixClaim Logs. ex: ['5656565656565656']
87
86
  # - cursor [string, default nil]: cursor returned on the previous page function call
88
87
  # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
89
88
  # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
90
89
  # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
91
90
  # - types [list of strings, default nil]: filter PixClaim Logs by their types. Options: 'created', 'failed', 'delivering', 'delivered', 'confirming', 'confirmed', 'success', 'canceling', 'canceled'.
92
91
  # - claim_ids [list of strings, default nil]: list of PixClaim ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
92
+ # - ids [list of strings, default nil]: Log ids to filter PixClaim Logs. ex: ['5656565656565656']
93
93
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
94
94
  #
95
95
  # ## Return:
@@ -65,8 +65,8 @@ module StarkInfra
65
65
 
66
66
  # # Create a PixClaim object
67
67
  #
68
- # Create a PixClaim to request the transfer of a Pix Key from an account
69
- # hosted at another Pix participants to an account under you bank code.
68
+ # Create a PixClaim to request the transfer of a PixKey to an account
69
+ # hosted at other Pix participants in the Stark Infra API.
70
70
  #
71
71
  # ## Parameters (required):
72
72
  # - claim [PixClaim object]: PixClaim object to be created in the API.
@@ -184,7 +184,7 @@ module StarkInfra
184
184
 
185
185
  # # Update a PixClaim entity
186
186
  #
187
- # Respond to a received PixClaim.
187
+ # Update a PixClaim parameters by passing id.
188
188
  #
189
189
  # ## Parameters (required):
190
190
  # - id [string]: PixClaim unique id. ex: '5656565656565656'
@@ -195,7 +195,7 @@ module StarkInfra
195
195
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
196
196
  #
197
197
  # ## Return:
198
- # - updated PixClaim object
198
+ # - updated PixClaim object with updated attributes
199
199
  def self.update(id, status:, reason: nil, user: nil)
200
200
  StarkInfra::Utils::Rest.patch_id(
201
201
  id: id,
@@ -23,7 +23,7 @@ module StarkInfra
23
23
 
24
24
  # # Retrieve PixDomains
25
25
  #
26
- # Receive a generator of PixDomain objects registered at the Central Bank.
26
+ # Receive a generator of PixDomain objects.
27
27
  #
28
28
  # ## Parameters (optional):
29
29
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
@@ -13,25 +13,25 @@ module StarkInfra
13
13
  # is generated for the entity. This log is never generated by the
14
14
  # user.
15
15
  #
16
- # ## Attributes:
16
+ # ## Attributes (return-only):
17
17
  # - id [string]: unique id returned when the log is created. ex: '5656565656565656'
18
- # - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
18
+ # - infraction [PixInfraction]: PixInfraction entity to which the log refers to.
19
19
  # - type [string]: type of the PixInfraction event which triggered the log creation. Options: 'created', 'failed', 'delivering', 'delivered', 'closed', 'canceled'
20
20
  # - errors [list of strings]: list of errors linked to this PixInfraction event.
21
- # - infraction [PixInfraction]: PixInfraction entity to which the log refers to.
21
+ # - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
22
22
  class Log < StarkInfra::Utils::Resource
23
23
  attr_reader :id, :created, :type, :errors, :infraction
24
24
  def initialize(id:, created:, type:, errors:, infraction:)
25
25
  super(id)
26
- @created = StarkInfra::Utils::Checks.check_datetime(created)
26
+ @infraction = infraction
27
27
  @type = type
28
28
  @errors = errors
29
- @infraction = infraction
29
+ @created = StarkInfra::Utils::Checks.check_datetime(created)
30
30
  end
31
31
 
32
- # # Retrieve a specific Log
32
+ # # Retrieve a specific PixInfraction::Log
33
33
  #
34
- # Receive a single Log object previously created by the Stark Infra API by passing its id
34
+ # Receive a single PixInfraction::Log object previously created by the Stark Infra API by passing its id
35
35
  #
36
36
  # ## Parameters (required):
37
37
  # - id [string]: object unique id. ex: '5656565656565656'
@@ -40,26 +40,26 @@ module StarkInfra
40
40
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
41
41
  #
42
42
  # ## Return:
43
- # - Log object with updated attributes
43
+ # - PixInfraction::Log object with updated attributes
44
44
  def self.get(id, user: nil)
45
45
  StarkInfra::Utils::Rest.get_id(id: id, user: user, **resource)
46
46
  end
47
47
 
48
- # # Retrieve Logs
48
+ # # Retrieve PixInfraction::Logs
49
49
  #
50
- # Receive a generator of Log objects previously created in the Stark Infra API
50
+ # Receive a generator of PixInfraction::Log objects previously created in the Stark Infra API
51
51
  #
52
52
  # ## Parameters (optional):
53
- # - ids [list of strings, default nil]: Log ids to filter PixInfraction Logs. ex: ['5656565656565656']
54
53
  # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
55
54
  # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
56
55
  # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
57
56
  # - types [list of strings, default nil]: filter retrieved objects by their types. Options: 'created', 'failed', 'delivering', 'delivered', 'closed', 'canceled'
58
57
  # - infraction_ids [list of strings, default nil]: list of PixInfraction ids to filter retrieved objects. ex: %w[5656565656565656 4545454545454545]
58
+ # - ids [list of strings, default nil]: Log ids to filter PixInfraction Logs. ex: ['5656565656565656']
59
59
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
60
60
  #
61
61
  # ## Return:
62
- # - list of Log objects with updated attributes
62
+ # - list of PixInfraction::Log objects with updated attributes
63
63
  def self.query(ids: nil, limit: nil, after: nil, before: nil, types: nil, infraction_ids: nil, user: nil)
64
64
  after = StarkInfra::Utils::Checks.check_date(after)
65
65
  before = StarkInfra::Utils::Checks.check_date(before)
@@ -75,23 +75,23 @@ module StarkInfra
75
75
  )
76
76
  end
77
77
 
78
- # # Retrieve paged Logs
78
+ # # Retrieve paged PixInfraction::Logs
79
79
  #
80
- # Receive a list of up to 100 Log objects previously created in the Stark Infra API and the cursor to the next page.
80
+ # Receive a list of up to 100 PixInfraction::Log objects previously created in the Stark Infra API and the cursor to the next page.
81
81
  # Use this function instead of query if you want to manually page your infractions.
82
82
  #
83
83
  # ## Parameters (optional):
84
84
  # - cursor [string, default nil]: cursor returned on the previous page function call
85
- # - ids [list of strings, default nil]: Log ids to filter PixInfraction Logs. ex: ['5656565656565656']
86
85
  # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
87
86
  # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
88
87
  # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
89
88
  # - types [list of strings, default nil]: filter retrieved objects by their types. Options: 'created', 'failed', 'delivering', 'delivered', 'closed', 'canceled'
90
89
  # - infraction_ids [list of strings, default nil]: list of PixInfraction ids to filter retrieved objects. ex: %w[5656565656565656 4545454545454545]
90
+ # - ids [list of strings, default nil]: Log ids to filter PixInfraction Logs. ex: ['5656565656565656']
91
91
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
92
92
  #
93
93
  # ## Return:
94
- # - list of Log objects with updated attributes
94
+ # - list of PixInfraction::Log objects with updated attributes
95
95
  # - Cursor to retrieve the next page of Log objects
96
96
  def self.page(cursor: nil, ids: nil, limit: nil, after: nil, before: nil, types: nil, infraction_ids: nil, user: nil)
97
97
  after = StarkInfra::Utils::Checks.check_date(after)
@@ -116,10 +116,10 @@ module StarkInfra
116
116
  resource_maker: proc { |json|
117
117
  Log.new(
118
118
  id: json['id'],
119
- created: json['created'],
119
+ infraction: StarkInfra::Utils::API.from_api_json(infraction_maker, json['infraction']),
120
120
  type: json['type'],
121
121
  errors: json['errors'],
122
- infraction: StarkInfra::Utils::API.from_api_json(infraction_maker, json['infraction'])
122
+ created: json['created'],
123
123
  )
124
124
  }
125
125
  }
@@ -19,7 +19,7 @@ module StarkInfra
19
19
  #
20
20
  # ## Parameters (optional):
21
21
  # - description [string, default nil]: description for any details that can help with the infraction investigation.
22
- # - tags [list of strings, default nil]: list of strings for tagging. ex: ['travel', 'food']
22
+ # - tags [list of strings, default nil]: list of strings for tagging. ex: ['travel', 'food']
23
23
  #
24
24
  # ## Attributes (return-only):
25
25
  # - id [string]: unique id returned when the PixInfraction is created. ex: '5656565656565656'
@@ -45,9 +45,9 @@ module StarkInfra
45
45
  @description = description
46
46
  @tags = tags
47
47
  @credited_bank_code = credited_bank_code
48
+ @debited_bank_code = debited_bank_code
48
49
  @flow = flow
49
50
  @analysis = analysis
50
- @debited_bank_code = debited_bank_code
51
51
  @reported_by = reported_by
52
52
  @result = result
53
53
  @status = status
@@ -172,7 +172,7 @@ module StarkInfra
172
172
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
173
173
  #
174
174
  # ## Return:
175
- # - updated PixInfraction object
175
+ # - PixInfraction object with updated attributes
176
176
  def self.update(id, result:, analysis: nil, user: nil)
177
177
  StarkInfra::Utils::Rest.patch_id(id: id, result: result, analysis: analysis, user: user, **resource)
178
178
  end
data/lib/pixkey/log.rb CHANGED
@@ -12,25 +12,25 @@ module StarkInfra
12
12
  # Every time a PixKey entity is modified, a corresponding PixKey::Log is generated for the entity.
13
13
  # This log is never generated by the user.
14
14
  #
15
- # ## Attributes:
15
+ # ## Attributes (return-only):
16
16
  # - id [string]: unique id returned when the log is created. ex: '5656565656565656'
17
- # - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
17
+ # - key [PixKey]: PixKey entity to which the log refers to.
18
18
  # - type [string]: type of the PixKey event which triggered the log creation. Options: 'created', 'registered', 'updated', 'failed', 'canceling', 'canceled'.
19
19
  # - errors [list of strings]: list of errors linked to this PixKey event.
20
- # - key [PixKey]: PixKey entity to which the log refers to.
20
+ # - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
21
21
  class Log < StarkInfra::Utils::Resource
22
22
  attr_reader :id, :created, :type, :errors, :key
23
23
  def initialize(id:, created:, type:, errors:, key:)
24
24
  super(id)
25
- @created = StarkInfra::Utils::Checks.check_datetime(created)
25
+ @key = key
26
26
  @type = type
27
27
  @errors = errors
28
- @key = key
28
+ @created = StarkInfra::Utils::Checks.check_datetime(created)
29
29
  end
30
30
 
31
- # # Retrieve a specific Log
31
+ # # Retrieve a specific PixKey::Log
32
32
  #
33
- # Receive a single Log object previously created by the Stark Infra API by passing its id
33
+ # Receive a single PixKey::Log object previously created by the Stark Infra API by passing its id
34
34
  #
35
35
  # ## Parameters (required):
36
36
  # - id [string]: object unique id. ex: '5656565656565656'
@@ -39,26 +39,26 @@ module StarkInfra
39
39
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
40
40
  #
41
41
  # ## Return:
42
- # - Log object with updated attributes
42
+ # - PixKey::Log object with updated attributes
43
43
  def self.get(id, user: nil)
44
44
  StarkInfra::Utils::Rest.get_id(id: id, user: user, **resource)
45
45
  end
46
46
 
47
- # # Retrieve Logs
47
+ # # Retrieve PixKey::Logs
48
48
  #
49
- # Receive a generator of Log objects previously created in the Stark Infra API
49
+ # Receive a generator of PixKey::Log objects previously created in the Stark Infra API
50
50
  #
51
51
  # ## Parameters (optional):
52
- # - ids [list of strings, default nil]: Log ids to filter PixKey Logs. ex: ['5656565656565656']
53
52
  # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
54
53
  # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
55
54
  # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
56
55
  # - types [list of strings, default nil]: filter PixKey Logs by their types. Options: 'created', 'registered', 'updated', 'failed', 'canceling', 'canceled'.
57
56
  # - key_ids [list of strings, default nil]: list of PixKey ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
57
+ # - ids [list of strings, default nil]: Log ids to filter PixKey Logs. ex: ['5656565656565656']
58
58
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
59
59
  #
60
60
  # ## Return:
61
- # - generator of Log objects with updated attributes
61
+ # - generator of PixKey::Log objects with updated attributes
62
62
  def self.query(ids: nil, limit: nil, after: nil, before: nil, types: nil, key_ids: nil, user: nil)
63
63
  after = StarkInfra::Utils::Checks.check_date(after)
64
64
  before = StarkInfra::Utils::Checks.check_date(before)
@@ -74,23 +74,23 @@ module StarkInfra
74
74
  )
75
75
  end
76
76
 
77
- # # Retrieve paged Logs
77
+ # # Retrieve paged PixKey::Logs
78
78
  #
79
- # Receive a list of up to 100 Log objects previously created in the Stark Infra API and the cursor to the next page.
79
+ # Receive a list of up to 100 PixKey::Log objects previously created in the Stark Infra API and the cursor to the next page.
80
80
  # Use this function instead of query if you want to manually page your keys.
81
81
  #
82
82
  # ## Parameters (optional):
83
- # - ids [list of strings, default nil]: Log ids to filter PixKey Logs. ex: ['5656565656565656']
84
83
  # - cursor [string, default nil]: cursor returned on the previous page function call
85
84
  # - limit [integer, default 100]: maximum number of objects to be retrieved. Max = 100. ex: 35
86
85
  # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
87
86
  # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
88
87
  # - types [list of strings, default nil]: filter PixKey Logs by their types. Options: 'created', 'registered', 'updated', 'failed', 'canceling', 'canceled'.
89
88
  # - key_ids [list of strings, default nil]: list of PixKey ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
89
+ # - ids [list of strings, default nil]: Log ids to filter PixKey Logs. ex: ['5656565656565656']
90
90
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
91
91
  #
92
92
  # ## Return:
93
- # - list of Log objects with updated attributes
93
+ # - list of PixKey::Log objects with updated attributes
94
94
  # - cursor to retrieve the next page of Log objects
95
95
  def self.page(cursor: nil, ids: nil, limit: nil, after: nil, before: nil, types: nil, key_ids: nil, user: nil)
96
96
  after = StarkInfra::Utils::Checks.check_date(after)
@@ -115,10 +115,10 @@ module StarkInfra
115
115
  resource_maker: proc { |json|
116
116
  Log.new(
117
117
  id: json['id'],
118
- created: json['created'],
118
+ key: StarkInfra::Utils::API.from_api_json(key_maker, json['key']),
119
119
  type: json['type'],
120
120
  errors: json['errors'],
121
- key: StarkInfra::Utils::API.from_api_json(key_maker, json['key'])
121
+ created: json['created']
122
122
  )
123
123
  }
124
124
  }
data/lib/pixkey/pixkey.rb CHANGED
@@ -6,6 +6,7 @@ require_relative('../utils/resource')
6
6
 
7
7
  module StarkInfra
8
8
  # # PixKey object
9
+ #
9
10
  # PixKeys link bank account information to key ids.
10
11
  # Key ids are a convenient way to search and pass bank account information.
11
12
  #
@@ -59,7 +60,7 @@ module StarkInfra
59
60
 
60
61
  # # Create a PixKey
61
62
  #
62
- # Send a PixKey objects for creation in the Stark Infra API
63
+ # Create a PixKey linked to a specific account in the Stark Infra API
63
64
  #
64
65
  # ## Parameters (required):
65
66
  # - key [PixKey object]: PixKey object to be created in the API
@@ -167,7 +168,7 @@ module StarkInfra
167
168
 
168
169
  # # Update a PixKey entity
169
170
  #
170
- # Respond to a received PixKey.
171
+ # Update a PixKey parameters by passing id.
171
172
  #
172
173
  # ## Parameters (required):
173
174
  # - id [string]: PixKey unique id. ex: '+5511989898989'
@@ -182,7 +183,7 @@ module StarkInfra
182
183
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
183
184
  #
184
185
  # ## Return:
185
- # - updated PixKey object
186
+ # - PixKey object with updated attributes
186
187
  def self.update(id, reason:, account_created: nil, account_number: nil, account_type: nil, branch_code: nil, name: nil, user: nil)
187
188
  StarkInfra::Utils::Rest.patch_id(
188
189
  id: id,
@@ -12,12 +12,12 @@ module StarkInfra
12
12
  # Every time a PixRequest entity is modified, a corresponding PixRequest::Log is generated for the entity.
13
13
  # This log is never generated by the user.
14
14
  #
15
- # ## Attributes:
15
+ # ## Attributes (return-only):
16
16
  # - id [string]: unique id returned when the log is created. ex: '5656565656565656'
17
- # - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
18
- # - type [string]: type of the PixRequest event which triggered the log creation. ex: 'processing' or 'success'
19
- # - errors [list of strings]: list of errors linked to this PixRequest event.
20
17
  # - request [PixRequest object]: PixRequest entity to which the log refers to.
18
+ # - type [string]: type of the PixRequest event which triggered the log creation. ex: "sent", "denied", "failed", "created", "success", "approved", "credited", "refunded", "processing"
19
+ # - errors [list of strings]: list of errors linked to this PixRequest event.
20
+ # - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
21
21
  class Log < StarkInfra::Utils::Resource
22
22
  attr_reader :id, :created, :type, :errors, :request
23
23
  def initialize(id:, created:, type:, errors:, request:)
@@ -28,9 +28,9 @@ module StarkInfra
28
28
  @request = request
29
29
  end
30
30
 
31
- # # Retrieve a specific Log
31
+ # # Retrieve a specific PixRequest::Log
32
32
  #
33
- # Receive a single Log object previously created by the Stark Infra API by passing its id
33
+ # Receive a single PixRequest::Log object previously created by the Stark Infra API by passing its id
34
34
  #
35
35
  # ## Parameters (required):
36
36
  # - id [string]: object unique id. ex: '5656565656565656'
@@ -39,27 +39,28 @@ module StarkInfra
39
39
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
40
40
  #
41
41
  # ## Return:
42
- # - Log object with updated attributes
42
+ # - PixRequest::Log object with updated attributes
43
43
  def self.get(id, user: nil)
44
44
  StarkInfra::Utils::Rest.get_id(id: id, user: user, **resource)
45
45
  end
46
46
 
47
- # # Retrieve Logs
47
+ # # Retrieve PixRequest::Logs
48
48
  #
49
- # Receive a generator of Log objects previously created in the Stark Infra API
49
+ # Receive a generator of PixRequest::Log objects previously created in the Stark Infra API
50
50
  #
51
51
  # ## Parameters (optional):
52
- # - ids [list of strings, default nil]: Log ids to filter PixKey Logs. ex: ['5656565656565656']
53
52
  # - limit [integer, default nil]: maximum number of objects to be retrieved. Unlimited if nil. ex: 35
54
53
  # - after [Date or string, default nil]: date filter for objects created only after specified date. ex: Date.new(2020, 3, 10)
55
54
  # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
56
55
  # - types [list of strings, default nil]: filter retrieved objects by types. ex: 'success' or 'failed'
57
56
  # - request_ids [list of strings, default nil]: list of PixRequest ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
57
+ # - reconciliation_id [string, default nil]: PixRequest reconciliation id to filter retrieved objects. ex: "b77f5236-7ab9-4487-9f95-66ee6eaf1781"
58
+ # - ids [list of strings, default nil]: Log ids to filter PixKey Logs. ex: ['5656565656565656']
58
59
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
59
60
  #
60
61
  # ## Return:
61
- # - generator of Log objects with updated attributes
62
- def self.query(limit: nil, after: nil, before: nil, types: nil, request_ids: nil, user: nil)
62
+ # - generator of PixRequest::Log objects with updated attributes
63
+ def self.query(limit: nil, after: nil, before: nil, types: nil, request_ids: nil, reconciliation_id: nil, user: nil)
63
64
  after = StarkInfra::Utils::Checks.check_date(after)
64
65
  before = StarkInfra::Utils::Checks.check_date(before)
65
66
  StarkInfra::Utils::Rest.get_stream(
@@ -68,14 +69,15 @@ module StarkInfra
68
69
  before: before,
69
70
  types: types,
70
71
  request_ids: request_ids,
72
+ reconciliation_id: reconciliation_id,
71
73
  user: user,
72
74
  **resource
73
75
  )
74
76
  end
75
77
 
76
- # # Retrieve paged Logs
78
+ # # Retrieve paged PixRequest::Logs
77
79
  #
78
- # Receive a list of up to 100 Log objects previously created in the Stark Infra API and the cursor to the next page.
80
+ # Receive a list of up to 100 PixRequest::Log objects previously created in the Stark Infra API and the cursor to the next page.
79
81
  # Use this function instead of query if you want to manually page your logs.
80
82
  #
81
83
  # ## Parameters (optional):
@@ -85,12 +87,13 @@ module StarkInfra
85
87
  # - before [Date or string, default nil]: date filter for objects created only before specified date. ex: Date.new(2020, 3, 10)
86
88
  # - types [list of strings, default nil]: filter retrieved objects by types. ex: 'success' or 'failed'
87
89
  # - request_ids [list of strings, default nil]: list of PixRequest ids to filter retrieved objects. ex: ['5656565656565656', '4545454545454545']
90
+ # - reconciliation_id [string]: PixRequest reconciliation id to filter retrieved objects. ex: "b77f5236-7ab9-4487-9f95-66ee6eaf1781"
88
91
  # - user [Organization/Project object, default nil]: Organization or Project object. Not necessary if StarkInfra.user was set before function call
89
92
  #
90
93
  # ## Return:
91
- # - list of Log objects with updated attributes
94
+ # - list of PixRequest::Log objects with updated attributes
92
95
  # - cursor to retrieve the next page of Log objects
93
- def self.page(cursor: nil, limit: nil, after: nil, before: nil, types: nil, request_ids: nil, user: nil)
96
+ def self.page(cursor: nil, limit: nil, after: nil, before: nil, types: nil, request_ids: nil, reconciliation_id: nil, user: nil)
94
97
  after = StarkInfra::Utils::Checks.check_date(after)
95
98
  before = StarkInfra::Utils::Checks.check_date(before)
96
99
  StarkInfra::Utils::Rest.get_page(
@@ -100,6 +103,7 @@ module StarkInfra
100
103
  before: before,
101
104
  types: types,
102
105
  request_ids: request_ids,
106
+ reconciliation_id: reconciliation_id,
103
107
  user: user,
104
108
  **resource
105
109
  )
@@ -112,10 +116,10 @@ module StarkInfra
112
116
  resource_maker: proc { |json|
113
117
  Log.new(
114
118
  id: json['id'],
115
- created: json['created'],
119
+ request: StarkInfra::Utils::API.from_api_json(request_maker, json['request']),
116
120
  type: json['type'],
117
121
  errors: json['errors'],
118
- request: StarkInfra::Utils::API.from_api_json(request_maker, json['request'])
122
+ created: json['created']
119
123
  )
120
124
  }
121
125
  }
@@ -8,6 +8,9 @@ require_relative('../utils/resource')
8
8
  module StarkInfra
9
9
  # # PixRequest object
10
10
  #
11
+ # PixRequests are used to receive or send instant payments to accounts
12
+ # hosted in any Pix participant.
13
+ #
11
14
  # When you initialize a PixRequest, the entity will not be automatically
12
15
  # created in the Stark Infra API. The 'create' function sends the objects
13
16
  # to the Stark Infra API and returns the list of created objects.
@@ -13,7 +13,7 @@ module StarkInfra
13
13
  # is generated for the entity. This log is never generated by the
14
14
  # user.
15
15
  #
16
- # ## Attributes:
16
+ # ## Attributes (return-only):
17
17
  # - id [string]: unique id returned when the log is created. ex: '5656565656565656'
18
18
  # - created [DateTime]: creation datetime for the log. ex: DateTime.new(2020, 3, 10, 10, 30, 0, 0)
19
19
  # - type [string]: type of the PixReversal event which triggered the log creation. ex: 'processing' or 'success'
@@ -43,7 +43,7 @@ module StarkInfra
43
43
  # # Create a PixStatement object
44
44
  #
45
45
  # Create a PixStatements linked to your workspace in the Stark Infra API
46
- #
46
+ #
47
47
  # ## Parameters (required):
48
48
  # - statement [PixStatement object]: PixStatement object to be created in the API.
49
49
  #