databasus_ruby 0.0.1 → 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.
@@ -4,21 +4,18 @@ module DatabasusRuby
4
4
  # Workspaces, their members and their audit trail.
5
5
  #
6
6
  # workspace = client.workspaces.create(name: "production")
7
- # client.workspaces.add_member(workspace.id, email: "ops@example.com",
8
- # role: "WORKSPACE_ADMIN")
7
+ # client.workspaces.add_member(workspace.id, email: "ops@example.com", role: "WORKSPACE_ADMIN")
9
8
  #
10
- # Note that the membership endpoints live under /workspaces/memberships/{id},
11
- # where {id} is still the workspace id.
9
+ # Members are addressed by their member id (from #members), not their user id.
12
10
  class Workspaces < Object
13
11
  include Endpoint
14
12
 
15
13
  MEMBER_ROLES = %w[WORKSPACE_OWNER WORKSPACE_ADMIN WORKSPACE_MEMBER WORKSPACE_VIEWER].freeze
16
14
 
17
15
  # GET /workspaces — the workspaces the current user belongs to.
18
- def list
19
- collection(http_get("workspaces"), key: "workspaces")
16
+ def list(limit: nil, after: nil)
17
+ collection(http_get("workspaces", { limit: limit, after: after }))
20
18
  end
21
-
22
19
  alias all list
23
20
 
24
21
  # POST /workspaces
@@ -33,8 +30,8 @@ module DatabasusRuby
33
30
  alias find get
34
31
 
35
32
  # PUT /workspaces/{id}
36
- def update(id, **attributes)
37
- object(http_put("workspaces/#{escape(id)}", attributes))
33
+ def update(id, name:)
34
+ object(http_put("workspaces/#{escape(id)}", { name: name }))
38
35
  end
39
36
 
40
37
  # DELETE /workspaces/{id}
@@ -42,40 +39,36 @@ module DatabasusRuby
42
39
  acknowledged(http_delete("workspaces/#{escape(id)}"))
43
40
  end
44
41
 
45
- # GET /workspaces/{id}/audit-logs
46
- def audit_logs(id, limit: nil, offset: nil, before_date: nil)
47
- response = http_get("workspaces/#{escape(id)}/audit-logs",
48
- { limit: limit, offset: offset, beforeDate: before_date })
49
- collection(response, key: "auditLogs")
42
+ # POST /workspaces/{id}/transfer-ownership
43
+ def transfer_ownership(id, new_owner_member_id:)
44
+ acknowledged(http_post("workspaces/#{escape(id)}/transfer-ownership", { newOwnerMemberId: new_owner_member_id }))
50
45
  end
51
46
 
52
- # GET /workspaces/memberships/{id}/members
53
- def members(id)
54
- collection(http_get("workspaces/memberships/#{escape(id)}/members"), key: "members")
47
+ # GET /audit-events
48
+ def audit_events(id, author_user_id: nil, limit: nil, after: nil)
49
+ collection(http_get("audit-events", {
50
+ workspaceId: require_id(id), authorUserId: author_user_id, limit: limit, after: after
51
+ }))
55
52
  end
56
53
 
57
- # POST /workspaces/memberships/{id}/members — adds an existing user or
58
- # invites a new one; the response `status` says which happened
59
- # (ADDED or INVITED). `role` is one of MEMBER_ROLES.
60
- def add_member(id, email:, role:)
61
- object(http_post("workspaces/memberships/#{escape(id)}/members", { email: email, role: role }))
54
+ # GET /workspace-members
55
+ def members(id, limit: nil, after: nil)
56
+ collection(http_get("workspace-members", { workspaceId: require_id(id), limit: limit, after: after }))
62
57
  end
63
58
 
64
- # DELETE /workspaces/memberships/{id}/members/{userId}
65
- def remove_member(id, user_id)
66
- acknowledged(http_delete("workspaces/memberships/#{escape(id)}/members/#{escape(user_id)}"))
59
+ # POST /workspace-members — `role` is one of MEMBER_ROLES except the owner.
60
+ def add_member(id, email:, role:)
61
+ object(http_post("workspace-members", { workspaceId: require_id(id), email: email, role: role }))
67
62
  end
