gocardless_pro 2.56.0 → 2.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ff9a9f0905147eeb174b5e7d4ce029edc6f3b623525b8a23c18bed65964f95a
4
- data.tar.gz: 9a8252e55308ecf44bd9b4c20dde80b34020dc1593ff56beb2301c0c34ac253f
3
+ metadata.gz: a0a146b35e39aaaec207ce920824529baf883e1a47f145ca7925de250438aab9
4
+ data.tar.gz: 688023c522f8547e097e53ec3ef20fc11bf06d1d12a2149c97383d7bf6b3ead0
5
5
  SHA512:
6
- metadata.gz: b66fc420814c249b1f18280d9700c2dbd4f3953e2860f6a046c308e2ce11657ba9bcffed50d2925845a0f51996aa49d026b9d1ec1d51a6bcf8033b49bc187478
7
- data.tar.gz: 7c4d56b3e7230598cfb3b2668c99e157fd168dbbcc60722dcbbaa87b2a807e54a791dbcaeb0d73a2cf9996ae3b64074cd27feaf438a990c8d83ba484c5378250
6
+ metadata.gz: b1fc013bde352a7494de64b4625e588825bd7a2411ad4cbed44f6b79d42751ef7add42013e6e4ef18e37c4d439fc3a16acdb749cb2286a90b486c5c3e41eee75
7
+ data.tar.gz: d97c7be78b0af2dd1d1d3f31265db04761055d2fd4cb16de12945cd28ba4c8ba66ed6471d7a014b5e8723e6ba7d4a3d5f23ab770c2a4fde8f823c4fbd00c8219
@@ -68,6 +68,11 @@ module GoCardlessPro
68
68
  @events ||= Services::EventsService.new(@api_service)
69
69
  end
70
70
 
71
+ # Access to the service for export to make API calls
72
+ def exports
73
+ @exports ||= Services::ExportsService.new(@api_service)
74
+ end
75
+
71
76
  # Access to the service for instalment_schedule to make API calls
72
77
  def instalment_schedules
73
78
  @instalment_schedules ||= Services::InstalmentSchedulesService.new(@api_service)
@@ -228,7 +233,7 @@ module GoCardlessPro
228
233
  'User-Agent' => "#{user_agent}",
229
234
  'Content-Type' => 'application/json',
230
235
  'GoCardless-Client-Library' => 'gocardless-pro-ruby',
231
- 'GoCardless-Client-Version' => '2.56.0',
236
+ 'GoCardless-Client-Version' => '2.57.0',
232
237
  },
233
238
  }
234
239
  end
@@ -0,0 +1,44 @@
1
+ #
2
+ # This client is automatically generated from a template and JSON schema definition.
3
+ # See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
4
+ #
5
+
6
+ require 'uri'
7
+
8
+ module GoCardlessPro
9
+ # A module containing classes for each of the resources in the GC Api
10
+ module Resources
11
+ # Represents an instance of a export resource returned from the API
12
+
13
+ # File-based exports of data
14
+ class Export
15
+ attr_reader :created_at
16
+ attr_reader :currency
17
+ attr_reader :download_url
18
+ attr_reader :export_type
19
+ attr_reader :id
20
+
21
+ # Initialize a export resource instance
22
+ # @param object [Hash] an object returned from the API
23
+ def initialize(object, response = nil)
24
+ @object = object
25
+
26
+ @created_at = object['created_at']
27
+ @currency = object['currency']
28
+ @download_url = object['download_url']
29
+ @export_type = object['export_type']
30
+ @id = object['id']
31
+ @response = response
32
+ end
33
+
34
+ def api_response
35
+ ApiResponse.new(@response)
36
+ end
37
+
38
+ # Provides the export resource as a hash of all its readable attributes
39
+ def to_h
40
+ @object
41
+ end
42
+ end
43
+ end
44
+ end
@@ -82,6 +82,7 @@ module GoCardlessPro
82
82
  attr_reader :metadata
83
83
  attr_reader :month
84
84
  attr_reader :name
85
+ attr_reader :parent_plan_paused
85
86
  attr_reader :payment_reference
86
87
  attr_reader :retry_if_possible
87
88
  attr_reader :start_date
@@ -108,6 +109,7 @@ module GoCardlessPro
108
109
  @metadata = object['metadata']
109
110
  @month = object['month']
110
111
  @name = object['name']
112
+ @parent_plan_paused = object['parent_plan_paused']
111
113
  @payment_reference = object['payment_reference']
112
114
  @retry_if_possible = object['retry_if_possible']
113
115
  @start_date = object['start_date']
