oneaccess 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -0
- data/lib/oneaccess.rb +1 -0
- data/lib/oneaccess/api/symbology.rb +26 -0
- data/lib/oneaccess/data_object/company.rb +22 -0
- data/lib/oneaccess/data_object/company_light.rb +18 -0
- data/lib/oneaccess/data_object/representer/company.rb +23 -0
- data/lib/oneaccess/data_object/representer/company_light.rb +17 -0
- data/lib/oneaccess/data_object/representer/sub_industry.rb +15 -0
- data/lib/oneaccess/data_object/sub_industry.rb +13 -0
- data/lib/oneaccess/response/companies_response.rb +21 -0
- data/lib/oneaccess/response/company_response.rb +16 -0
- data/lib/oneaccess/response/representer/companies_representer.rb +20 -0
- data/lib/oneaccess/response/representer/company_representer.rb +19 -0
- data/oneaccess.gemspec +1 -1
- metadata +12 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7ae1428a99e8896caba2a79ad34a7593a2ce156
|
4
|
+
data.tar.gz: 81b2d2137a1461398794b72f51afc682502a3a4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9e78607b5a269a5fae9be54dc1d01aa5e9abf4d444c85f2e3ea7b582be37d96cfd5db0989239a05d0c3236cb3f7d7be26ba90cea3b8ceabdde8b52212fb4e1c
|
7
|
+
data.tar.gz: 1769369a86740bba393a98ad1d04812c7828565cb62bebbc4f2702df127b43754910bb54e28b1d14f7e816241c81b8cd9c3b1255cba47a010056793f6bbb1612
|
data/README.md
CHANGED
@@ -104,6 +104,36 @@ rescue ONEAccess::Error::APIError => e
|
|
104
104
|
end
|
105
105
|
```
|
106
106
|
|
107
|
+
### Symbology Companies _(/symbology/companies)_
|
108
|
+
Official Documentation: http://apidocs.oneaccess.io/docs/symbologycompanies
|
109
|
+
|
110
|
+
This method retrieves a list of symbology companies by providing a `IsPrivate`, `PageNumber` and `PageSize`.
|
111
|
+
|
112
|
+
#### How to use:
|
113
|
+
```ruby
|
114
|
+
resp = ONEAccess::API::Symbology.companies(is_private: false, page_number: 0, page_size: 20)
|
115
|
+
|
116
|
+
resp #=> instance of ONEAcess::Response::CompaniesResponse
|
117
|
+
resp.data #=> instance of Array containing ONEAcess::DataObject::CompanyLight
|
118
|
+
|
119
|
+
end
|
120
|
+
```
|
121
|
+
|
122
|
+
### Symbology Company _(/symbology/company/:id)_
|
123
|
+
Official Documentation: http://apidocs.oneaccess.io/docs/referencescountriesid
|
124
|
+
|
125
|
+
This method retrieves a company by providing an `Id`.
|
126
|
+
|
127
|
+
#### How to use:
|
128
|
+
```ruby
|
129
|
+
resp = ONEAccess::API::Symbology.company(id: 1)
|
130
|
+
|
131
|
+
resp #=> instance of ONEAcess::Response::CompanyResponse
|
132
|
+
resp.data #=> instance of Array containing ONEAcess::DataObject::Company
|
133
|
+
|
134
|
+
end
|
135
|
+
```
|
136
|
+
|
107
137
|
### Get Organization by ID _(/organizations/id)_
|
108
138
|
Official Documentation: http://apidocs.oneaccess.io/docs/organization-2
|
109
139
|
|
data/lib/oneaccess.rb
CHANGED
@@ -12,6 +12,7 @@ require_relative "./oneaccess/api/base"
|
|
12
12
|
require_relative "./oneaccess/api/user"
|
13
13
|
require_relative "./oneaccess/api/research"
|
14
14
|
require_relative "./oneaccess/api/organizations"
|
15
|
+
require_relative "./oneaccess/api/symbology"
|
15
16
|
require_relative "./oneaccess/api/entitlement/organization/product_group"
|
16
17
|
require_relative "./oneaccess/api/entitlement/user/product_group"
|
17
18
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../response/companies_response"
|
4
|
+
require_relative "../response/company_response"
|
5
|
+
|
6
|
+
module ONEAccess
|
7
|
+
module API
|
8
|
+
class Symbology < Base
|
9
|
+
api_path "/symbology"
|
10
|
+
|
11
|
+
def self.companies(is_private:, page_number: 0, page_size: 20)
|
12
|
+
resp = send_get("companies", Query: {
|
13
|
+
PageNumber: page_number,
|
14
|
+
PageSize: page_size,
|
15
|
+
IsPrivate: is_private
|
16
|
+
}.to_json)
|
17
|
+
Response::CompaniesResponse.from_json(resp.body)
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.company(id:)
|
21
|
+
resp = send_get("companies/#{id}")
|
22
|
+
Response::CompanyResponse.from_json(resp.body)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./representer/company"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module DataObject
|
7
|
+
class Company
|
8
|
+
attr_accessor :id
|
9
|
+
attr_accessor :name
|
10
|
+
attr_accessor :is_private
|
11
|
+
attr_accessor :exchange_code
|
12
|
+
attr_accessor :ticker
|
13
|
+
attr_accessor :website
|
14
|
+
attr_accessor :address
|
15
|
+
attr_accessor :sub_industry
|
16
|
+
attr_accessor :perm_id
|
17
|
+
|
18
|
+
alias is_private? is_private
|
19
|
+
alias private? is_private
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./representer/company_light"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module DataObject
|
7
|
+
class CompanyLight
|
8
|
+
attr_accessor :id
|
9
|
+
attr_accessor :name
|
10
|
+
attr_accessor :is_private
|
11
|
+
attr_accessor :exchange_code
|
12
|
+
attr_accessor :ticker
|
13
|
+
|
14
|
+
alias is_private? is_private
|
15
|
+
alias private? is_private
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ONEAccess
|
4
|
+
module DataObject
|
5
|
+
module Representer
|
6
|
+
class Company < Representable::Decorator
|
7
|
+
include Representable::JSON
|
8
|
+
|
9
|
+
property :id, as: :Id, type: Integer
|
10
|
+
property :perm_id, as: :PermId, type: Integer
|
11
|
+
property :name, as: :Name, type: String
|
12
|
+
property :is_private, as: :IsPrivate
|
13
|
+
property :exchange_code, as: :ExchangeCode, type: String
|
14
|
+
property :ticker, as: :Ticker, type: String
|
15
|
+
property :website, as: :Website, type: String
|
16
|
+
property :address, as: :Address,
|
17
|
+
decorator: Representer::Address, class: DataObject::Address
|
18
|
+
property :sub_industry, as: :SubIndustry,
|
19
|
+
decorator: Representer::SubIndustry, class: DataObject::SubIndustry
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ONEAccess
|
4
|
+
module DataObject
|
5
|
+
module Representer
|
6
|
+
class CompanyLight < Representable::Decorator
|
7
|
+
include Representable::JSON
|
8
|
+
|
9
|
+
property :id, as: :Id, type: Integer
|
10
|
+
property :name, as: :Name, type: String
|
11
|
+
property :is_private, as: :IsPrivate
|
12
|
+
property :exchange_code, as: :ExchangeCode, type: String
|
13
|
+
property :ticker, as: :Ticker, type: String
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module ONEAccess
|
4
|
+
module DataObject
|
5
|
+
module Representer
|
6
|
+
class SubIndustry < Representable::Decorator
|
7
|
+
include Representable::JSON
|
8
|
+
|
9
|
+
property :id, as: :Id, type: Integer
|
10
|
+
property :name, as: :Name, type: String
|
11
|
+
property :code, as: :Code, type: String
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./representer/companies_representer"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module Response
|
7
|
+
class CompaniesResponse
|
8
|
+
extend Serializable
|
9
|
+
|
10
|
+
represented_by Representer::CompaniesResponse
|
11
|
+
|
12
|
+
attr_accessor :api_status_code
|
13
|
+
attr_accessor :total_count
|
14
|
+
attr_accessor :has_more_records
|
15
|
+
attr_accessor :data
|
16
|
+
|
17
|
+
alias has_more_records? has_more_records
|
18
|
+
alias more_records? has_more_records
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./representer/company_representer"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module Response
|
7
|
+
class CompanyResponse
|
8
|
+
extend Serializable
|
9
|
+
|
10
|
+
represented_by Representer::CompanyRepresenter
|
11
|
+
|
12
|
+
attr_accessor :api_status_code
|
13
|
+
attr_accessor :data
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../data_object/company_light"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module Response
|
7
|
+
module Representer
|
8
|
+
class CompaniesResponse < Representable::Decorator
|
9
|
+
include Representable::JSON
|
10
|
+
|
11
|
+
property :api_status_code, as: :ApiStatusCode
|
12
|
+
property :has_more_records, as: :HasMoreRecords
|
13
|
+
property :total_count, as: :TotalCount
|
14
|
+
collection :data, as: :Data,
|
15
|
+
decorator: DataObject::Representer::CompanyLight,
|
16
|
+
class: DataObject::CompanyLight
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../data_object/sub_industry"
|
4
|
+
require_relative "../../data_object/company"
|
5
|
+
|
6
|
+
module ONEAccess
|
7
|
+
module Response
|
8
|
+
module Representer
|
9
|
+
class CompanyRepresenter < Representable::Decorator
|
10
|
+
include Representable::JSON
|
11
|
+
|
12
|
+
property :api_status_code, as: :ApiStatusCode
|
13
|
+
property :data, as: :Data,
|
14
|
+
decorator: DataObject::Representer::Company,
|
15
|
+
class: DataObject::Company
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/oneaccess.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oneaccess
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Correia Santos
|
@@ -186,10 +186,13 @@ files:
|
|
186
186
|
- lib/oneaccess/api/entitlement/user/product_group.rb
|
187
187
|
- lib/oneaccess/api/organizations.rb
|
188
188
|
- lib/oneaccess/api/research.rb
|
189
|
+
- lib/oneaccess/api/symbology.rb
|
189
190
|
- lib/oneaccess/api/user.rb
|
190
191
|
- lib/oneaccess/configuration.rb
|
191
192
|
- lib/oneaccess/data_object/address.rb
|
192
193
|
- lib/oneaccess/data_object/city.rb
|
194
|
+
- lib/oneaccess/data_object/company.rb
|
195
|
+
- lib/oneaccess/data_object/company_light.rb
|
193
196
|
- lib/oneaccess/data_object/country.rb
|
194
197
|
- lib/oneaccess/data_object/global_region.rb
|
195
198
|
- lib/oneaccess/data_object/organization.rb
|
@@ -198,6 +201,8 @@ files:
|
|
198
201
|
- lib/oneaccess/data_object/region.rb
|
199
202
|
- lib/oneaccess/data_object/representer/address.rb
|
200
203
|
- lib/oneaccess/data_object/representer/city.rb
|
204
|
+
- lib/oneaccess/data_object/representer/company.rb
|
205
|
+
- lib/oneaccess/data_object/representer/company_light.rb
|
201
206
|
- lib/oneaccess/data_object/representer/country.rb
|
202
207
|
- lib/oneaccess/data_object/representer/global_region.rb
|
203
208
|
- lib/oneaccess/data_object/representer/organization.rb
|
@@ -206,18 +211,24 @@ files:
|
|
206
211
|
- lib/oneaccess/data_object/representer/region.rb
|
207
212
|
- lib/oneaccess/data_object/representer/research_document_info.rb
|
208
213
|
- lib/oneaccess/data_object/representer/saml_info.rb
|
214
|
+
- lib/oneaccess/data_object/representer/sub_industry.rb
|
209
215
|
- lib/oneaccess/data_object/representer/user.rb
|
210
216
|
- lib/oneaccess/data_object/research_document_info.rb
|
211
217
|
- lib/oneaccess/data_object/saml_info.rb
|
218
|
+
- lib/oneaccess/data_object/sub_industry.rb
|
212
219
|
- lib/oneaccess/data_object/user.rb
|
213
220
|
- lib/oneaccess/enum/api_status_code.rb
|
214
221
|
- lib/oneaccess/enum/product_group_status.rb
|
215
222
|
- lib/oneaccess/enum/product_type.rb
|
216
223
|
- lib/oneaccess/error/api_error.rb
|
217
224
|
- lib/oneaccess/response/api_error.rb
|
225
|
+
- lib/oneaccess/response/companies_response.rb
|
226
|
+
- lib/oneaccess/response/company_response.rb
|
218
227
|
- lib/oneaccess/response/organizations_response.rb
|
219
228
|
- lib/oneaccess/response/product_groups_response.rb
|
220
229
|
- lib/oneaccess/response/representer/api_error.rb
|
230
|
+
- lib/oneaccess/response/representer/companies_representer.rb
|
231
|
+
- lib/oneaccess/response/representer/company_representer.rb
|
221
232
|
- lib/oneaccess/response/representer/organizations_response.rb
|
222
233
|
- lib/oneaccess/response/representer/product_groups_response.rb
|
223
234
|
- lib/oneaccess/response/representer/research_document_response.rb
|