68
63
 
69
- # PUT /workspaces/memberships/{id}/members/{userId}/role
70
- def change_member_role(id, user_id, role:)
71
- acknowledged(http_put("workspaces/memberships/#{escape(id)}/members/#{escape(user_id)}/role",
72
- { role: role }))
64
+ # DELETE /workspace-members/{memberId}
65
+ def remove_member(member_id)
66
+ acknowledged(http_delete("workspace-members/#{escape(member_id)}"))
73
67
  end
74
68
 
75
- # POST /workspaces/memberships/{id}/transfer-ownership
76
- def transfer_ownership(id, new_owner_email:)
77
- acknowledged(http_post("workspaces/memberships/#{escape(id)}/transfer-ownership",
78
- { newOwnerEmail: new_owner_email }))
69
+ # PUT /workspace-members/{memberId}
70
+ def change_member_role(member_id, role:)
71
+ object(http_put("workspace-members/#{escape(member_id)}", { role: role }))
79
72
  end
80
73
  end
81
74
  end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DatabasusRuby
4
+ # A payload that remembers the client it came from, so the record can reach
5
+ # the endpoints related to it:
6
+ #
7
+ # client.databases.get(id).backups(status: "COMPLETED")
8
+ #
9
+ # Plain Object stays the wrapper for nested fields and for responses that
10
+ # have nothing hanging off them; Record exists only for the payloads whose
11
+ # domain has related endpoints.
12
+ class Record < Object
13
+ attr_reader :client
14
+
15
+ def initialize(client, attributes = {})
16
+ @client = client
17
+ super(attributes)
18
+ end
19
+
20
+ private
21
+
22
+ # Related endpoints address the record by id, and the API omits empty
23
+ # fields, so a record built from a partial payload has to say so rather
24
+ # than sending a request with a nil id.
25
+ def id!
26
+ value = self["id"]
27
+ raise Error, "this #{self.class.name} has no id" if value.nil? || value.to_s.empty?
28
+
29
+ value
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module DatabasusRuby
4
+ # One database, as returned by the Databases endpoint.
5
+ #
6
+ # database = client.databases.get(id)
7
+ # database.backups(status: "COMPLETED")
8
+ # database.backup # queue a run
9
+ # database.settings.database # name of the database on its server (PostgreSQL)
10
+ #
11
+ # Both delegate to the Backups endpoint, which owns the requests.
12
+ class Database < Record
13
+ # Takes the same filters as Backups#list.
14
+ def backups(**filters)
15
+ client.backups.list(database_id: id!, **filters)
16
+ end
17
+
18
+ def backup
19
+ client.backups.create(database_id: id!)
20
+ end
21
+ end
22
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DatabasusRuby
4
- VERSION = "0.0.1"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -6,19 +6,23 @@ require_relative "databasus_ruby/version"
6
6
 
7
7
  # Ruby client for the Databasus backup-management API.
8
8
  #
9
- # client = DatabasusRuby::Client.new(api_key: ENV["DATABASUS_API_KEY"],
10
- # url: "https://databasus.example.com/api/v1/")
9
+ # client = DatabasusRuby::Client.new(url: "https://databasus.example.com/api/v1/")
10
+ # client.auth.signin(email: ENV["DATABASUS_EMAIL"], password: ENV["DATABASUS_PASSWORD"])
11
11
  # client.databases.list(workspace_id: workspace_id)
12
12
  #
13
+ # Targets the Databasus API of 3.65 and later.
14
+ #
13
15
  # See DatabasusRuby::Client for how the endpoint domains hang off the client.
14
16
  module DatabasusRuby
15
17
  autoload :Client, "databasus_ruby/client"
16
18
  autoload :Collection, "databasus_ruby/collection"
17
19
  autoload :Endpoint, "databasus_ruby/endpoint"
18
20
  autoload :Object, "databasus_ruby/object"
21
+ autoload :Record, "databasus_ruby/record"
19
22
 
20
23
  autoload :Error, "databasus_ruby/error"
21
24
  autoload :ConfigurationError, "databasus_ruby/error"
25
+ autoload :SignInCodeRequiredError, "databasus_ruby/error"
22
26
  autoload :APIError, "databasus_ruby/error"
