oneaccess 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/oneaccess/api/organizations.rb +2 -2
- data/lib/oneaccess/api/references.rb +22 -0
- data/lib/oneaccess/data_object/address.rb +4 -0
- data/lib/oneaccess/data_object/city.rb +4 -0
- data/lib/oneaccess/data_object/company.rb +4 -0
- data/lib/oneaccess/data_object/company_light.rb +4 -0
- data/lib/oneaccess/data_object/country.rb +4 -0
- data/lib/oneaccess/data_object/global_region.rb +4 -0
- data/lib/oneaccess/data_object/industry.rb +5 -0
- data/lib/oneaccess/data_object/organization.rb +4 -0
- data/lib/oneaccess/data_object/organization_light.rb +4 -0
- data/lib/oneaccess/data_object/product_group.rb +4 -0
- data/lib/oneaccess/data_object/region.rb +4 -0
- data/lib/oneaccess/data_object/representer/industry.rb +9 -0
- data/lib/oneaccess/data_object/research_document_info.rb +4 -0
- data/lib/oneaccess/data_object/saml_info.rb +4 -0
- data/lib/oneaccess/data_object/user.rb +4 -0
- data/lib/oneaccess/response/base_response.rb +12 -0
- data/lib/oneaccess/response/companies_response.rb +3 -12
- data/lib/oneaccess/response/company_response.rb +4 -8
- data/lib/oneaccess/response/industries_response.rb +12 -0
- data/lib/oneaccess/response/{organizations_response.rb → organization_response.rb} +3 -4
- data/lib/oneaccess/response/paginated_response.rb +15 -0
- data/lib/oneaccess/response/product_groups_response.rb +3 -11
- data/lib/oneaccess/response/representer/base_response.rb +13 -0
- data/lib/oneaccess/response/representer/{companies_representer.rb → companies_response.rb} +2 -6
- data/lib/oneaccess/response/representer/{company_representer.rb → company_response.rb} +2 -4
- data/lib/oneaccess/response/representer/industries_response.rb +16 -0
- data/lib/oneaccess/response/representer/{organizations_response.rb → organization_response.rb} +2 -4
- data/lib/oneaccess/response/representer/paginated_response.rb +14 -0
- data/lib/oneaccess/response/representer/product_groups_response.rb +3 -7
- data/lib/oneaccess/response/representer/research_document_response.rb +3 -4
- data/lib/oneaccess/response/representer/user_response.rb +3 -4
- data/lib/oneaccess/response/research_document_response.rb +3 -6
- data/lib/oneaccess/response/user_response.rb +3 -6
- data/lib/oneaccess.rb +1 -0
- data/oneaccess.gemspec +1 -1
- metadata +12 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b3213f560c414b929e43bca013e0eec25d99219
|
4
|
+
data.tar.gz: 0d8b39ab276eeffa5c94b6230ce6705a63ced999
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10c3a85a0d6d80325b6326b07b34bc3a4a7b9b2235a925117bc3bc50e89723b7ae31c727aab357e2b7144faf332d8ca69014528e25ef3b0f95dfb973e261362f
|
7
|
+
data.tar.gz: a799f9ce81142ec26b1341d38caf89a01c461523fe7e52fb9fc38a9f2f2e7574bbc728682bed25f3506691252898a05157648351a480987c723fc0beaf723ea6
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "../response/
|
3
|
+
require_relative "../response/organization_response"
|
4
4
|
|
5
5
|
module ONEAccess
|
6
6
|
module API
|
@@ -9,7 +9,7 @@ module ONEAccess
|
|
9
9
|
|
10
10
|
def self.get(id:)
|
11
11
|
resp = send_get("get/#{id}")
|
12
|
-
Response::
|
12
|
+
Response::OrganizationResponse.from_json(resp.body)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../response/industries_response"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module API
|
7
|
+
class References < Base
|
8
|
+
api_path "/references"
|
9
|
+
|
10
|
+
def self.industries(sort_by: "Id", is_ascending: false, keyword: "", page_number: 0, page_size: 20)
|
11
|
+
resp = send_get("industries", Query: {
|
12
|
+
SortBy: sort_by,
|
13
|
+
IsAscending: is_ascending,
|
14
|
+
Keyword: keyword,
|
15
|
+
PageNumber: page_number,
|
16
|
+
PageSize: page_size
|
17
|
+
}.to_json)
|
18
|
+
Response::IndustriesResponse.from_json(resp.body)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -5,9 +5,14 @@ require_relative "./representer/industry"
|
|
5
5
|
module ONEAccess
|
6
6
|
module DataObject
|
7
7
|
class Industry
|
8
|
+
extend Serializable
|
9
|
+
|
10
|
+
represented_by Representer::Industry
|
11
|
+
|
8
12
|
attr_accessor :id
|
9
13
|
attr_accessor :name
|
10
14
|
attr_accessor :code
|
15
|
+
attr_accessor :parent
|
11
16
|
end
|
12
17
|
end
|
13
18
|
end
|
@@ -1,4 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require_relative "../industry"
|
3
|
+
|
4
|
+
# declare industry to avoid circular dependency
|
5
|
+
# rubocop:disable Style/ClassAndModuleChildren
|
6
|
+
class ONEAccess::DataObject::Industry; end
|
7
|
+
class ONEAccess::DataObject::Representer::Industry < Representable::Decorator; end
|
8
|
+
# rubocop:enable Style/ClassAndModuleChildren
|
2
9
|
|
3
10
|
module ONEAccess
|
4
11
|
module DataObject
|
@@ -9,6 +16,8 @@ module ONEAccess
|
|
9
16
|
property :id, as: :Id, type: Integer
|
10
17
|
property :name, as: :Name, type: String
|
11
18
|
property :code, as: :Code, type: String
|
19
|
+
property :parent, as: :Parent,
|
20
|
+
decorator: Representer::Industry, class: DataObject::Industry
|
12
21
|
end
|
13
22
|
end
|
14
23
|
end
|
@@ -4,6 +4,10 @@ require_relative "./representer/research_document_info"
|
|
4
4
|
module ONEAccess
|
5
5
|
module DataObject
|
6
6
|
class ResearchDocumentInfo
|
7
|
+
extend Serializable
|
8
|
+
|
9
|
+
represented_by Representer::ResearchDocumentInfo
|
10
|
+
|
7
11
|
attr_accessor :url
|
8
12
|
attr_accessor :title
|
9
13
|
attr_accessor :saml # instance of SAMLInfo
|
@@ -1,21 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "./
|
3
|
+
require_relative "./paginated_response"
|
4
|
+
require_relative "./representer/companies_response"
|
4
5
|
|
5
6
|
module ONEAccess
|
6
7
|
module Response
|
7
|
-
class CompaniesResponse
|
8
|
-
extend Serializable
|
9
|
-
|
8
|
+
class CompaniesResponse < PaginatedResponse
|
10
9
|
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
10
|
end
|
20
11
|
end
|
21
12
|
end
|
@@ -1,16 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "./
|
3
|
+
require_relative "./base_response"
|
4
|
+
require_relative "./representer/company_response"
|
4
5
|
|
5
6
|
module ONEAccess
|
6
7
|
module Response
|
7
|
-
class CompanyResponse
|
8
|
-
|
9
|
-
|
10
|
-
represented_by Representer::CompanyRepresenter
|
11
|
-
|
12
|
-
attr_accessor :api_status_code
|
13
|
-
attr_accessor :data
|
8
|
+
class CompanyResponse < BaseResponse
|
9
|
+
represented_by Representer::CompanyResponse
|
14
10
|
end
|
15
11
|
end
|
16
12
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./paginated_response"
|
4
|
+
require_relative "./representer/industries_response"
|
5
|
+
|
6
|
+
module ONEAccess
|
7
|
+
module Response
|
8
|
+
class IndustriesResponse < PaginatedResponse
|
9
|
+
represented_by Representer::IndustriesResponse
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -1,13 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "./representer/organizations_response"
|
2
|
+
require_relative "./representer/organization_response"
|
4
3
|
|
5
4
|
module ONEAccess
|
6
5
|
module Response
|
7
|
-
class
|
6
|
+
class OrganizationResponse
|
8
7
|
extend Serializable
|
9
8
|
|
10
|
-
represented_by Representer::
|
9
|
+
represented_by Representer::OrganizationResponse
|
11
10
|
|
12
11
|
attr_accessor :api_status_code
|
13
12
|
attr_accessor :data
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./base_response"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module Response
|
7
|
+
class PaginatedResponse < BaseResponse
|
8
|
+
attr_accessor :total_count
|
9
|
+
attr_accessor :has_more_records
|
10
|
+
|
11
|
+
alias has_more_records? has_more_records
|
12
|
+
alias more_records? has_more_records
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -1,20 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./paginated_response"
|
2
4
|
require_relative "./representer/product_groups_response"
|
3
5
|
|
4
6
|
module ONEAccess
|
5
7
|
module Response
|
6
|
-
class ProductGroupsResponse
|
7
|
-
extend Serializable
|
8
|
-
|
8
|
+
class ProductGroupsResponse < PaginatedResponse
|
9
9
|
represented_by Representer::ProductGroupsResponse
|
10
|
-
|
11
|
-
attr_accessor :api_status_code
|
12
|
-
attr_accessor :total_count
|
13
|
-
attr_accessor :has_more_records
|
14
|
-
attr_accessor :data
|
15
|
-
|
16
|
-
alias has_more_records? has_more_records
|
17
|
-
alias more_records? has_more_records
|
18
10
|
end
|
19
11
|
end
|
20
12
|
end
|
@@ -1,16 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "./paginated_response"
|
3
4
|
require_relative "../../data_object/company_light"
|
4
5
|
|
5
6
|
module ONEAccess
|
6
7
|
module Response
|
7
8
|
module Representer
|
8
|
-
class CompaniesResponse <
|
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
|
9
|
+
class CompaniesResponse < PaginatedResponse
|
14
10
|
collection :data, as: :Data,
|
15
11
|
decorator: DataObject::Representer::CompanyLight,
|
16
12
|
class: DataObject::CompanyLight
|
@@ -1,15 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "./base_response"
|
3
4
|
require_relative "../../data_object/industry"
|
4
5
|
require_relative "../../data_object/company"
|
5
6
|
|
6
7
|
module ONEAccess
|
7
8
|
module Response
|
8
9
|
module Representer
|
9
|
-
class
|
10
|
-
include Representable::JSON
|
11
|
-
|
12
|
-
property :api_status_code, as: :ApiStatusCode
|
10
|
+
class CompanyResponse < BaseResponse
|
13
11
|
property :data, as: :Data,
|
14
12
|
decorator: DataObject::Representer::Company,
|
15
13
|
class: DataObject::Company
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./paginated_response"
|
4
|
+
require_relative "../../data_object/industry"
|
5
|
+
|
6
|
+
module ONEAccess
|
7
|
+
module Response
|
8
|
+
module Representer
|
9
|
+
class IndustriesResponse < PaginatedResponse
|
10
|
+
collection :data, as: :Data,
|
11
|
+
decorator: DataObject::Representer::Industry,
|
12
|
+
class: DataObject::Industry
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/oneaccess/response/representer/{organizations_response.rb → organization_response.rb}
RENAMED
@@ -1,14 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "./base_response"
|
3
4
|
require_relative "../../data_object/organization"
|
4
5
|
|
5
6
|
module ONEAccess
|
6
7
|
module Response
|
7
8
|
module Representer
|
8
|
-
class
|
9
|
-
include Representable::JSON
|
10
|
-
|
11
|
-
property :api_status_code, as: :ApiStatusCode
|
9
|
+
class OrganizationResponse < BaseResponse
|
12
10
|
property :data, as: :Data, decorator: DataObject::Representer::Organization, class: DataObject::Organization
|
13
11
|
end
|
14
12
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./base_response"
|
4
|
+
|
5
|
+
module ONEAccess
|
6
|
+
module Response
|
7
|
+
module Representer
|
8
|
+
class PaginatedResponse < BaseResponse
|
9
|
+
property :has_more_records, as: :HasMoreRecords
|
10
|
+
property :total_count, as: :TotalCount
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -1,16 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./paginated_response"
|
2
4
|
require_relative "../../data_object/product_group"
|
3
5
|
|
4
6
|
module ONEAccess
|
5
7
|
module Response
|
6
8
|
module Representer
|
7
|
-
class ProductGroupsResponse <
|
8
|
-
include Representable::JSON
|
9
|
-
|
10
|
-
property :api_status_code, as: :ApiStatusCode
|
11
|
-
property :has_more_records, as: :HasMoreRecords
|
12
|
-
property :total_count, as: :TotalCount
|
13
|
-
property :api_status_code, as: :ApiStatusCode
|
9
|
+
class ProductGroupsResponse < PaginatedResponse
|
14
10
|
collection :data, as: :Data,
|
15
11
|
decorator: DataObject::Representer::ProductGroup,
|
16
12
|
class: DataObject::ProductGroup
|
@@ -1,13 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./base_response"
|
2
4
|
require_relative "../../data_object/research_document_info"
|
3
5
|
|
4
6
|
module ONEAccess
|
5
7
|
module Response
|
6
8
|
module Representer
|
7
|
-
class ResearchDocumentResponse <
|
8
|
-
include Representable::JSON
|
9
|
-
|
10
|
-
property :api_status_code, as: :ApiStatusCode
|
9
|
+
class ResearchDocumentResponse < BaseResponse
|
11
10
|
property :data, as: :Data,
|
12
11
|
decorator: DataObject::Representer::ResearchDocumentInfo,
|
13
12
|
class: DataObject::ResearchDocumentInfo
|
@@ -1,13 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./base_response"
|
2
4
|
require_relative "../../data_object/user"
|
3
5
|
|
4
6
|
module ONEAccess
|
5
7
|
module Response
|
6
8
|
module Representer
|
7
|
-
class UserResponse <
|
8
|
-
include Representable::JSON
|
9
|
-
|
10
|
-
property :api_status_code, as: :ApiStatusCode
|
9
|
+
class UserResponse < BaseResponse
|
11
10
|
property :data, as: :Data, decorator: DataObject::Representer::User, class: DataObject::User
|
12
11
|
end
|
13
12
|
end
|
@@ -1,15 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./base_response"
|
2
4
|
require_relative "./representer/research_document_response"
|
3
5
|
|
4
6
|
module ONEAccess
|
5
7
|
module Response
|
6
|
-
class ResearchDocumentResponse
|
7
|
-
extend Serializable
|
8
|
-
|
8
|
+
class ResearchDocumentResponse < BaseResponse
|
9
9
|
represented_by Representer::ResearchDocumentResponse
|
10
|
-
|
11
|
-
attr_accessor :api_status_code
|
12
|
-
attr_accessor :data
|
13
10
|
end
|
14
11
|
end
|
15
12
|
end
|
@@ -1,15 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "./base_response"
|
2
4
|
require_relative "./representer/user_response"
|
3
5
|
|
4
6
|
module ONEAccess
|
5
7
|
module Response
|
6
|
-
class UserResponse
|
7
|
-
extend Serializable
|
8
|
-
|
8
|
+
class UserResponse < BaseResponse
|
9
9
|
represented_by Representer::UserResponse
|
10
|
-
|
11
|
-
attr_accessor :api_status_code
|
12
|
-
attr_accessor :data
|
13
10
|
end
|
14
11
|
end
|
15
12
|
end
|
data/lib/oneaccess.rb
CHANGED
@@ -13,6 +13,7 @@ require_relative "./oneaccess/api/user"
|
|
13
13
|
require_relative "./oneaccess/api/research"
|
14
14
|
require_relative "./oneaccess/api/organizations"
|
15
15
|
require_relative "./oneaccess/api/symbology"
|
16
|
+
require_relative "./oneaccess/api/references"
|
16
17
|
require_relative "./oneaccess/api/entitlement/organization/product_group"
|
17
18
|
require_relative "./oneaccess/api/entitlement/user/product_group"
|
18
19
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Correia Santos
|
@@ -185,6 +185,7 @@ files:
|
|
185
185
|
- lib/oneaccess/api/entitlement/organization/product_group.rb
|
186
186
|
- lib/oneaccess/api/entitlement/user/product_group.rb
|
187
187
|
- lib/oneaccess/api/organizations.rb
|
188
|
+
- lib/oneaccess/api/references.rb
|
188
189
|
- lib/oneaccess/api/research.rb
|
189
190
|
- lib/oneaccess/api/symbology.rb
|
190
191
|
- lib/oneaccess/api/user.rb
|
@@ -222,14 +223,20 @@ files:
|
|
222
223
|
- lib/oneaccess/enum/product_type.rb
|
223
224
|
- lib/oneaccess/error/api_error.rb
|
224
225
|
- lib/oneaccess/response/api_error.rb
|
226
|
+
- lib/oneaccess/response/base_response.rb
|
225
227
|
- lib/oneaccess/response/companies_response.rb
|
226
228
|
- lib/oneaccess/response/company_response.rb
|
227
|
-
- lib/oneaccess/response/
|
229
|
+
- lib/oneaccess/response/industries_response.rb
|
230
|
+
- lib/oneaccess/response/organization_response.rb
|
231
|
+
- lib/oneaccess/response/paginated_response.rb
|
228
232
|
- lib/oneaccess/response/product_groups_response.rb
|
229
233
|
- lib/oneaccess/response/representer/api_error.rb
|
230
|
-
- lib/oneaccess/response/representer/
|
231
|
-
- lib/oneaccess/response/representer/
|
232
|
-
- lib/oneaccess/response/representer/
|
234
|
+
- lib/oneaccess/response/representer/base_response.rb
|
235
|
+
- lib/oneaccess/response/representer/companies_response.rb
|
236
|
+
- lib/oneaccess/response/representer/company_response.rb
|
237
|
+
- lib/oneaccess/response/representer/industries_response.rb
|
238
|
+
- lib/oneaccess/response/representer/organization_response.rb
|
239
|
+
- lib/oneaccess/response/representer/paginated_response.rb
|
233
240
|
- lib/oneaccess/response/representer/product_groups_response.rb
|
234
241
|
- lib/oneaccess/response/representer/research_document_response.rb
|
235
242
|
- lib/oneaccess/response/representer/user_response.rb
|