companies-house-rest 1.0.1 → 1.2.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: cf1a0feb6d7ff9ce88c33f12790aad9962fac29c006a6efd22385c27915aa49d
4
- data.tar.gz: b8f7cc72bc777a892c2761eb233eb24b4afd87fee535f50ebc15fcda7f5b42f6
3
+ metadata.gz: 0c519f46e0ee9de3687b83ef95b31323737c3de14ac741e1139006de81d7f3cf
4
+ data.tar.gz: 695dcbe9e2dcb2851fa8867233e3d775931c58096cc6d89e12522a03f2eb3cbd
5
5
  SHA512:
6
- metadata.gz: c30364d84656df588cbe11bff470d92a3a546f652a5f1d6ba099ac18c05e108a7bb65ab6beb0649b4c10595b4926cd93d056c62752819d15d2c068a599e9c155
7
- data.tar.gz: 1cd1cdafe83bc9ba5711bc3d6eef029a3673902209383988fbe1c4f8eed05c5e80e3ebfa77b0f6d37e2f772d6daa9e84e72418a64811375c98db7ef45c98a672
6
+ metadata.gz: e3243b83878ad086bae547477f867a226400a1cd83dc6d86816267d261a2c819938e6f9113dbe396285284d80aef1dd0b01e96e6cbd0d1a1072b6087512aa3f6
7
+ data.tar.gz: d135ebad3158e1b5fc87c18e67f8e32ab47e03ff6511aa3c6815e2621aac4b911b632e6a5d16b24748fd4efdba1015007e71f641934d2f083fed09c6aa40c943
data/README.md CHANGED
@@ -4,9 +4,8 @@
4
4
 
5
5
  This Gem implements an API client for the Companies House REST API. It can be
6
6
  used to look up information about companies registered in the United Kingdom.
7
- As of July 2016, this API is described by Companies House as a "beta service."
8
7
  More information about this free API can be found