23
27
  autoload :BadRequestError, "databasus_ruby/error"
24
28
  autoload :AuthenticationError, "databasus_ruby/error"
@@ -32,7 +36,10 @@ module DatabasusRuby
32
36
  autoload :Backups, "databasus_ruby/objects/backups"
33
37
  autoload :Databases, "databasus_ruby/objects/databases"
34
38
  autoload :Notifiers, "databasus_ruby/objects/notifiers"
39
+ autoload :Restores, "databasus_ruby/objects/restores"
35
40
  autoload :Storages, "databasus_ruby/objects/storages"
36
41
  autoload :Users, "databasus_ruby/objects/users"
37
42
  autoload :Workspaces, "databasus_ruby/objects/workspaces"
43
+
44
+ autoload :Database, "databasus_ruby/records/database"
38
45
  end
@@ -9,16 +9,30 @@ module DatabasusRuby
9
9
  class ConfigurationError < Error
10
10
  end
11
11
 
12
+ class SignInCodeRequiredError < Error
13
+ attr_reader pending_sign_in_id: String
14
+ attr_reader email: String
15
+
16
+ def initialize: (pending_sign_in_id: String, email: String) -> void
17
+ end
18
+
12
19
  class APIError < Error
13
20
  STATUS_ERRORS: Hash[Integer, singleton(APIError)]
14
21
 
15
22
  attr_reader status: Integer?
16
23
  attr_reader body: untyped
17
24
  attr_reader response: untyped
25
+ attr_reader code: String?
18
26
 
19
- def initialize: (?String? message, ?status: Integer?, ?body: untyped, ?response: untyped) -> void
20
- def self.from_response: (untyped response) -> APIError
27
+ def initialize: (?String? message, ?status: Integer?, ?body: untyped, ?response: untyped, ?code: String?) -> void
28
+ def self.from_response: (untyped response, ?body: untyped) -> APIError
21
29
  def self.for_status: (Integer status) -> singleton(APIError)
30
+
31
+ private
32
+
33
+ def self.message_from: (untyped body) -> String?
34
+ def self.problem_message: (payload problem) -> String?
35
+ def self.code_from: (untyped body) -> String?
22
36
  end
23
37
 
24
38
  class BadRequestError < APIError
@@ -43,42 +57,72 @@ module DatabasusRuby
43
57
  end
44
58
 
45
59
  class Object
46
- def initialize: (?payload attributes) -> void
60
+ def initialize: (?payload? attributes) -> void
47
61
  def to_h: () -> payload
48
- def to_hash: () -> payload
62
+ alias to_hash to_h
49
63
  def []: (String | Symbol key) -> untyped
50
64
  def key?: (String | Symbol key) -> bool
51
- def has_key?: (String | Symbol key) -> bool
65
+ alias has_key? key?
52
66
  def keys: () -> Array[String]
53
67
  def ==: (untyped other) -> bool
54
- def eql?: (untyped other) -> bool
68
+ alias eql? ==
55
69
  def hash: () -> Integer
56
70
  def inspect: () -> String
57
71
  def method_missing: (Symbol name, *untyped args) ?{ (?) -> untyped } -> untyped
58
72
  def respond_to_missing?: (Symbol name, ?bool include_private) -> bool
73
+
74
+ private
75
+
76
+ def normalize: (untyped attributes) -> payload?
77
+ def fetch_attribute: (String key) -> untyped
78
+ def wrap: (untyped value) -> untyped
79
+ def camelize: (String key) -> String
80
+ end
81
+
82
+ class Record < Object
83
+ attr_reader client: Client
84
+
85
+ def initialize: (Client client, ?payload attributes) -> void
86
+
87
+ private
88
+
89
+ def id!: () -> String
90
+ end
91
+
92
+ class Database < Record
93
+ def backups: (**untyped filters) -> Collection
94
+ def backup: () -> Object
59
95
  end
60
96
 
61
97
  class Collection
62
98
  include Enumerable[Object]
63
99
 
100
+ PAGE_KEYS: Array[String]
101
+
64
102
  attr_reader data: Array[Object]
