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 +4 -4
- data/README.md +1 -0
- data/lib/dotypos/client.rb +12 -0
- data/lib/dotypos/cloud_collection.rb +27 -0
- data/lib/dotypos/version.rb +1 -1
- data/lib/dotypos.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e6ec187f846243bed448a7877ddf4c723df8ad7fd805c84b5991210b0c72cfe4
|
|
4
|
+
data.tar.gz: 64e0ae6ded55468b21b7795bb46f432b511e6e37db3f67a863b8925949accf2a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5bd9d64e329e2fa84a3e50bd58cfc9ef51ee4a7393acdfa05fa180c49d1b0263d53061d742970fcdfaea4ed25af1b9b480fa3906ad948b475fe432e230b393c2
|
|
7
|
+
data.tar.gz: f3a8168da8b123f41ff9319e6c7d9c2b8ab72a34b82809bcac17f6cd804bc41748f53bf56bf3ab184d8883c1db9e9c57253162a4280d180c4d9dd443c7482cdc
|
data/README.md
CHANGED
data/lib/dotypos/client.rb
CHANGED
|
@@ -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
|
data/lib/dotypos/version.rb
CHANGED
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.
|
|
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
|