dotypos 0.1.0 → 0.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: 2a64ec820b14432a4f7f5846c0a27688e081eedd352be2e881173a27a9a1fbba
4
- data.tar.gz: 8e3d6f7d7e4cddc4d9256ef7b40aef688ac63376807d92c35d86ee47da9907c8
3
+ metadata.gz: e6ec187f846243bed448a7877ddf4c723df8ad7fd805c84b5991210b0c72cfe4
4
+ data.tar.gz: 64e0ae6ded55468b21b7795bb46f432b511e6e37db3f67a863b8925949accf2a
5
5
  SHA512:
6
- metadata.gz: 48174bfed7b8afc5932c3ec2a88b608dc5734e583d86f0524d744582fc395f435bbe5628b68837ad70161905f9b834924a48a8d4598b1836460aa6d1d41f7b00
7
- data.tar.gz: 7c0bc07e13990cd02c5c92d6ee1ec8db3c347bc55c37dd0fa1a28329f6ceb970dbc7f77fa6f28b483b3fd5b291a6f32fcb2fbff09a274eaf24e99e2e51a4cf04
6
+ metadata.gz: 5bd9d64e329e2fa84a3e50bd58cfc9ef51ee4a7393acdfa05fa180c49d1b0263d53061d742970fcdfaea4ed25af1b9b480fa3906ad948b475fe432e230b393c2
7
+ data.tar.gz: f3a8168da8b123f41ff9319e6c7d9c2b8ab72a34b82809bcac17f6cd804bc41748f53bf56bf3ab184d8883c1db9e9c57253162a4280d180c4d9dd443c7482cdc
data/README.md CHANGED
@@ -52,6 +52,7 @@ The following resource accessors are available on the client:
52
52
 
53
53
  | Method | API path |
54
54
  |---|---|
55
+ | `client.clouds` | `cloud` |
55
56
  | `client.branches` | `branch` |
56
57
  | `client.categories` | `category` |
57
58
  | `client.courses` | `course` |
@@ -86,6 +86,18 @@ module Dotypos
86
86
  ResourceCollection.new(self, path)
87
87
  end
88
88
 
89
+ # Top-level clouds for this refresh token (not scoped under +cloud_id+ in the path).
90
+ # client.clouds.list
91
+ # client.clouds.get("other-cloud-id")
92
+ def clouds
93
+ @clouds ||= CloudCollection.new(self)
94
+ end
95
+
96
+ # The cloud resource for this client's +cloud_id+ (same as +clouds.get(cloud_id)+).
97
+ def current_cloud
98
+ clouds.get(cloud_id)
99
+ end
100
+
89
101
  # Makes an authenticated HTTP request. Used internally by ResourceCollection.
90
102
  #
91
103
  # @param method [Symbol] :get, :post, :patch, :put, :delete
@@ -0,0 +1,27 @@
1
+ module Dotypos
2
+ # Provides list and get operations for the Cloud resource.
3
+ #
4
+ # Clouds are top-level resources scoped to the refresh token, not to a single
5
+ # cloud. Their paths do not follow the clouds/{cloudId}/{resource} pattern
6
+ # used by ResourceCollection, so this subclass overrides the two path helpers.
7
+ #
8
+ # Usage:
9
+ # client.clouds.list # => PagedResult of all accessible clouds
10
+ # client.clouds.get("123") # => Resource for a specific cloud
11
+ # client.current_cloud # => Resource for the client's own cloud
12
+ class CloudCollection < ResourceCollection
13
+ def initialize(client)
14
+ super(client, nil)
15
+ end
16
+
17
+ private
18
+
19
+ def collection_path
20
+ "clouds"
21
+ end
22
+
23
+ def member_path(id)
24
+ "clouds/#{id}"
25
+ end
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module Dotypos
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.2.0".freeze
3
3
  end
data/lib/dotypos.rb CHANGED
@@ -7,6 +7,7 @@ require_relative "dotypos/resource"
7
7
  require_relative "dotypos/paged_result"
8
8
  require_relative "dotypos/filter_builder"
9
9
  require_relative "dotypos/resource_collection"
10
+ require_relative "dotypos/cloud_collection"
10
11
  require_relative "dotypos/client"
11
12
 
12
13
  module Dotypos
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotypos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stockbird Team
@@ -120,6 +120,7 @@ files:
120
120
  - README.md
121
121
  - lib/dotypos.rb
122
122
  - lib/dotypos/client.rb
123
+ - lib/dotypos/cloud_collection.rb
123
124
  - lib/dotypos/configuration.rb
124
125
  - lib/dotypos/errors.rb
125
126
  - lib/dotypos/filter_builder.rb