65
- attr_reader total: Integer
66
- attr_reader limit: Integer?
67
- attr_reader offset: Integer?
103
+ attr_reader next_cursor: String?
104
+ attr_reader extras: Object
68
105
 
69
- def initialize: (?data: Array[payload | Object], ?total: Integer?, ?limit: Integer?, ?offset: Integer?) -> void
70
- def self.from: (untyped body, key: String) -> Collection
106
+ def initialize: (
107
+ ?data: Array[payload | Object],
108
+ ?next_cursor: String?,
109
+ ?extras: payload | Object,
110
+ ?wrap: (^(payload) -> Object)?
111
+ ) -> void
112
+ def self.from: (untyped body, ?wrap: (^(payload) -> Object)?) -> Collection
71
113
  def each: () { (Object) -> void } -> Collection
72
114
  | () -> Enumerator[Object, Array[Object]]
73
115
  def size: () -> Integer
74
- def length: () -> Integer
116
+ alias length size
75
117
  def empty?: () -> bool
76
118
  def []: (Integer index) -> Object?
77
119
  def last: () -> Object?
78
- def paginated?: () -> bool
79
- def next_offset: () -> Integer?
80
120
  def last_page?: () -> bool
81
121
  def inspect: () -> String
122
+
123
+ private
124
+
125
+ def self.from_page: (payload page, (^(payload) -> Object)? wrap) -> Collection
82
126
  end
83
127
 
84
128
  module Endpoint
@@ -93,26 +137,25 @@ module DatabasusRuby
93
137
  def http_post: (String path, ?payload? body, ?params: payload?) -> untyped
94
138
  def http_put: (String path, ?payload? body, ?params: payload?) -> untyped
95
139
  def http_delete: (String path, ?payload? params) -> untyped
96
- def object: (untyped response) -> Object
97
- def collection: (untyped response, key: String) -> Collection
98
- def acknowledged: (untyped response) -> bool
99
- def single_value: (untyped response) -> untyped
140
+ def object: (untyped response, ?as: singleton(Object)) -> Object
141
+ def collection: (untyped response, ?as: singleton(Object)) -> Collection
142
+ def build: (singleton(Object) klass, payload attributes) -> Object
143
+ def acknowledged: (untyped response) -> true
100
144
  def compact: (untyped body) -> untyped
101
145
  def with_default_workspace: (payload attributes) -> payload
102
146
  def escape: (untyped segment) -> String
147
+ def require_id: (untyped segment) -> String
103
148
  end
104
149
 
105
150
  class Client
106
151
  attr_reader adapter: untyped
107
152
  attr_reader url: String
108
153
  attr_accessor api_key: String?
109
- attr_accessor agent_id: String?
110
154
  attr_accessor workspace_id: String?
111
155
 
112
156
  def initialize: (
113
157
  ?api_key: String?,
114
158
  ?url: String?,
115
- ?agent_id: String?,
116
159
  ?workspace_id: String?,
117
160
  ?adapter: untyped
118
161
  ) -> void
@@ -122,11 +165,11 @@ module DatabasusRuby
122
165
  def backups: () -> Backups
123
166
  def databases: () -> Databases
124
167
  def notifiers: () -> Notifiers
168
+ def restores: () -> Restores
125
169
  def storages: () -> Storages
126
170
  def users: () -> Users
127
171
  def workspaces: () -> Workspaces
128
172
  def workspace_id!: () -> String
129
- def agent_id!: () -> String
130
173
  def request: (
131
174
  Symbol method,
132
175
  String path,
@@ -134,49 +177,69 @@ module DatabasusRuby
134
177
  ?body: untyped,
135
178
  ?headers: Hash[String, String]?
136
179
  ) -> untyped
180
+ def stream: (String path, io: _Writer, ?params: payload?) -> Integer
137
181
  def inspect: () -> String
