zaikio-directory 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90ecc69c9bfccc037868c41f76b665d456a9588bf9c573a3a53833d81b844419
4
- data.tar.gz: 0c12da5059d2aadd77c4ec3f4f371c41582d77f0c866911df83216c42ee62b9a
3
+ metadata.gz: 8dc2956d9034111c7ad80906d9f705c98503817f6cc6cb938f787646ca31cd7f
4
+ data.tar.gz: f8418bfc9b9c98ae9d245f24c50d5ac5f62493a56f36d5a1bfd5b769a24d7e9e
5
5
  SHA512:
6
- metadata.gz: 4d084614b98a1ca2867b7806eb5f6edeeaab2ff29e4c4724de48b3edeadbffb926dccd7a4338f541e8358dd8dc90929b0b9576eda82b82f0195521ac8ce1fe0c
7
- data.tar.gz: ce5486bccd57d2444533c6cb08380ad103af33ffafe9f41bec02daf1914afeca6f07c07eeb3bd528dc3bd9a7bd655dedf5b30d4fb70cbfcff2acb62992179d2f
6
+ metadata.gz: 00a3f4b24da97e0a6b7ecf041fe466e4ea30554f4ccc0b05cb51a5b1f14051c9c4516fec892b675d54f747b524b0dd0cf8b3eea8bdeaefc22388cf731762a0a1
7
+ data.tar.gz: a28cb5c4cae83c646c815019a41b0f6f0e592a7398caeaf582cbe52c2b7ba492e817d98255649c119a00ad1d25f88343897ffe1d40f16ae4cb0064770c066884
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.0] - 2020-01-21
11
+
12
+ ### Added
13
+
14
+ - `Zaikio::Directory::TestAccount`
15
+
10
16
  ## [0.1.1] - 2020-09-02
11
17
 
12
18
  ### Fixed
@@ -17,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
23
  ### Added
18
24
  - Added subscriptions (migration required)
19
25
 
20
- [Unreleased]: https://github.com/crispymtn/zaikio-directory-ruby/compare/v0.1.1...HEAD
21
- [0.1.1]: https://github.com/crispymtn/zaikio-directory-ruby/compare/5c6cb4dbcac316733560ddb2b1e13b53e55eb66e...v0.1.1
22
- [0.1.0]: https://github.com/crispymtn/zaikio-directory-ruby/compare/d149fb4c0abe6005f123def3952d2dd2ef6404bb...29889d8a6a496542a81e05688da2a46cf4c44188
26
+ [Unreleased]: https://github.com/zaikio/zaikio-directory-ruby/compare/v0.2.0...HEAD
27
+ [0.2.0]: https://github.com/zaikio/zaikio-directory-ruby/compare/v0.1.1...v.0.2.0
28
+ [0.1.1]: https://github.com/zaikio/zaikio-directory-ruby/compare/5c6cb4dbcac316733560ddb2b1e13b53e55eb66e...v0.1.1
29
+ [0.1.0]: https://github.com/zaikio/zaikio-directory-ruby/compare/d149fb4c0abe6005f123def3952d2dd2ef6404bb...29889d8a6a496542a81e05688da2a46cf4c44188
data/README.md CHANGED
@@ -35,7 +35,7 @@ end
35
35
 
36
36
  The Directory Client has an ORM like design. However, we distinguish between the contexts of the organization and the person.
37
37
 