@@ -0,0 +1,75 @@
1
+ require_relative './base_service'
2
+
3
+ # encoding: utf-8
4
+ #
5
+ # This client is automatically generated from a template and JSON schema definition.
6
+ # See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
7
+ #
8
+
9
+ module GoCardlessPro
10
+ module Services
11
+ # Service for making requests to the Export endpoints
12
+ class ExportsService < BaseService
13
+ # Returns a single export.
14
+ # Example URL: /exports/:identity
15
+ #
16
+ # @param identity # Unique identifier, beginning with "EX".
17
+ # @param options [Hash] parameters as a hash, under a params key.
18
+ def get(identity, options = {})
19
+ path = sub_url('/exports/:identity', {
20
+ 'identity' => identity,
21
+ })
22
+
23
+ options[:retry_failures] = true
24
+
25
+ response = make_request(:get, path, options)
26
+
27
+ return if response.body.nil?
28
+
29
+ Resources::Export.new(unenvelope_body(response.body), response)
30
+ end
31
+
32
+ # Returns a list of exports which are available for download.
33
+ # Example URL: /exports
34
+ # @param options [Hash] parameters as a hash, under a params key.
35
+ def list(options = {})
36
+ path = '/exports'
37
+
38
+ options[:retry_failures] = true
39
+
40
+ response = make_request(:get, path, options)
41
+
42
+ ListResponse.new(
43
+ response: response,
44
+ unenveloped_body: unenvelope_body(response.body),
45
+ resource_class: Resources::Export
46
+ )
47
+ end
48
+
49
+ # Get a lazily enumerated list of all the items returned. This is similar to the `list` method but will paginate for you automatically.
50
+ #
51
+ # @param options [Hash] parameters as a hash. If the request is a GET, these will be converted to query parameters.
52
+ # Otherwise they will be the body of the request.
53
+ def all(options = {})
54
+ Paginator.new(
55
+ service: self,
56
+ options: options
57
+ ).enumerator
58
+ end
59
+
60
+ private
61
+
62
+ # Unenvelope the response of the body using the service's `envelope_key`
63
+ #
64
+ # @param body [Hash]
65
+ def unenvelope_body(body)
66
+ body[envelope_key] || body['data']
67
+ end
68
+
69
+ # return the key which API responses will envelope data under
70
+ def envelope_key
71
+ 'exports'
72
+ end
73
+ end
74
+ end
75
+ end
@@ -12,6 +12,11 @@ module GoCardlessPro
12
12
  class LogosService < BaseService
13
13
  # Creates a new logo associated with a creditor. If a creditor already has a
14
14
  # logo, this will update the existing logo linked to the creditor.
15
+ #
16
+ # We support JPG and PNG formats. Your logo will be scaled to a maximum of 300px
17
+ # by 40px. For more guidance on how to upload logos that will look
18
+ # great across your customer payment page and notification emails see
19
+ # [here](https://developer.gocardless.com/gc-embed/setting-up-branding#tips_for_uploading_your_logo).
15
20
  # Example URL: /branding/logos
16
21
  # @param options [Hash] parameters as a hash, under a params key.
17
22
  def create_for_creditor(options = {})
@@ -3,5 +3,5 @@ end
3
3
 
4
4
  module GoCardlessPro
5
5
  # Current version of the GC gem
6
- VERSION = '2.56.0'
6
+ VERSION = '2.57.0'
7
7
  end
@@ -78,6 +78,9 @@ require_relative 'gocardless_pro/services/customer_notifications_service'
78
78
  require_relative 'gocardless_pro/resources/event'
79
79
  require_relative 'gocardless_pro/services/events_service'
80
80
 
81
+ require_relative 'gocardless_pro/resources/export'
82
+ require_relative 'gocardless_pro/services/exports_service'
83
+
81
84
  require_relative 'gocardless_pro/resources/instalment_schedule'
82
85
  require_relative 'gocardless_pro/services/instalment_schedules_service'
83
86
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gocardless_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.56.0
4
+ version: 2.57.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-28 00:00:00.000000000 Z
11
+ date: 2024-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -125,6 +125,7 @@ files:
125
125
  - lib/gocardless_pro/resources/customer_bank_account.rb
126
126
  - lib/gocardless_pro/resources/customer_notification.rb
127
127
  - lib/gocardless_pro/resources/event.rb
128
+ - lib/gocardless_pro/resources/export.rb
128
129
  - lib/gocardless_pro/resources/instalment_schedule.rb
129
130
  - lib/gocardless_pro/resources/institution.rb
130
131
  - lib/gocardless_pro/resources/logo.rb
@@ -162,6 +163,7 @@ files:
162
163
  - lib/gocardless_pro/services/customer_notifications_service.rb
163
164
  - lib/gocardless_pro/services/customers_service.rb
164
165
  - lib/gocardless_pro/services/events_service.rb
166
+ - lib/gocardless_pro/services/exports_service.rb
165
167
  - lib/gocardless_pro/services/instalment_schedules_service.rb
166
168
  - lib/gocardless_pro/services/institutions_service.rb
167
169
  - lib/gocardless_pro/services/logos_service.rb