182
+
183
+ private
184
+
185
+ def prepare: (untyped req, ?params: payload?, ?headers: Hash[String, String]?) -> untyped
186
+ def request_headers: (Hash[String, String]? extra) -> Hash[String, String]
187
+ def normalize_url: (untyped url) -> String
188
+ def stringify: (payload params) -> Hash[String, untyped]
189
+
190
+ # Private constant in Ruby (private_constant :StreamSink).
191
+ class StreamSink
192
+ attr_reader written: Integer
193
+ attr_reader error_body: String
194
+
195
+ def initialize: (_Writer io) -> void
196
+ def to_proc: () -> ^(String chunk, Integer received, untyped env) -> untyped
197
+ def decoded_error_body: () -> untyped
198
+
199
+ private
200
+
201
+ def write: (String chunk, untyped env) -> untyped
202
+ end
138
203
  end
139
204
 
140
205
  class Auth < Object
141
206
  include Endpoint
142
207
 
143
208
  def signin: (email: String, password: String, ?cloudflare_turnstile_token: String?) -> Object
209
+ def verify_sign_in_code: (String pending_sign_in_id, code: String, ?cloudflare_turnstile_token: String?) -> Object
144
210
  def signup: (email: String, name: String, password: String, ?cloudflare_turnstile_token: String?) -> Object
145
- def github_callback: (code: String, redirect_uri: String) -> Object
146
- def google_callback: (code: String, redirect_uri: String) -> Object
147
- def send_reset_password_code: (email: String, ?cloudflare_turnstile_token: String?) -> Object
148
- def reset_password: (email: String, code: String, new_password: String) -> Object
211
+ def request_password_reset: (email: String, ?cloudflare_turnstile_token: String?) -> true
212
+ def reset_password: (email: String, code: String, new_password: String) -> true
213
+
214
+ private
215
+
216
+ def authorize: (Object result) -> Object
149
217
  end
150
218
 
151
219
  class Backups < Object
152
220
  include Endpoint
153
221
 
154
222
  STATUSES: Array[String]
155
- ENCRYPTIONS: Array[String]
156
223
  VERIFICATION_STATUSES: Array[String]
157
224
 
158
225
  def list: (
159
226
  database_id: String,
160
- ?limit: Integer?,
161
- ?offset: Integer?,
162
227
  ?status: (String | Array[String])?,
163
- ?before_date: String?,
164
- ?pg_wal_backup_type: String?
165
- ) -> Collection
166
- def all: (
167
- database_id: String,
228
+ ?created_before: String?,
168
229
  ?limit: Integer?,
169
- ?offset: Integer?,
170
- ?status: (String | Array[String])?,
171
- ?before_date: String?,
172
- ?pg_wal_backup_type: String?
230
+ ?after: String?
173
231
  ) -> Collection
232
+ alias all list
233
+ def get: (String id) -> Object
234
+ alias find get
174
235
  def create: (database_id: String) -> Object
175
- def trigger: (database_id: String) -> Object
176
- def delete: (String id) -> bool
177
- def cancel: (String id) -> bool
236
+ alias trigger create
237
+ def delete: (String id) -> true
238
+ def cancel: (String id) -> Object
178
239
  def download_token: (String id) -> Object
179
240
  def file: (String id, token: String) -> String
241
+ def download_to: (String id, _Writer io) -> Object
242
+ def file_to: (String id, _Writer io, token: String) -> Integer
180
243
  def download: (String id) -> [String, String]
181
244
  end
182
245
 
@@ -184,25 +247,19 @@ module DatabasusRuby
184
247
  include Endpoint
185
248
 
186
249
  TYPES: Array[String]
187
- HEALTH_STATUSES: Array[String]
188
250
 
189
- def list: (?workspace_id: String?) -> Collection
190
- def all: (?workspace_id: String?) -> Collection
191
- def get: (String id) -> Object
192
- def find: (String id) -> Object
193
- def create: (**untyped) -> Object
194
- def update: (**untyped) -> Object
195
- def delete: (String id) -> bool
196
- def copy: (String id) -> Object
197
- def test_connection: (String id) -> bool
198
- def test_connection_direct: (**untyped) -> bool
199
- def create_readonly_user: (**untyped) -> Object
200
- def create_replication_only_user: (**untyped) -> Object
201
- def readonly: (**untyped) -> Object
202
- def readonly?: (**untyped) -> bool
203
- def notifier_databases_count: (String notifier_id) -> untyped
204
- def notifier_using?: (String notifier_id) -> bool
205
- def backups: (String id, **untyped) -> Collection
251
+ def list: (?workspace_id: String?, ?notifier_id: String?, ?limit: Integer?, ?after: String?) -> Collection
252
+ alias all list
253
+ def list_all: (?workspace_id: String?, ?limit: Integer) -> Array[Database]
254
+ def get: (String id) -> Database
255
+ alias find get
256
+ def create: (**untyped attributes) -> Database
257
+ def update: (String id, **untyped attributes) -> Database
258
+ def delete: (String id) -> true
259
+ def copy: (String id) -> Database
260
+ def test: (String id) -> Object
261
+ def connected?: (String id) -> bool
262
+ def backups: (String id, **untyped filters) -> Collection
206
263
  def backup: (String id) -> Object
