comet_backup_ruby_sdk 0.4.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +1 -1
- data/RELEASING.md +1 -1
- data/comet_backup_ruby_sdk.gemspec +1 -1
- data/lib/comet/comet_server.rb +227 -2
- data/lib/comet/definitions.rb +5 -5
- data/lib/comet/models/admin_account_properties_response.rb +9 -0
- data/lib/comet/models/admin_email_options.rb +84 -0
- data/lib/comet/models/bucket_properties.rb +9 -0
- data/lib/comet/models/destination_config.rb +6 -0
- data/lib/comet/models/group_policy.rb +9 -0
- data/lib/comet/models/install_creds.rb +99 -0
- data/lib/comet/models/install_token.rb +117 -0
- data/lib/comet/models/install_token_response.rb +92 -0
- data/lib/comet/models/news_entry.rb +9 -0
- data/lib/comet/models/organization.rb +145 -0
- data/lib/comet/models/organization_response.rb +101 -0
- data/lib/comet/models/remote_storage_option.rb +6 -0
- data/lib/comet/models/streamable_event.rb +9 -0
- data/lib/comet/models/user_profile_config.rb +11 -0
- data/lib/comet_backup_ruby_sdk.rb +6 -0
- metadata +8 -2
@@ -14,6 +14,9 @@ module Comet
|
|
14
14
|
# NewsEntry is a typed class wrapper around the underlying Comet Server API data structure.
|
15
15
|
class NewsEntry
|
16
16
|
|
17
|
+
# @type [String] organization_id
|
18
|
+
attr_accessor :organization_id
|
19
|
+
|
17
20
|
# @type [Number] date_time
|
18
21
|
attr_accessor :date_time
|
19
22
|
|
@@ -28,6 +31,7 @@ module Comet
|
|
28
31
|
end
|
29
32
|
|
30
33
|
def clear
|
34
|
+
@organization_id = ''
|
31
35
|
@date_time = 0
|
32
36
|
@text_content = ''
|
33
37
|
@unknown_json_fields = {}
|
@@ -46,6 +50,10 @@ module Comet
|
|
46
50
|
|
47
51
|
obj.each do |k, v|
|
48
52
|
case k
|
53
|
+
when 'OrganizationID'
|
54
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
55
|
+
|
56
|
+
@organization_id = v
|
49
57
|
when 'DateTime'
|
50
58
|
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
51
59
|
|
@@ -63,6 +71,7 @@ module Comet
|
|
63
71
|
# @return [Hash] The complete object as a Ruby hash
|
64
72
|
def to_hash
|
65
73
|
ret = {}
|
74
|
+
ret['OrganizationID'] = @organization_id
|
66
75
|
ret['DateTime'] = @date_time
|
67
76
|
ret['TextContent'] = @text_content
|
68
77
|
@unknown_json_fields.each do |k, v|
|
@@ -0,0 +1,145 @@
|
|
1
|
+
#!/usr/bin/env ruby --enable-frozen-string-literal
|
2
|
+
#
|
3
|
+
# Copyright (c) 2020-2020 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
#
|
8
|
+
# frozen_string_literal: true
|
9
|
+
|
10
|
+
require 'json'
|
11
|
+
|
12
|
+
module Comet
|
13
|
+
|
14
|
+
# Organization is a typed class wrapper around the underlying Comet Server API data structure.
|
15
|
+
class Organization
|
16
|
+
|
17
|
+
# @type [String] name
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
# @type [Array<String>] hosts
|
21
|
+
attr_accessor :hosts
|
22
|
+
|
23
|
+
# @type [Comet::SoftwareBuildRoleOptions] software_build_role
|
24
|
+
attr_accessor :software_build_role
|
25
|
+
|
26
|
+
# @type [Comet::BrandingOptions] branding
|
27
|
+
attr_accessor :branding
|
28
|
+
|
29
|
+
# @type [Array<Comet::RemoteStorageOption>] remote_storage
|
30
|
+
attr_accessor :remote_storage
|
31
|
+
|
32
|
+
# @type [Hash{String => Comet::WebhookOption}] webhook_options
|
33
|
+
attr_accessor :webhook_options
|
34
|
+
|
35
|
+
# @type [Comet::AdminEmailOptions] email
|
36
|
+
attr_accessor :email
|
37
|
+
|
38
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
39
|
+
attr_accessor :unknown_json_fields
|
40
|
+
|
41
|
+
def initialize
|
42
|
+
clear
|
43
|
+
end
|
44
|
+
|
45
|
+
def clear
|
46
|
+
@name = ''
|
47
|
+
@hosts = []
|
48
|
+
@software_build_role = Comet::SoftwareBuildRoleOptions.new
|
49
|
+
@branding = Comet::BrandingOptions.new
|
50
|
+
@remote_storage = []
|
51
|
+
@webhook_options = {}
|
52
|
+
@email = Comet::AdminEmailOptions.new
|
53
|
+
@unknown_json_fields = {}
|
54
|
+
end
|
55
|
+
|
56
|
+
# @param [String] json_string The complete object in JSON format
|
57
|
+
def from_json(json_string)
|
58
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
59
|
+
|
60
|
+
from_hash(JSON.parse(json_string))
|
61
|
+
end
|
62
|
+
|
63
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
64
|
+
def from_hash(obj)
|
65
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
66
|
+
|
67
|
+
obj.each do |k, v|
|
68
|
+
case k
|
69
|
+
when 'Name'
|
70
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
71
|
+
|
72
|
+
@name = v
|
73
|
+
when 'Hosts'
|
74
|
+
if v.nil?
|
75
|
+
@hosts = []
|
76
|
+
else
|
77
|
+
@hosts = Array.new(v.length)
|
78
|
+
v.each_with_index do |v1, i1|
|
79
|
+
raise TypeError "'v1' expected String, got #{v1.class}" unless v1.is_a? String
|
80
|
+
|
81
|
+
@hosts[i1] = v1
|
82
|
+
end
|
83
|
+
end
|
84
|
+
when 'SoftwareBuildRole'
|
85
|
+
@software_build_role = Comet::SoftwareBuildRoleOptions.new
|
86
|
+
@software_build_role.from_hash(v)
|
87
|
+
when 'Branding'
|
88
|
+
@branding = Comet::BrandingOptions.new
|
89
|
+
@branding.from_hash(v)
|
90
|
+
when 'RemoteStorage'
|
91
|
+
if v.nil?
|
92
|
+
@remote_storage = []
|
93
|
+
else
|
94
|
+
@remote_storage = Array.new(v.length)
|
95
|
+
v.each_with_index do |v1, i1|
|
96
|
+
@remote_storage[i1] = Comet::RemoteStorageOption.new
|
97
|
+
@remote_storage[i1].from_hash(v1)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
when 'WebhookOptions'
|
101
|
+
@webhook_options = {}
|
102
|
+
if v.nil?
|
103
|
+
@webhook_options = {}
|
104
|
+
else
|
105
|
+
v.each do |k1, v1|
|
106
|
+
@webhook_options[k1] = Comet::WebhookOption.new
|
107
|
+
@webhook_options[k1].from_hash(v1)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
when 'Email'
|
111
|
+
@email = Comet::AdminEmailOptions.new
|
112
|
+
@email.from_hash(v)
|
113
|
+
else
|
114
|
+
@unknown_json_fields[k] = v
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
# @return [Hash] The complete object as a Ruby hash
|
120
|
+
def to_hash
|
121
|
+
ret = {}
|
122
|
+
ret['Name'] = @name
|
123
|
+
ret['Hosts'] = @hosts
|
124
|
+
ret['SoftwareBuildRole'] = @software_build_role
|
125
|
+
ret['Branding'] = @branding
|
126
|
+
ret['RemoteStorage'] = @remote_storage
|
127
|
+
ret['WebhookOptions'] = @webhook_options
|
128
|
+
ret['Email'] = @email
|
129
|
+
@unknown_json_fields.each do |k, v|
|
130
|
+
ret[k] = v
|
131
|
+
end
|
132
|
+
ret
|
133
|
+
end
|
134
|
+
|
135
|
+
# @return [Hash] The complete object as a Ruby hash
|
136
|
+
def to_h
|
137
|
+
to_hash
|
138
|
+
end
|
139
|
+
|
140
|
+
# @return [String] The complete object as a JSON string
|
141
|
+
def to_json(options = {})
|
142
|
+
to_hash.to_json(options)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
#!/usr/bin/env ruby --enable-frozen-string-literal
|
2
|
+
#
|
3
|
+
# Copyright (c) 2020-2020 Comet Licensing Ltd.
|
4
|
+
# Please see the LICENSE file for usage information.
|
5
|
+
#
|
6
|
+
# SPDX-License-Identifier: MIT
|
7
|
+
#
|
8
|
+
# frozen_string_literal: true
|
9
|
+
|
10
|
+
require 'json'
|
11
|
+
|
12
|
+
module Comet
|
13
|
+
|
14
|
+
# OrganizationResponse is a typed class wrapper around the underlying Comet Server API data structure.
|
15
|
+
class OrganizationResponse
|
16
|
+
|
17
|
+
# @type [Number] status
|
18
|
+
attr_accessor :status
|
19
|
+
|
20
|
+
# @type [String] message
|
21
|
+
attr_accessor :message
|
22
|
+
|
23
|
+
# @type [String] id
|
24
|
+
attr_accessor :id
|
25
|
+
|
26
|
+
# @type [Comet::Organization] organization
|
27
|
+
attr_accessor :organization
|
28
|
+
|
29
|
+
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
30
|
+
attr_accessor :unknown_json_fields
|
31
|
+
|
32
|
+
def initialize
|
33
|
+
clear
|
34
|
+
end
|
35
|
+
|
36
|
+
def clear
|
37
|
+
@status = 0
|
38
|
+
@message = ''
|
39
|
+
@id = ''
|
40
|
+
@organization = Comet::Organization.new
|
41
|
+
@unknown_json_fields = {}
|
42
|
+
end
|
43
|
+
|
44
|
+
# @param [String] json_string The complete object in JSON format
|
45
|
+
def from_json(json_string)
|
46
|
+
raise TypeError "'json_string' expected String, got #{json_string.class}" unless json_string.is_a? String
|
47
|
+
|
48
|
+
from_hash(JSON.parse(json_string))
|
49
|
+
end
|
50
|
+
|
51
|
+
# @param [Hash] obj The complete object as a Ruby hash
|
52
|
+
def from_hash(obj)
|
53
|
+
raise TypeError "'obj' expected Hash, got #{obj.class}" unless obj.is_a? Hash
|
54
|
+
|
55
|
+
obj.each do |k, v|
|
56
|
+
case k
|
57
|
+
when 'Status'
|
58
|
+
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
59
|
+
|
60
|
+
@status = v
|
61
|
+
when 'Message'
|
62
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
63
|
+
|
64
|
+
@message = v
|
65
|
+
when 'ID'
|
66
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
67
|
+
|
68
|
+
@id = v
|
69
|
+
when 'Organization'
|
70
|
+
@organization = Comet::Organization.new
|
71
|
+
@organization.from_hash(v)
|
72
|
+
else
|
73
|
+
@unknown_json_fields[k] = v
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# @return [Hash] The complete object as a Ruby hash
|
79
|
+
def to_hash
|
80
|
+
ret = {}
|
81
|
+
ret['Status'] = @status
|
82
|
+
ret['Message'] = @message
|
83
|
+
ret['ID'] = @id
|
84
|
+
ret['Organization'] = @organization
|
85
|
+
@unknown_json_fields.each do |k, v|
|
86
|
+
ret[k] = v
|
87
|
+
end
|
88
|
+
ret
|
89
|
+
end
|
90
|
+
|
91
|
+
# @return [Hash] The complete object as a Ruby hash
|
92
|
+
def to_h
|
93
|
+
to_hash
|
94
|
+
end
|
95
|
+
|
96
|
+
# @return [String] The complete object as a JSON string
|
97
|
+
def to_json(options = {})
|
98
|
+
to_hash.to_json(options)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -44,6 +44,9 @@ module Comet
|
|
44
44
|
# @type [Number] storage_limit_bytes
|
45
45
|
attr_accessor :storage_limit_bytes
|
46
46
|
|
47
|
+
# @type [Boolean] rebrand_storage
|
48
|
+
attr_accessor :rebrand_storage
|
49
|
+
|
47
50
|
# @type [Hash] Hidden storage to preserve future properties for non-destructive roundtrip operations
|
48
51
|
attr_accessor :unknown_json_fields
|
49
52
|
|
@@ -112,6 +115,8 @@ module Comet
|
|
112
115
|
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
113
116
|
|
114
117
|
@storage_limit_bytes = v
|
118
|
+
when 'RebrandStorage'
|
119
|
+
@rebrand_storage = v
|
115
120
|
else
|
116
121
|
@unknown_json_fields[k] = v
|
117
122
|
end
|
@@ -143,6 +148,7 @@ module Comet
|
|
143
148
|
end
|
144
149
|
ret['StorageLimitEnabled'] = @storage_limit_enabled
|
145
150
|
ret['StorageLimitBytes'] = @storage_limit_bytes
|
151
|
+
ret['RebrandStorage'] = @rebrand_storage
|
146
152
|
@unknown_json_fields.each do |k, v|
|
147
153
|
ret[k] = v
|
148
154
|
end
|
@@ -14,6 +14,9 @@ module Comet
|
|
14
14
|
# StreamableEvent is a typed class wrapper around the underlying Comet Server API data structure.
|
15
15
|
class StreamableEvent
|
16
16
|
|
17
|
+
# @type [String] owner_organization_id
|
18
|
+
attr_accessor :owner_organization_id
|
19
|
+
|
17
20
|
# @type [Number] type
|
18
21
|
attr_accessor :type
|
19
22
|
|
@@ -28,6 +31,7 @@ module Comet
|
|
28
31
|
end
|
29
32
|
|
30
33
|
def clear
|
34
|
+
@owner_organization_id = ''
|
31
35
|
@type = 0
|
32
36
|
@unknown_json_fields = {}
|
33
37
|
end
|
@@ -45,6 +49,10 @@ module Comet
|
|
45
49
|
|
46
50
|
obj.each do |k, v|
|
47
51
|
case k
|
52
|
+
when 'OwnerOrganizationID'
|
53
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
54
|
+
|
55
|
+
@owner_organization_id = v
|
48
56
|
when 'Type'
|
49
57
|
raise TypeError "'v' expected Numeric, got #{v.class}" unless v.is_a? Numeric
|
50
58
|
|
@@ -60,6 +68,7 @@ module Comet
|
|
60
68
|
# @return [Hash] The complete object as a Ruby hash
|
61
69
|
def to_hash
|
62
70
|
ret = {}
|
71
|
+
ret['OwnerOrganizationID'] = @owner_organization_id
|
63
72
|
ret['Type'] = @type
|
64
73
|
ret['Data'] = @data
|
65
74
|
@unknown_json_fields.each do |k, v|
|
@@ -26,6 +26,9 @@ module Comet
|
|
26
26
|
# @type [String] language_code
|
27
27
|
attr_accessor :language_code
|
28
28
|
|
29
|
+
# @type [String] organization_id
|
30
|
+
attr_accessor :organization_id
|
31
|
+
|
29
32
|
# @type [Array<String>] emails
|
30
33
|
attr_accessor :emails
|
31
34
|
|
@@ -107,6 +110,7 @@ module Comet
|
|
107
110
|
@account_name = ''
|
108
111
|
@local_timezone = ''
|
109
112
|
@language_code = ''
|
113
|
+
@organization_id = ''
|
110
114
|
@emails = []
|
111
115
|
@override_email_settings = {}
|
112
116
|
@destinations = {}
|
@@ -156,6 +160,10 @@ module Comet
|
|
156
160
|
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
157
161
|
|
158
162
|
@language_code = v
|
163
|
+
when 'OrganizationID'
|
164
|
+
raise TypeError "'v' expected String, got #{v.class}" unless v.is_a? String
|
165
|
+
|
166
|
+
@organization_id = v
|
159
167
|
when 'Emails'
|
160
168
|
if v.nil?
|
161
169
|
@emails = []
|
@@ -285,6 +293,9 @@ module Comet
|
|
285
293
|
ret['AccountName'] = @account_name
|
286
294
|
ret['LocalTimezone'] = @local_timezone
|
287
295
|
ret['LanguageCode'] = @language_code
|
296
|
+
unless @organization_id.nil?
|
297
|
+
ret['OrganizationID'] = @organization_id
|
298
|
+
end
|
288
299
|
ret['Emails'] = @emails
|
289
300
|
ret['OverrideEmailSettings'] = @override_email_settings
|
290
301
|
ret['SendEmailReports'] = @send_email_reports
|
@@ -12,6 +12,7 @@ require_relative 'comet/comet_server'
|
|
12
12
|
require_relative 'comet/definitions'
|
13
13
|
require_relative 'comet/models/add_bucket_response_message'
|
14
14
|
require_relative 'comet/models/admin_account_properties_response'
|
15
|
+
require_relative 'comet/models/admin_email_options'
|
15
16
|
require_relative 'comet/models/admin_resource_response'
|
16
17
|
require_relative 'comet/models/admin_security_options'
|
17
18
|
require_relative 'comet/models/admin_u2fregistration'
|
@@ -64,6 +65,9 @@ require_relative 'comet/models/get_profile_and_hash_response_message'
|
|
64
65
|
require_relative 'comet/models/get_profile_hash_response_message'
|
65
66
|
require_relative 'comet/models/group_policy'
|
66
67
|
require_relative 'comet/models/hyper_vmachine_info'
|
68
|
+
require_relative 'comet/models/install_creds'
|
69
|
+
require_relative 'comet/models/install_token'
|
70
|
+
require_relative 'comet/models/install_token_response'
|
67
71
|
require_relative 'comet/models/job_entry'
|
68
72
|
require_relative 'comet/models/live_user_connection'
|
69
73
|
require_relative 'comet/models/local_destination_location'
|
@@ -71,6 +75,8 @@ require_relative 'comet/models/mac_oscode_sign_properties'
|
|
71
75
|
require_relative 'comet/models/mongo_dbconnection'
|
72
76
|
require_relative 'comet/models/new_bucket_detail'
|
73
77
|
require_relative 'comet/models/news_entry'
|
78
|
+
require_relative 'comet/models/organization'
|
79
|
+
require_relative 'comet/models/organization_response'
|
74
80
|
require_relative 'comet/models/osinfo'
|
75
81
|
require_relative 'comet/models/partition'
|
76
82
|
require_relative 'comet/models/private_branding_properties'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comet_backup_ruby_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Comet Licensing Ltd.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- lib/comet/definitions.rb
|
88
88
|
- lib/comet/models/add_bucket_response_message.rb
|
89
89
|
- lib/comet/models/admin_account_properties_response.rb
|
90
|
+
- lib/comet/models/admin_email_options.rb
|
90
91
|
- lib/comet/models/admin_resource_response.rb
|
91
92
|
- lib/comet/models/admin_security_options.rb
|
92
93
|
- lib/comet/models/admin_u2fregistration.rb
|
@@ -139,6 +140,9 @@ files:
|
|
139
140
|
- lib/comet/models/get_profile_hash_response_message.rb
|
140
141
|
- lib/comet/models/group_policy.rb
|
141
142
|
- lib/comet/models/hyper_vmachine_info.rb
|
143
|
+
- lib/comet/models/install_creds.rb
|
144
|
+
- lib/comet/models/install_token.rb
|
145
|
+
- lib/comet/models/install_token_response.rb
|
142
146
|
- lib/comet/models/job_entry.rb
|
143
147
|
- lib/comet/models/live_user_connection.rb
|
144
148
|
- lib/comet/models/local_destination_location.rb
|
@@ -146,6 +150,8 @@ files:
|
|
146
150
|
- lib/comet/models/mongo_dbconnection.rb
|
147
151
|
- lib/comet/models/new_bucket_detail.rb
|
148
152
|
- lib/comet/models/news_entry.rb
|
153
|
+
- lib/comet/models/organization.rb
|
154
|
+
- lib/comet/models/organization_response.rb
|
149
155
|
- lib/comet/models/osinfo.rb
|
150
156
|
- lib/comet/models/partition.rb
|
151
157
|
- lib/comet/models/private_branding_properties.rb
|