9
- [on the Companies House API website](https://developer.companieshouse.gov.uk/api/docs/index.html).
8
+ [on the Companies House API website](https://developer.company-information.service.gov.uk/).
10
9
 
11
10
  To interact the older [CompaniesHouse XML-based API](http://xmlgw.companieshouse.gov.uk/),
12
11
  see the gem [companies-house-gateway](https://github.com/gocardless/companies-house-gateway-ruby).
@@ -14,19 +13,19 @@ see the gem [companies-house-gateway](https://github.com/gocardless/companies-ho
14
13
 
15
14
  Quick start:
16
15
 
17
- * Register an account via the `Sign In / Register` link
18
- [on the CompaniesHouse Developers website](https://developer.companieshouse.gov.uk/api/docs/)
19
- * Register an API key at [Your Applications](https://developer.companieshouse.gov.uk/developer/applications)
20
- * Put your API key in an environment variable (not in your code):
16
+ - Register an account via the `Sign In / Register` link
17
+ [on the CompaniesHouse Developers website](https://developer.company-information.service.gov.uk/)
18
+ - Register an API key at [Your Applications](https://developer.company-information.service.gov.uk/manage-applications)
19
+ - Put your API key in an environment variable (not in your code):
21
20
 
22
- ``` shell
21
+ ```shell
23
22
  export COMPANIES_HOUSE_API_KEY=YOUR_API_KEY_HERE
24
23
  ```
25
24
 
26
- * Install `companies-house-rest` through [RubyGems](https://rubygems.org/gems/companies-house-rest)
27
- * Create and use a client:
25
+ - Install `companies-house-rest` through [RubyGems](https://rubygems.org/gems/companies-house-rest)
26
+ - Create and use a client:
28
27
 
29
- ``` ruby
28
+ ```ruby
30
29
  require 'companies_house/client'
31
30
  client = CompaniesHouse::Client.new(api_key: ENV['COMPANIES_HOUSE_API_KEY'])
32
31
  profile = client.company('07495895')
@@ -45,18 +44,18 @@ alphabetic characters such as `NI` or `SC`.
45
44
  ## Authentication
46
45
 
47
46
  Using the Companies House REST API requires you to register an account
48
- [on the CompaniesHouse Developers website](https://developer.companieshouse.gov.uk/api/docs/)
49
- and [configure an API key](https://developer.companieshouse.gov.uk/developer/applications).
47
+ [on the CompaniesHouse Developers website](https://developer.company-information.service.gov.uk/)
48
+ and [configure an API key](https://developer.company-information.service.gov.uk/manage-applications).
50
49
  Developers should read
51
- [the Companies House developer guidelines](https://developer.companieshouse.gov.uk/api/docs/index/gettingStarted/developerGuidelines.html)
50
+ [the Companies House developer guidelines](https://developer.company-information.service.gov.uk/developer-guidelines)
52
51
  before using this API, and will note that these guidelines contain several
53
52
  instructions regarding API keys:
54
53
 
55
- * Do not embed API keys in your code
56
- * Do not store API keys in your source tree
57
- * Restrict API key use by IP address and domain
58
- * **Regenerate your API keys regularly**
59
- * Delete API keys when no longer required
54
+ - Do not embed API keys in your code
55
+ - Do not store API keys in your source tree
56
+ - Restrict API key use by IP address and domain
57
+ - **Regenerate your API keys regularly**
58
+ - Delete API keys when no longer required
60
59
 
61
60
  ## Client Initialization
62
61
 
@@ -70,11 +69,11 @@ client = CompaniesHouse::Client.new(config)
70
69
  The client is configured by passing a hash to the constructor. The supported keys for this
71
70
  hash are:
72
71
 
73
- | Key | Description |
74
- | ------------------ | ----------- |
75
- | `:api_key` | Required. The API key received after registration. |
72
+ | Key | Description |
73
+ | ------------------ | ---------------------------------------------------------------------------------- |
74
+ | `:api_key` | Required. The API key received after registration. |
76
75
  | `:endpoint` | Optional. Specifies the base URI for the API (e.g. if using a self-hosted version) |
77
- | `:instrumentation` | Optional. Instruments the request/response (see Instrumentation for details) |
76
+ | `:instrumentation` | Optional. Instruments the request/response (see Instrumentation for details) |
78
77
 
79
78
  ## Instrumentation
80
79
 
@@ -85,49 +84,117 @@ If you are using Rails or the `ActiveSupport` gem, instrumentation will happen a
85
84
 
86
85
  Once a client has been initialised, requests can be made to the API.
87
86
  Details of the available fields in the response are in the Companies House
88
- [documentation](https://developer.companieshouse.gov.uk/api/docs/index.html).
87
+ [documentation](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference).
89
88
  The endpoints currently implemented by the gem are:
90
89
 
91
- | Client Method | Endpoint | Description |
92
- | --------------------------------------------------------------- | --------------------------------------- | ----------- |
93
- | `.company(company_number)` | `GET /company/:company_number` | Retrieves a company profile. |
94
- | `.officers(company_number)` | `GET /company/:company_number/officers` | Retrieves a list of company officers. |
95
- | `.company_search(query, items_per_page: nil, start_index: nil)` | `GET /search/companies` | Retrieves a list of companies that match the given query. |
90
+ | Client Method | Endpoint | Description |
91
+ | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
92
+ | `.company(company_number)` | `GET /company/:company_number` | Retrieves a company profile. |
93
+ | `.officers(company_number)` | `GET /company/:company_number/officers` | Retrieves a list of company officers. |
94
+ | `.company_search(query, items_per_page: nil, start_index: nil, restrictions: nil)` | `GET /search/companies` | Retrieves a list of companies that match the given query. |
95
+ | `.persons_with_significant_control(company_number, register_view: false)` | `GET /company/:company_number/persons-with-significant-control` | Retrieves a list of persons with significant control. |
96
+ | `.persons_with_significant_control_corporate_entity_beneficial_owner(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/corporate-entity-beneficial-owner/:psc_id` | Retrieves a corporate entity beneficial owner. |
97
+ | `.persons_with_significant_control_corporate_entity(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/corporate-entity/:psc_id` | Retrieves a corporate entity. |
98
+ | `.persons_with_significant_control_individual_beneficial_owner(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/individual-beneficial-owner/:psc_id` | Retrieves an individual beneficial owner. |
99
+ | `.persons_with_significant_control_individual(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/individual/:psc_id` | Retrieves an individual. |
100
+ | `.persons_with_significant_control_individual_with_verification_state(company_number, psc_id)`. | `GET /company/:company_number/persons-with-significant-control/individual/:psc_id/verification-state` | Retrieves an individual with verification state. |
101
+ | `.persons_with_significant_control_individual_full_record(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/individual/:psc_id/full_record` | Retrieves the full record of an individual. |
102
+ | `.persons_with_significant_control_legal_person_beneficial_owner(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/legal-person-beneficial-owner/:psc_id` | Retrieves a legal person beneficial owner. |
103
+ | `.persons_with_significant_control_legal_person(company_number, psc_id)` | `GET /company/:company_number/persons-with-significant-control/legal-person/:psc_id` | Retrieves a legal person. |
104
+ | `.persons_with_significant_control_super_secure_beneficial_owner(company_number, super_secure_id)` | `GET /company/:company_number/persons-with-significant-control/super-secure-beneficial-owner/:super_secure_id` | Retrieves a super secure beneficial owner. |
105
+ | `.persons_with_significant_control_super_secure_person(company_number, super_secure_id)` | `GET /company/:company_number/persons-with-significant-control/super-secure/:super_secure_id` | Retrieves a super secure person. |
106
+ | `.persons_with_significant_control_statements(company_number, register_view: false)` | `GET /company/:company_number/persons-with-significant-control-statements` | Retrieves a list of persons with significant control statements. |
107
+ | `.persons_with_significant_control_statement(company_number, statement_id)` | `GET /company/:company_number/persons-with-significant-control-statements/:statement_id` | Retrieves a persons with significant control statement. |
108
+ | `.filing_history_list(company_number)` | `GET /company/:company_number/filing-history` | Retrieves a list of filing history items. |
109
+ | `.filing_history_item(company_number, transaction_id)` | `GET /company/:company_number/filing-history/:transaction_id` | Retrieves a specific filing history item. |
96
110
 
97
111
  ### .company
98
112
 
99
- This method implements the [readCompanyProfile](https://developer.companieshouse.gov.uk/api/docs/company/company_number/readCompanyProfile.html)
100
- API and returns the full [companyProfile](https://developer.companieshouse.gov.uk/api/docs/company/company_number/companyProfile-resource.html)
113
+ This method implements the [readCompanyProfile](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/company-profile/company-profile)
114
+ API and returns the full [companyProfile](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/companyprofile)
101
115
  resource.
102
116
 
103
117
  ### .officers
104
118
 
105
- This method implements the [officersList](https://developer.companieshouse.gov.uk/api/docs/company/company_number/officers/officerList.html)
119
+ This method implements the [officersList](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/officers/list)
106
120
  API. It will make one or more requests against this API, as necessary, to obtain
107
121
  the full list of company officers. It returns only the values under the `items`
108
122
  key from the
109
- [officerList](https://developer.companieshouse.gov.uk/api/docs/company/company_number/officers/officerList-resource.html)
123
+ [officerList](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/officerlist)
110
124
  resource(s) which it reads.
111
125
 
112
126
  ### .company_search
113
127
 
114
- This method implements the [searchCompanies](https://developer.companieshouse.gov.uk/api/docs/search/companies/companysearch.html)
115
- API and returns the list of [companySearch](https://developer.companieshouse.gov.uk/api/docs/search-overview/CompanySearch-resource.html)
116
- resources that match the given query. The `items_per_page` and `start_index` parameters are optional.
128
+ This method implements the [searchCompanies](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/search/search-companies)
129
+ API and returns the list of [companySearch](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/companysearch)
130
+ resources that match the given query. The `items_per_page`, `start_index` and `restrictions` parameters are optional.
131
+
132
+ ### .persons_with_significant_control
133
+
134
+ This method implements the [listPersonsWithSignificantControl](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/list) API and returns the list of [personsWithSignificantControl](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/list) resources.
135
+
136
+ ### .persons_with_significant_control_corporate_entity_beneficial_owner
137
+
138
+ This method implements the [getCorporateEntityBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-corporate-entity-beneficial-owner) API and returns the [corporateEntityBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/corporateentitybeneficialowner) resource.
139
+
140
+ ### .persons_with_significant_control_corporate_entity
141
+
142
+ This method implements the [getCorporateEntities](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-corporate-entities) API and returns the [corporateEntity](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/corporateentity) resource.
143
+
144
+ ### .persons_with_significant_control_individual_beneficial_owner
145
+
146
+ This method implements the [getIndividualBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-individual-beneficial-owner) API and returns the [individualBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/individualbeneficialowner) resource.
147
+
148
+ ### .persons_with_significant_control_individual
149
+
150
+ This method implements the [getIndividual](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-individual) API and returns the [individual](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/individual) resource.
151
+
152
+ ### .persons_with_significant_control_individual_with_verification_state
153
+
154
+ This method implements the [getIndividualWithVerificationState](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-individual-with-verification-state) API and returns the [individual](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/individual) resource.
155
+
156
+ ### .persons_with_significant_control_individual_full_record
157
+
158
+ This method implements the [getIndividualFullRecord](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-individual-full-record) API and returns the [individual](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/individual) resource.
159
+
160
+ ### .persons_with_significant_control_legal_person_beneficial_owner
161
+
162
+ This method implements the [getLegalPersonBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-legal-person-beneficial-owner) API and returns the [legalPersonBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/legalpersonbeneficialowner) resource.
163
+
164
+ ### .persons_with_significant_control_legal_person
165
+
166
+ This method implements the [getLegalPersons](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-legal-persons) API and returns the [legalPerson](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/legalperson) resource.
167
+
168
+ ### .persons_with_significant_control_super_secure_beneficial_owner
169
+
170
+ This method implements the [getSuperSecureBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-super-secure-beneficial-owner) API and returns the [superSecureBeneficialOwner](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/supersecurebeneficialowner) resource.
171
+
172
+ ### .persons_with_significant_control_super_secure_person
173
+
174
+ This method implements the [getSuperSecurePerson](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-super-secure-person) API and returns the [superSecure](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/supersecure) resource.
175
+
176
+ ### .persons_with_significant_control_statements
177
+
178
+ This method implements the [listPersonsWithSignificantControlStatements](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/list-statements) API and returns the list of [statementList](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/statementlist) resources.
179
+
180
+ ### .persons_with_significant_control_statement
181
+
182
+ This method implements the [getStatement](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/persons-with-significant-control/get-statement) API and returns the [statement](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/statement) resource.
117
183
 
118
184
  ### .filing_history_list
119
185
 
120
- This method implements the [filingHistoryList](https://developer.companieshouse.gov.uk/api/docs/company/company_number/filing-history/getFilingHistoryList.html) API and returns the full [filingHistoryList](https://developer.companieshouse.gov.uk/api/docs/company/company_number/filing-history/filingHistoryList-resource.html) resource.
186
+ This method implements the [filingHistoryList](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/filing-history/list) API and returns the full
187
+ [filingHistoryList](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/filinghistorylist) resource.
121
188
 
122
189
  ### .filing_history_item
123
190
 
124
- This method implements the [filingHistoryItem](https://developer.companieshouse.gov.uk/api/docs/company/company_number/filing-history/transaction_id/getFilingHistoryItem.html) API and returns the full
125
- [filingHistoryItem](https://developer.companieshouse.gov.uk/api/docs/company/company_number/filing-history/filingHistoryItem-resource.html) resource.
191
+ This method implements the [filingHistoryItem](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference/filing-history/filinghistoryitem-resource) API and returns the full
192
+ [filingHistoryItem](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/resources/filinghistoryitem) resource.
126
193
 
127
194
  ### Other API Methods
128
195
 
129
196
  While there are other resources exposed by the
130
- [Companies House API](https://developer.companieshouse.gov.uk/api/docs/index.html),
197
+ [Companies House API](https://developer-specs.company-information.service.gov.uk/companies-house-public-data-api/reference),
131
198
  this gem does not implement access to these resources at this time.
132
199
 
133
200
  ## Error Handling
@@ -136,22 +203,22 @@ If a request to the Companies House API encounters an HTTP status other than
136
203
  `200 OK`, it will raise an instance of `CompaniesHouse::APIError` instead of
137
204
  returning response data. The error will have the following fields:
138
205
 
139
- | Field | Description |
140
- | ---------- | ----------- |
206
+ | Field | Description |
207
+ | ---------- | ------------------------------------------------------- |
141
208
  | `response` | The Net::HTTP response object from the failed API call. |
142
- | `status` | A string containing the response status code. |
209
+ | `status` | A string containing the response status code. |
143
210
 
144
211
  Certain API responses will raise an instance of a more specific subclass of
145
212
  `CompaniesHouse::APIError`:
146
213
 
147
- | Status | Error | Description |
148
- | ------ | ------------------------------------- | ----------- |
149
- | 401 | `CompaniesHouse::AuthenticationError` | Authentication error (invalid API key) |
150
- | 404 | `CompaniesHouse::NotFoundError` | Not Found. (No record of the company is available.) |
151
- | 429 | `CompaniesHouse::RateLimitError` | Application is being [rate limited](https://developer.companieshouse.gov.uk/api/docs/index/gettingStarted/rateLimiting.html) |
214
+ | Status | Error | Description |
215
+ | ------ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
216
+ | 401 | `CompaniesHouse::AuthenticationError` | Authentication error (invalid API key) |
217
+ | 404 | `CompaniesHouse::NotFoundError` | Not Found. (No record of the company is available.) |
218
+ | 429 | `CompaniesHouse::RateLimitError` | Application is being [rate limited](https://developer-specs.company-information.service.gov.uk/guides/rateLimiting) |
152
219
 
153
220
  The client will not catch any other errors which may occur, such as
154
- errors involving network connections (e.g. `Errno::ECONNRESET`).
221
+ errors involving network connections (e.g. `Errno::ECONNRESET`).
155
222
 
156
223
  ## Development
157
224
 
@@ -162,7 +229,7 @@ Bug reports and pull requests are welcome on this project's
162
229
 
163
230
  To get started:
164
231
 
165
- ``` shell
232
+ ```shell
166
233
  bundle install --path vendor
167
234
  ```
168
235
 
@@ -60,6 +60,76 @@ module CompaniesHouse
60
60
  )
61
61
  end
62
62
 
63
+ def persons_with_significant_control_corporate_entity_beneficial_owner(id, psc_id)
64
+ request(
65
+ resource: :persons_with_significant_control_corporate_entity_beneficial_owner,
66
+ path: "company/#{id}/persons-with-significant-control/corporate-entity-beneficial-owner/#{psc_id}",
67
+ )
68
+ end
69
+
70
+ def persons_with_significant_control_corporate_entity(id, psc_id)
71
+ request(
72
+ resource: :persons_with_significant_control_corporate_entity,
73
+ path: "company/#{id}/persons-with-significant-control/corporate-entity/#{psc_id}",
74
+ )
75
+ end
76
+
77
+ def persons_with_significant_control_individual_beneficial_owner(id, psc_id)
78
+ request(
79
+ resource: :persons_with_significant_control_individual_beneficial_owner,
80
+ path: "company/#{id}/persons-with-significant-control/individual-beneficial-owner/#{psc_id}",
81
+ )
82
+ end
83
+
84
+ def persons_with_significant_control_individual(id, psc_id)
85
+ request(
86
+ resource: :persons_with_significant_control_individual,
87
+ path: "company/#{id}/persons-with-significant-control/individual/#{psc_id}",
88
+ )
89
+ end
90
+
91
+ def persons_with_significant_control_individual_with_verification_state(id, psc_id)
92
+ request(
93
+ resource: :persons_with_significant_control_individual_with_verification_state,
94
+ path: "company/#{id}/persons-with-significant-control/individual/#{psc_id}/verification-state",
95
+ )
96
+ end
97
+
98
+ def persons_with_significant_control_individual_full_record(id, psc_id)
99
+ request(
100
+ resource: :persons_with_significant_control_individual_full_record,
101
+ path: "company/#{id}/persons-with-significant-control/individual/#{psc_id}/full_record",
102
+ )
103
+ end
104
+
105
+ def persons_with_significant_control_legal_person_beneficial_owner(id, psc_id)
106
+ request(
107
+ resource: :persons_with_significant_control_legal_person_beneficial_owner,
108
+ path: "company/#{id}/persons-with-significant-control/legal-person-beneficial-owner/#{psc_id}",
109
+ )
110
+ end
111
+
112
+ def persons_with_significant_control_legal_person(id, psc_id)
113
+ request(
114
+ resource: :persons_with_significant_control_legal_person,
115
+ path: "company/#{id}/persons-with-significant-control/legal-person/#{psc_id}",
116
+ )
117
+ end
118
+
119
+ def persons_with_significant_control_super_secure_beneficial_owner(id, super_secure_id)
120
+ request(
121
+ resource: :persons_with_significant_control_super_secure_beneficial_owner,
122
+ path: "company/#{id}/persons-with-significant-control/super-secure-beneficial-owner/#{super_secure_id}",
123
+ )
124
+ end
125
+
126
+ def persons_with_significant_control_super_secure_person(id, super_secure_id)
127
+ request(
128
+ resource: :persons_with_significant_control_super_secure_person,
129
+ path: "company/#{id}/persons-with-significant-control/super-secure/#{super_secure_id}",
130
+ )
131
+ end
132
+
63
133
  def persons_with_significant_control_statements(id, register_view: false)
64
134
  get_all_pages(
65
135
  :persons_with_significant_control_statements,
@@ -69,6 +139,13 @@ module CompaniesHouse
69
139
  )
70
140
  end
71
141
 
142
+ def persons_with_significant_control_statement(id, statement_id)
143
+ request(
144
+ resource: :persons_with_significant_control_statement,
145
+ path: "company/#{id}/persons-with-significant-control-statements/#{statement_id}",
146
+ )
147
+ end
148
+
72
149
  def filing_history_list(id)
73
150
  get_all_pages(:filing_history_list, "company/#{id}/filing-history", id)
74
151
  end
@@ -80,12 +157,13 @@ module CompaniesHouse
80
157
  )
81
158
  end
82
159
 
83
- def company_search(query, items_per_page: nil, start_index: nil)
160
+ def company_search(query, items_per_page: nil, start_index: nil, restrictions: nil)
84
161
  request(
85
162
  resource: :company_search,
86
163
  path: "search/companies",
87
164
  params: {
88
- q: query, items_per_page: items_per_page, start_index: start_index
165
+ q: query, items_per_page: items_per_page, start_index: start_index,
166
+ restrictions: restrictions
89
167
  }.compact,
90
168
  )
91
169
  end
@@ -50,7 +50,7 @@ module CompaniesHouse
50
50
  def execute
51
51
  @started = Time.now.utc
52
52
  response = request_resource(@uri)
53
- @notification_payload[:status] = response.code
53
+ @notification_payload[:response_status] = response.code
54
54
 
55
55
  begin
56
56
  @notification_payload[:response] = parse(response, resource_type, resource_id)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CompaniesHouse
4
- VERSION = "1.0.1"
4
+ VERSION = "1.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: companies-house-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless Engineering
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-09-24 00:00:00.000000000 Z
10
+ date: 2025-09-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: dry-struct
@@ -52,7 +51,6 @@ licenses:
52
51
  - MIT
53
52
  metadata:
54
53
  rubygems_mfa_required: 'true'
55
- post_install_message:
56
54
  rdoc_options: []
57
55
  require_paths:
58
56
  - lib
@@ -67,8 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
65
  - !ruby/object:Gem::Version
68
66
  version: '0'
69
67
  requirements: []
70
- rubygems_version: 3.5.11
71
- signing_key:
68
+ rubygems_version: 3.6.5
72
69
  specification_version: 4
73
70
  summary: Look up UK company registration information
74
71
  test_files: []