207
264
  end
208
265
 
@@ -210,19 +267,45 @@ module DatabasusRuby
210
267
  include Endpoint
211
268
 
212
269
  TYPES: Array[String]
213
- NOTIFICATION_TYPES: Array[String]
214
270
 
215
- def list: (?workspace_id: String?) -> Collection
216
- def all: (?workspace_id: String?) -> Collection
271
+ def list: (?workspace_id: String?, ?limit: Integer?, ?after: String?) -> Collection
272
+ alias all list
273
+ def get: (String id) -> Object
274
+ alias find get
275
+ def create: (**untyped attributes) -> Object
276
+ def update: (String id, **untyped attributes) -> Object
277
+ def delete: (String id) -> true
278
+ def test: (String id) -> Object
279
+ def transfer: (String id, target_workspace_id: String) -> Object
280
+ end
281
+
282
+ class Restores < Object
283
+ include Endpoint
284
+
285
+ STATUSES: Array[String]
286
+ SSL_MODES: Array[String]
287
+
288
+ def self.postgresql_target: (
289
+ host: String,
290
+ port: Integer,
291
+ username: String,
292
+ password: String,
293
+ database: String,
294
+ ?ssl_mode: String,
295
+ ?cpu_count: Integer,
296
+ ?exclude_extensions: bool,
297
+ ?restore_ownership: bool,
298
+ ?restore_privileges: bool,
299
+ ?ssh_tunnel: payload?
300
+ ) -> Hash[Symbol, untyped]
301
+
302
+ def list: (backup_id: String, ?limit: Integer?, ?after: String?) -> Collection
303
+ alias all list
304
+ def start: (backup_id: String, target: payload) -> Object
305
+ alias create start
217
306
  def get: (String id) -> Object
218
- def find: (String id) -> Object
219
- def save: (**untyped) -> Object
220
- def create: (**untyped) -> Object
221
- def update: (**untyped) -> Object
222
- def delete: (String id) -> bool
223
- def test: (String id) -> bool
224
- def direct_test: (**untyped) -> bool
225
- def transfer: (String id, target_workspace_id: String) -> bool
307
+ alias find get
308
+ def cancel: (String id) -> Object
226
309
  end
227
310
 
228
311
  class Storages < Object
@@ -230,17 +313,16 @@ module DatabasusRuby
230
313
 
231
314
  TYPES: Array[String]
232
315
 
233
- def list: (?workspace_id: String?) -> Collection
234
- def all: (?workspace_id: String?) -> Collection
316
+ def list: (?workspace_id: String?, ?limit: Integer?, ?after: String?) -> Collection
317
+ alias all list
235
318
  def get: (String id) -> Object
236
- def find: (String id) -> Object
237
- def save: (**untyped) -> Object
238
- def create: (**untyped) -> Object
239
- def update: (**untyped) -> Object
240
- def delete: (String id) -> bool
241
- def test: (String id) -> bool
242
- def direct_test: (**untyped) -> bool
243
- def transfer: (String id, target_workspace_id: String) -> bool
319
+ alias find get
320
+ def create: (**untyped attributes) -> Object
321
+ def update: (String id, **untyped attributes) -> Object
322
+ def delete: (String id) -> true
323
+ def backup_usage: (String id) -> Object
324
+ def test: (String id) -> Object
325
+ def transfer: (String id, target_workspace_id: String) -> Object
244
326
  end
245
327
 
246
328
  class Users < Object