38
- For the requests to work, a valid JSON Web token with the correct OAuth Scopes must always be provided. Please refer to [zakio-oauth_client](https://github.com/crispymtn/zaikio-oauth_client).
38
+ For the requests to work, a valid JSON Web token with the correct OAuth Scopes must always be provided. Please refer to [zakio-oauth_client](https://github.com/zaikio/zaikio-oauth_client).
39
39
 
40
40
  If you want to know which actions are available and which scopes are required, please refer to the [Directory API Reference](https://docs.zaikio.com/api/directory/directory.html).
41
41
 
@@ -103,6 +103,15 @@ Zaikio::Directory.with_basic_auth(client_id, client_secret) do
103
103
  subscription.increment_usage_by!(:orders_created, 12)
104
104
  end
105
105
 
106
+ Zaikio::Directory.with_basic_auth(client_id, client_secret) do
107
+ Zaikio::Directory::TestAccount.create(
108
+ name: "My Test Org",
109
+ country_code: "DE",
110
+ kinds: ["printer"],
111
+ connection_attributes: ["procurement_consumer"]
112
+ )
113
+ end
114
+
106
115
  roles = Zaikio::Directory::Role.all
107
116
  revoked_access_tokens = Zaikio::Directory::RevokedAccessToken.all
108
117
 
@@ -24,11 +24,13 @@ require "zaikio/directory/role"
24
24
  require "zaikio/directory/revoked_access_token"
25
25
  require "zaikio/directory/connection"
26
26
  require "zaikio/directory/subscription"
27
+ require "zaikio/directory/test_account"
27
28
 
28
29
  module Zaikio
29
30
  module Directory
30
31
  class << self
31
32
  attr_accessor :configuration
33
+
32
34
  class_attribute :connection
33
35
 
34
36
  def configure
@@ -20,7 +20,7 @@ module Zaikio
20
20
  end
21
21
 
22
22
  def logger
23
- @logger ||= Logger.new(STDOUT)
23
+ @logger ||= Logger.new($stdout)
24
24
  end
25
25
 
26
26
  def environment=(env)
@@ -0,0 +1,15 @@
1
+ module Zaikio
2
+ module Directory
3
+ class TestAccount < Base
4
+ uri "test_accounts(/:id)"
5
+
6
+ include_root_in_json :test_account
7
+
8
+ # Associations
9
+ has_many :memberships, class_name: "Zaikio::Directory::Membership",
10
+ uri: nil
11
+ has_many :sites, class_name: "Zaikio::Directory::Site",
12
+ uri: nil
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  module Zaikio
2
2
  module Directory
3
- VERSION = "0.1.1".freeze
3
+ VERSION = "0.2.0".freeze
4
4
  end
5
5
  end
@@ -1,6 +1,8 @@
1
1
  module Zaikio
2
2
  class Error < StandardError; end
3
+
3
4
  class ConnectionError < Zaikio::Error; end
5
+
4
6
  class ResourceNotFound < Zaikio::Error; end
5
7
  end
6
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaikio-directory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - crispymtn
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-09-02 00:00:00.000000000 Z
13
+ date: 2021-01-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: concurrent-ruby
@@ -64,16 +64,22 @@ dependencies:
64
64
  name: oj
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: 3.10.5
70
+ - - "<"
71
+ - !ruby/object:Gem::Version
72
+ version: 3.12.0
70
73
  type: :runtime
71
74
  prerelease: false
72
75
  version_requirements: !ruby/object:Gem::Requirement
73
76
  requirements:
74
- - - "~>"
77
+ - - ">="
75
78
  - !ruby/object:Gem::Version
76
79
  version: 3.10.5
80
+ - - "<"
81
+ - !ruby/object:Gem::Version
82
+ version: 3.12.0
77
83
  - !ruby/object:Gem::Dependency
78
84
  name: spyke
79
85
  requirement: !ruby/object:Gem::Requirement
@@ -123,13 +129,14 @@ files:
123
129
  - lib/zaikio/directory/software.rb
124
130
  - lib/zaikio/directory/specialist.rb
125
131
  - lib/zaikio/directory/subscription.rb
132
+ - lib/zaikio/directory/test_account.rb
126
133
  - lib/zaikio/directory/version.rb
127
134
  - lib/zaikio/error.rb
128
135
  homepage: https://www.zaikio.com/
129
136
  licenses:
130
137
  - MIT
131
138
  metadata:
132
- changelog_uri: https://github.com/crispymtn/zaikio-directory-ruby/blob/master/CHANGELOG.md
139
+ changelog_uri: https://github.com/zaikio/zaikio-directory-ruby/blob/master/CHANGELOG.md
133
140
  post_install_message:
134
141
  rdoc_options: []
135
142
  require_paths:
@@ -138,7 +145,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
145
  requirements:
139
146
  - - ">="
140
147
  - !ruby/object:Gem::Version
141
- version: '0'
148
+ version: 2.6.5
142
149
  required_rubygems_version: !ruby/object:Gem::Requirement
143
150
  requirements:
144
151
  - - ">="