@@ -248,19 +330,17 @@ module DatabasusRuby
248
330
 
249
331
  ROLES: Array[String]
250
332
 
251
- def me: () -> Object
252
- def update_me: (?name: String?, ?email: String?) -> Object
253
- def change_password: (new_password: String) -> Object
254
- def invite: (email: String, ?intended_workspace_id: String?, ?intended_workspace_role: String?) -> Object
255
- def list: (?limit: Integer?, ?offset: Integer?, ?before_date: String?, ?query: String?) -> Collection
256
- def all: (?limit: Integer?, ?offset: Integer?, ?before_date: String?, ?query: String?) -> Collection
333
+ def list: (?query: String?, ?limit: Integer?, ?after: String?) -> Collection
334
+ alias all list
257
335
  def get: (String id) -> Object
258
- def find: (String id) -> Object
259
- def activate: (String id) -> bool
260
- def deactivate: (String id) -> bool
261
- def change_role: (String id, role: String) -> bool
336
+ alias find get
337
+ def update: (String id, name: String, email: String) -> Object
338
+ def change_password: (String id, new_password: String) -> true
339
+ def activate: (String id) -> true
340
+ def deactivate: (String id) -> true
341
+ def change_role: (String id, role: String) -> true
262
342
  def settings: () -> Object
263
- def update_settings: (**untyped) -> Object
343
+ def update_settings: (**untyped attributes) -> Object
264
344
  end
265
345
 
266
346
  class Workspaces < Object
@@ -268,18 +348,18 @@ module DatabasusRuby
268
348
 
269
349
  MEMBER_ROLES: Array[String]
270
350
 
271
- def list: () -> Collection
272
- def all: () -> Collection
351
+ def list: (?limit: Integer?, ?after: String?) -> Collection
352
+ alias all list
273
353
  def create: (name: String) -> Object
274
354
  def get: (String id) -> Object
275
- def find: (String id) -> Object
276
- def update: (String id, **untyped) -> Object
277
- def delete: (String id) -> bool
278
- def audit_logs: (String id, ?limit: Integer?, ?offset: Integer?, ?before_date: String?) -> Collection
279
- def members: (String id) -> Collection
355
+ alias find get
356
+ def update: (String id, name: String) -> Object
357
+ def delete: (String id) -> true
358
+ def transfer_ownership: (String id, new_owner_member_id: String) -> true
359
+ def audit_events: (String id, ?author_user_id: String?, ?limit: Integer?, ?after: String?) -> Collection
360
+ def members: (String id, ?limit: Integer?, ?after: String?) -> Collection
280
361
  def add_member: (String id, email: String, role: String) -> Object
281
- def remove_member: (String id, String user_id) -> bool
282
- def change_member_role: (String id, String user_id, role: String) -> bool
283
- def transfer_ownership: (String id, new_owner_email: String) -> bool
362
+ def remove_member: (String member_id) -> true
363
+ def change_member_role: (String member_id, role: String) -> Object
284
364
  end
285
365
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: databasus_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SamuelFCorrea
@@ -48,9 +48,12 @@ files:
48
48
  - lib/databasus_ruby/objects/backups.rb
49
49
  - lib/databasus_ruby/objects/databases.rb
50
50
  - lib/databasus_ruby/objects/notifiers.rb
51
+ - lib/databasus_ruby/objects/restores.rb
51
52
  - lib/databasus_ruby/objects/storages.rb
52
53
  - lib/databasus_ruby/objects/users.rb
53
54
  - lib/databasus_ruby/objects/workspaces.rb
55
+ - lib/databasus_ruby/record.rb
56
+ - lib/databasus_ruby/records/database.rb
54
57
  - lib/databasus_ruby/version.rb
55
58
  - sig/databasus_ruby.rbs
56
59
  homepage: https://github.com/SamuelFCorrea/databasus_ruby
@@ -75,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
78
  - !ruby/object:Gem::Version
76
79
  version: '0'
77
80
  requirements: []
78
- rubygems_version: 4.0.13
81
+ rubygems_version: 4.0.20
79
82
  specification_version: 4
80
83
  summary: Ruby client for the Databasus backup-management API
81
84
  test_files: []