cloudsmith-api 2.0.26 → 2.0.27

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.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +24 -5
  4. data/build.json +1 -1
  5. data/docs/AlpinePackageUpload.md +2 -0
  6. data/docs/CargoPackageUpload.md +2 -0
  7. data/docs/CocoapodsPackageUpload.md +2 -0
  8. data/docs/ComposerPackageUpload.md +2 -0
  9. data/docs/ConanPackageUpload.md +2 -0
  10. data/docs/CondaPackageUpload.md +2 -0
  11. data/docs/ConnectedRepository.md +12 -0
  12. data/docs/ConnectedRepositoryRequest.md +10 -0
  13. data/docs/ConnectedRepositoryRequestPatch.md +10 -0
  14. data/docs/CranPackageUpload.md +2 -0
  15. data/docs/DartPackageUpload.md +2 -0
  16. data/docs/DebPackageUpload.md +2 -0
  17. data/docs/DockerPackageUpload.md +2 -0
  18. data/docs/EntitlementsApi.md +2 -0
  19. data/docs/GenericPackageUpload.md +2 -0
  20. data/docs/GoPackageUpload.md +2 -0
  21. data/docs/HelmPackageUpload.md +2 -0
  22. data/docs/HexPackageUpload.md +2 -0
  23. data/docs/HuggingfacePackageUpload.md +2 -0
  24. data/docs/InlineResponse2001.md +1 -1
  25. data/docs/InlineResponse2002.md +8 -0
  26. data/docs/LuarocksPackageUpload.md +2 -0
  27. data/docs/MavenPackageUpload.md +2 -0
  28. data/docs/McpPackageUpload.md +2 -0
  29. data/docs/MemberTeams.md +10 -0
  30. data/docs/NpmPackageUpload.md +2 -0
  31. data/docs/NugetPackageUpload.md +2 -0
  32. data/docs/OrganizationCustomDomainNestedRepo.md +9 -0
  33. data/docs/OrganizationCustomDomains.md +25 -0
  34. data/docs/OrganizationMembership.md +1 -0
  35. data/docs/OrgsApi.md +65 -0
  36. data/docs/P2PackageUpload.md +2 -0
  37. data/docs/Package.md +2 -0
  38. data/docs/PackageCopy.md +2 -0
  39. data/docs/PackageMove.md +2 -0
  40. data/docs/PackageQuarantine.md +2 -0
  41. data/docs/PackageResync.md +2 -0
  42. data/docs/PackageStatus.md +1 -0
  43. data/docs/PackageTag.md +2 -0
  44. data/docs/PythonPackageUpload.md +2 -0
  45. data/docs/RawPackageUpload.md +2 -0
  46. data/docs/RecycleBinApi.md +24 -24
  47. data/docs/ReposApi.md +592 -1
  48. data/docs/Repository.md +1 -0
  49. data/docs/RepositoryCreate.md +1 -0
  50. data/docs/RepositoryCreateRequest.md +1 -0
  51. data/docs/RepositoryEd25519Key.md +13 -0
  52. data/docs/RepositoryEd25519KeyCreate.md +9 -0
  53. data/docs/RepositoryRequestPatch.md +1 -0
  54. data/docs/RpmPackageUpload.md +2 -0
  55. data/docs/RubyPackageUpload.md +2 -0
  56. data/docs/ServiceTeams.md +1 -0
  57. data/docs/SwiftPackageUpload.md +2 -0
  58. data/docs/TerraformPackageUpload.md +2 -0
  59. data/docs/UserApi.md +2 -2
  60. data/docs/VagrantPackageUpload.md +2 -0
  61. data/docs/VsxPackageUpload.md +2 -0
  62. data/lib/cloudsmith-api/api/entitlements_api.rb +3 -0
  63. data/lib/cloudsmith-api/api/orgs_api.rb +60 -0
  64. data/lib/cloudsmith-api/api/recycle_bin_api.rb +41 -41
  65. data/lib/cloudsmith-api/api/repos_api.rb +579 -2
  66. data/lib/cloudsmith-api/api/user_api.rb +3 -3
  67. data/lib/cloudsmith-api/models/alpine_package_upload.rb +20 -1
  68. data/lib/cloudsmith-api/models/cargo_package_upload.rb +20 -1
  69. data/lib/cloudsmith-api/models/cocoapods_package_upload.rb +20 -1
  70. data/lib/cloudsmith-api/models/composer_package_upload.rb +20 -1
  71. data/lib/cloudsmith-api/models/conan_package_upload.rb +20 -1
  72. data/lib/cloudsmith-api/models/conda_package_upload.rb +20 -1
  73. data/lib/cloudsmith-api/models/connected_repository.rb +230 -0
  74. data/lib/cloudsmith-api/models/connected_repository_request.rb +211 -0
  75. data/lib/cloudsmith-api/models/connected_repository_request_patch.rb +206 -0
  76. data/lib/cloudsmith-api/models/cran_package_upload.rb +20 -1
  77. data/lib/cloudsmith-api/models/dart_package_upload.rb +20 -1
  78. data/lib/cloudsmith-api/models/deb_package_upload.rb +20 -1
  79. data/lib/cloudsmith-api/models/docker_package_upload.rb +20 -1
  80. data/lib/cloudsmith-api/models/generic_package_upload.rb +20 -1
  81. data/lib/cloudsmith-api/models/go_package_upload.rb +20 -1
  82. data/lib/cloudsmith-api/models/helm_package_upload.rb +20 -1
  83. data/lib/cloudsmith-api/models/hex_package_upload.rb +20 -1
  84. data/lib/cloudsmith-api/models/huggingface_package_upload.rb +20 -1
  85. data/lib/cloudsmith-api/models/inline_response_200_1.rb +1 -1
  86. data/lib/cloudsmith-api/models/inline_response_200_2.rb +191 -0
  87. data/lib/cloudsmith-api/models/luarocks_package_upload.rb +20 -1
  88. data/lib/cloudsmith-api/models/maven_package_upload.rb +20 -1
  89. data/lib/cloudsmith-api/models/mcp_package_upload.rb +20 -1
  90. data/lib/cloudsmith-api/models/member_teams.rb +238 -0
  91. data/lib/cloudsmith-api/models/npm_package_upload.rb +20 -1
  92. data/lib/cloudsmith-api/models/nuget_package_upload.rb +20 -1
  93. data/lib/cloudsmith-api/models/organization_custom_domain_nested_repo.rb +195 -0
  94. data/lib/cloudsmith-api/models/organization_custom_domains.rb +355 -0
  95. data/lib/cloudsmith-api/models/organization_membership.rb +12 -1
  96. data/lib/cloudsmith-api/models/p2_package_upload.rb +20 -1
  97. data/lib/cloudsmith-api/models/package.rb +20 -1
  98. data/lib/cloudsmith-api/models/package_copy.rb +20 -1
  99. data/lib/cloudsmith-api/models/package_move.rb +20 -1
  100. data/lib/cloudsmith-api/models/package_quarantine.rb +20 -1
  101. data/lib/cloudsmith-api/models/package_resync.rb +20 -1
  102. data/lib/cloudsmith-api/models/package_status.rb +10 -1
  103. data/lib/cloudsmith-api/models/package_tag.rb +20 -1
  104. data/lib/cloudsmith-api/models/python_package_upload.rb +20 -1
  105. data/lib/cloudsmith-api/models/raw_package_upload.rb +20 -1
  106. data/lib/cloudsmith-api/models/repository.rb +11 -1
  107. data/lib/cloudsmith-api/models/repository_create.rb +11 -1
  108. data/lib/cloudsmith-api/models/repository_create_request.rb +11 -1
  109. data/lib/cloudsmith-api/models/repository_ed25519_key.rb +233 -0
  110. data/lib/cloudsmith-api/models/repository_ed25519_key_create.rb +200 -0
  111. data/lib/cloudsmith-api/models/repository_request_patch.rb +11 -1
  112. data/lib/cloudsmith-api/models/rpm_package_upload.rb +20 -1
  113. data/lib/cloudsmith-api/models/ruby_package_upload.rb +20 -1
  114. data/lib/cloudsmith-api/models/service_teams.rb +11 -1
  115. data/lib/cloudsmith-api/models/swift_package_upload.rb +20 -1
  116. data/lib/cloudsmith-api/models/terraform_package_upload.rb +20 -1
  117. data/lib/cloudsmith-api/models/vagrant_package_upload.rb +20 -1
  118. data/lib/cloudsmith-api/models/vsx_package_upload.rb +20 -1
  119. data/lib/cloudsmith-api/version.rb +1 -1
  120. data/lib/cloudsmith-api.rb +9 -0
  121. data/spec/api/entitlements_api_spec.rb +1 -0
  122. data/spec/api/orgs_api_spec.rb +14 -0
  123. data/spec/api/recycle_bin_api_spec.rb +12 -12
  124. data/spec/api/repos_api_spec.rb +128 -1
  125. data/spec/api/user_api_spec.rb +1 -1
  126. data/spec/models/alpine_package_upload_spec.rb +12 -0
  127. data/spec/models/cargo_package_upload_spec.rb +12 -0
  128. data/spec/models/cocoapods_package_upload_spec.rb +12 -0
  129. data/spec/models/composer_package_upload_spec.rb +12 -0
  130. data/spec/models/conan_package_upload_spec.rb +12 -0
  131. data/spec/models/conda_package_upload_spec.rb +12 -0
  132. data/spec/models/connected_repository_request_patch_spec.rb +53 -0
  133. data/spec/models/connected_repository_request_spec.rb +53 -0
  134. data/spec/models/connected_repository_spec.rb +65 -0
  135. data/spec/models/cran_package_upload_spec.rb +12 -0
  136. data/spec/models/dart_package_upload_spec.rb +12 -0
  137. data/spec/models/deb_package_upload_spec.rb +12 -0
  138. data/spec/models/docker_package_upload_spec.rb +12 -0
  139. data/spec/models/generic_package_upload_spec.rb +12 -0
  140. data/spec/models/go_package_upload_spec.rb +12 -0
  141. data/spec/models/helm_package_upload_spec.rb +12 -0
  142. data/spec/models/hex_package_upload_spec.rb +12 -0
  143. data/spec/models/huggingface_package_upload_spec.rb +12 -0
  144. data/spec/models/inline_response_200_2_spec.rb +41 -0
  145. data/spec/models/luarocks_package_upload_spec.rb +12 -0
  146. data/spec/models/maven_package_upload_spec.rb +12 -0
  147. data/spec/models/mcp_package_upload_spec.rb +12 -0
  148. data/spec/models/member_teams_spec.rb +57 -0
  149. data/spec/models/npm_package_upload_spec.rb +12 -0
  150. data/spec/models/nuget_package_upload_spec.rb +12 -0
  151. data/spec/models/organization_custom_domain_nested_repo_spec.rb +47 -0
  152. data/spec/models/organization_custom_domains_spec.rb +143 -0
  153. data/spec/models/organization_membership_spec.rb +6 -0
  154. data/spec/models/p2_package_upload_spec.rb +12 -0
  155. data/spec/models/package_copy_spec.rb +12 -0
  156. data/spec/models/package_move_spec.rb +12 -0
  157. data/spec/models/package_quarantine_spec.rb +12 -0
  158. data/spec/models/package_resync_spec.rb +12 -0
  159. data/spec/models/package_spec.rb +12 -0
  160. data/spec/models/package_status_spec.rb +6 -0
  161. data/spec/models/package_tag_spec.rb +12 -0
  162. data/spec/models/python_package_upload_spec.rb +12 -0
  163. data/spec/models/raw_package_upload_spec.rb +12 -0
  164. data/spec/models/repository_create_request_spec.rb +6 -0
  165. data/spec/models/repository_create_spec.rb +6 -0
  166. data/spec/models/repository_ed25519_key_create_spec.rb +47 -0
  167. data/spec/models/repository_ed25519_key_spec.rb +71 -0
  168. data/spec/models/repository_request_patch_spec.rb +6 -0
  169. data/spec/models/repository_spec.rb +6 -0
  170. data/spec/models/rpm_package_upload_spec.rb +12 -0
  171. data/spec/models/ruby_package_upload_spec.rb +12 -0
  172. data/spec/models/service_teams_spec.rb +6 -0
  173. data/spec/models/swift_package_upload_spec.rb +12 -0
  174. data/spec/models/terraform_package_upload_spec.rb +12 -0
  175. data/spec/models/vagrant_package_upload_spec.rb +12 -0
  176. data/spec/models/vsx_package_upload_spec.rb +12 -0
  177. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/autotest-fsevent-0.3.2/gem_make.out +1 -1
  178. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/bigdecimal-4.1.2/gem_make.out +2 -2
  179. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/bigdecimal-4.1.2/mkmf.log +4 -4
  180. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.17.4/gem_make.out +2 -2
  181. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/ffi-1.17.4/mkmf.log +1 -1
  182. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.7.6/gem_make.out +2 -2
  183. data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/json-2.7.6/mkmf.log +1 -1
  184. data/vendor/bundle/ruby/2.6.0/gems/bigdecimal-4.1.2/ext/bigdecimal/Makefile +2 -2
  185. data/vendor/bundle/ruby/2.6.0/gems/ffi-1.17.4/ext/ffi_c/Makefile +2 -2
  186. data/vendor/bundle/ruby/2.6.0/gems/json-2.7.6/ext/json/ext/generator/Makefile +2 -2
  187. data/vendor/bundle/ruby/2.6.0/gems/json-2.7.6/ext/json/ext/parser/Makefile +2 -2
  188. metadata +41 -5
@@ -0,0 +1,230 @@
1
+ =begin
2
+ #Cloudsmith API (v1)
3
+
4
+ #The API to the Cloudsmith Service
5
+
6
+ OpenAPI spec version: v1
7
+ Contact: support@cloudsmith.io
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.50
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudsmithApi
16
+ class ConnectedRepository
17
+ # The date and time when the connection was created.
18
+ attr_accessor :created_at
19
+
20
+ attr_accessor :is_active
21
+
22
+ # Repositories are checked in ascending order (starting at 1). If multiple repositories have the same priority, the oldest one is used first.
23
+ attr_accessor :priority
24
+
25
+ attr_accessor :slug_perm
26
+
27
+ # The slug of the target repository to connect to.
28
+ attr_accessor :target_repository
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'created_at' => :'created_at',
34
+ :'is_active' => :'is_active',
35
+ :'priority' => :'priority',
36
+ :'slug_perm' => :'slug_perm',
37
+ :'target_repository' => :'target_repository'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'created_at' => :'DateTime',
45
+ :'is_active' => :'BOOLEAN',
46
+ :'priority' => :'Integer',
47
+ :'slug_perm' => :'String',
48
+ :'target_repository' => :'String'
49
+ }
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ return unless attributes.is_a?(Hash)
56
+
57
+ # convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
59
+
60
+ if attributes.has_key?(:'created_at')
61
+ self.created_at = attributes[:'created_at']
62
+ end
63
+
64
+ if attributes.has_key?(:'is_active')
65
+ self.is_active = attributes[:'is_active']
66
+ else
67
+ self.is_active = true
68
+ end
69
+
70
+ if attributes.has_key?(:'priority')
71
+ self.priority = attributes[:'priority']
72
+ end
73
+
74
+ if attributes.has_key?(:'slug_perm')
75
+ self.slug_perm = attributes[:'slug_perm']
76
+ end
77
+
78
+ if attributes.has_key?(:'target_repository')
79
+ self.target_repository = attributes[:'target_repository']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ if @target_repository.nil?
88
+ invalid_properties.push('invalid value for "target_repository", target_repository cannot be nil.')
89
+ end
90
+
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ return false if @target_repository.nil?
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ created_at == o.created_at &&
107
+ is_active == o.is_active &&
108
+ priority == o.priority &&
109
+ slug_perm == o.slug_perm &&
110
+ target_repository == o.target_repository
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Fixnum] Hash code
121
+ def hash
122
+ [created_at, is_active, priority, slug_perm, target_repository].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ self.class.swagger_types.each_pair do |key, type|
131
+ if type =~ /\AArray<(.*)>/i
132
+ # check to ensure the input is an array given that the attribute
133
+ # is documented as an array but the input is not
134
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
135
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
136
+ end
137
+ elsif !attributes[self.class.attribute_map[key]].nil?
138
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
139
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
140
+ end
141
+
142
+ self
143
+ end
144
+
145
+ # Deserializes the data based on type
146
+ # @param string type Data type
147
+ # @param string value Value to be deserialized
148
+ # @return [Object] Deserialized data
149
+ def _deserialize(type, value)
150
+ case type.to_sym
151
+ when :DateTime
152
+ DateTime.parse(value)
153
+ when :Date
154
+ Date.parse(value)
155
+ when :String
156
+ value.to_s
157
+ when :Integer
158
+ value.to_i
159
+ when :Float
160
+ value.to_f
161
+ when :BOOLEAN
162
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
163
+ true
164
+ else
165
+ false
166
+ end
167
+ when :Object
168
+ # generic object (usually a Hash), return directly
169
+ value
170
+ when /\AArray<(?<inner_type>.+)>\z/
171
+ inner_type = Regexp.last_match[:inner_type]
172
+ value.map { |v| _deserialize(inner_type, v) }
173
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
174
+ k_type = Regexp.last_match[:k_type]
175
+ v_type = Regexp.last_match[:v_type]
176
+ {}.tap do |hash|
177
+ value.each do |k, v|
178
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
+ end
180
+ end
181
+ else # model
182
+ temp_model = CloudsmithApi.const_get(type).new
183
+ temp_model.build_from_hash(value)
184
+ end
185
+ end
186
+
187
+ # Returns the string representation of the object
188
+ # @return [String] String presentation of the object
189
+ def to_s
190
+ to_hash.to_s
191
+ end
192
+
193
+ # to_body is an alias to to_hash (backward compatibility)
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_body
196
+ to_hash
197
+ end
198
+
199
+ # Returns the object in the form of hash
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_hash
202
+ hash = {}
203
+ self.class.attribute_map.each_pair do |attr, param|
204
+ value = self.send(attr)
205
+ next if value.nil?
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+
229
+ end
230
+ end
@@ -0,0 +1,211 @@
1
+ =begin
2
+ #Cloudsmith API (v1)
3
+
4
+ #The API to the Cloudsmith Service
5
+
6
+ OpenAPI spec version: v1
7
+ Contact: support@cloudsmith.io
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.50
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudsmithApi
16
+ class ConnectedRepositoryRequest
17
+ attr_accessor :is_active
18
+
19
+ # Repositories are checked in ascending order (starting at 1). If multiple repositories have the same priority, the oldest one is used first.
20
+ attr_accessor :priority
21
+
22
+ # The slug of the target repository to connect to.
23
+ attr_accessor :target_repository
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'is_active' => :'is_active',
29
+ :'priority' => :'priority',
30
+ :'target_repository' => :'target_repository'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'is_active' => :'BOOLEAN',
38
+ :'priority' => :'Integer',
39
+ :'target_repository' => :'String'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
50
+
51
+ if attributes.has_key?(:'is_active')
52
+ self.is_active = attributes[:'is_active']
53
+ else
54
+ self.is_active = true
55
+ end
56
+
57
+ if attributes.has_key?(:'priority')
58
+ self.priority = attributes[:'priority']
59
+ end
60
+
61
+ if attributes.has_key?(:'target_repository')
62
+ self.target_repository = attributes[:'target_repository']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ if @target_repository.nil?
71
+ invalid_properties.push('invalid value for "target_repository", target_repository cannot be nil.')
72
+ end
73
+
74
+ invalid_properties
75
+ end
76
+
77
+ # Check to see if the all the properties in the model are valid
78
+ # @return true if the model is valid
79
+ def valid?
80
+ return false if @target_repository.nil?
81
+ true
82
+ end
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] Object to be compared
86
+ def ==(o)
87
+ return true if self.equal?(o)
88
+ self.class == o.class &&
89
+ is_active == o.is_active &&
90
+ priority == o.priority &&
91
+ target_repository == o.target_repository
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(o)
97
+ self == o
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Fixnum] Hash code
102
+ def hash
103
+ [is_active, priority, target_repository].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+ self.class.swagger_types.each_pair do |key, type|
112
+ if type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
116
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
117
+ end
118
+ elsif !attributes[self.class.attribute_map[key]].nil?
119
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
121
+ end
122
+
123
+ self
124
+ end
125
+
126
+ # Deserializes the data based on type
127
+ # @param string type Data type
128
+ # @param string value Value to be deserialized
129
+ # @return [Object] Deserialized data
130
+ def _deserialize(type, value)
131
+ case type.to_sym
132
+ when :DateTime
133
+ DateTime.parse(value)
134
+ when :Date
135
+ Date.parse(value)
136
+ when :String
137
+ value.to_s
138
+ when :Integer
139
+ value.to_i
140
+ when :Float
141
+ value.to_f
142
+ when :BOOLEAN
143
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
144
+ true
145
+ else
146
+ false
147
+ end
148
+ when :Object
149
+ # generic object (usually a Hash), return directly
150
+ value
151
+ when /\AArray<(?<inner_type>.+)>\z/
152
+ inner_type = Regexp.last_match[:inner_type]
153
+ value.map { |v| _deserialize(inner_type, v) }
154
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
155
+ k_type = Regexp.last_match[:k_type]
156
+ v_type = Regexp.last_match[:v_type]
157
+ {}.tap do |hash|
158
+ value.each do |k, v|
159
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
160
+ end
161
+ end
162
+ else # model
163
+ temp_model = CloudsmithApi.const_get(type).new
164
+ temp_model.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ next if value.nil?
187
+ hash[param] = _to_hash(value)
188
+ end
189
+ hash
190
+ end
191
+
192
+ # Outputs non-array value in the form of hash
193
+ # For object, use to_hash. Otherwise, just return the value
194
+ # @param [Object] value Any valid value
195
+ # @return [Hash] Returns the value in the form of hash
196
+ def _to_hash(value)
197
+ if value.is_a?(Array)
198
+ value.compact.map { |v| _to_hash(v) }
199
+ elsif value.is_a?(Hash)
200
+ {}.tap do |hash|
201
+ value.each { |k, v| hash[k] = _to_hash(v) }
202
+ end
203
+ elsif value.respond_to? :to_hash
204
+ value.to_hash
205
+ else
206
+ value
207
+ end
208
+ end
209
+
210
+ end
211
+ end
@@ -0,0 +1,206 @@
1
+ =begin
2
+ #Cloudsmith API (v1)
3
+
4
+ #The API to the Cloudsmith Service
5
+
6
+ OpenAPI spec version: v1
7
+ Contact: support@cloudsmith.io
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.50
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module CloudsmithApi
16
+ class ConnectedRepositoryRequestPatch
17
+ attr_accessor :is_active
18
+
19
+ # Repositories are checked in ascending order (starting at 1). If multiple repositories have the same priority, the oldest one is used first.
20
+ attr_accessor :priority
21
+
22
+ # The slug of the target repository to connect to.
23
+ attr_accessor :target_repository
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'is_active' => :'is_active',
29
+ :'priority' => :'priority',
30
+ :'target_repository' => :'target_repository'
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ :'is_active' => :'BOOLEAN',
38
+ :'priority' => :'Integer',
39
+ :'target_repository' => :'String'
40
+ }
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ return unless attributes.is_a?(Hash)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
50
+
51
+ if attributes.has_key?(:'is_active')
52
+ self.is_active = attributes[:'is_active']
53
+ else
54
+ self.is_active = true
55
+ end
56
+
57
+ if attributes.has_key?(:'priority')
58
+ self.priority = attributes[:'priority']
59
+ end
60
+
61
+ if attributes.has_key?(:'target_repository')
62
+ self.target_repository = attributes[:'target_repository']
63
+ end
64
+ end
65
+
66
+ # Show invalid properties with the reasons. Usually used together with valid?
67
+ # @return Array for valid properties with the reasons
68
+ def list_invalid_properties
69
+ invalid_properties = Array.new
70
+ invalid_properties
71
+ end
72
+
73
+ # Check to see if the all the properties in the model are valid
74
+ # @return true if the model is valid
75
+ def valid?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ is_active == o.is_active &&
85
+ priority == o.priority &&
86
+ target_repository == o.target_repository
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Fixnum] Hash code
97
+ def hash
98
+ [is_active, priority, target_repository].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.swagger_types.each_pair do |key, type|
107
+ if type =~ /\AArray<(.*)>/i
108
+ # check to ensure the input is an array given that the attribute
109
+ # is documented as an array but the input is not
110
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
111
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
116
+ end
117
+
118
+ self
119
+ end
120
+
121
+ # Deserializes the data based on type
122
+ # @param string type Data type
123
+ # @param string value Value to be deserialized
124
+ # @return [Object] Deserialized data
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ DateTime.parse(value)
129
+ when :Date
130
+ Date.parse(value)
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :BOOLEAN
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else # model
158
+ temp_model = CloudsmithApi.const_get(type).new
159
+ temp_model.build_from_hash(value)
160
+ end
161
+ end
162
+
163
+ # Returns the string representation of the object
164
+ # @return [String] String presentation of the object
165
+ def to_s
166
+ to_hash.to_s
167
+ end
168
+
169
+ # to_body is an alias to to_hash (backward compatibility)
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_body
172
+ to_hash
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ next if value.nil?
182
+ hash[param] = _to_hash(value)
183
+ end
184
+ hash
185
+ end
186
+
187
+ # Outputs non-array value in the form of hash
188
+ # For object, use to_hash. Otherwise, just return the value
189
+ # @param [Object] value Any valid value
190
+ # @return [Hash] Returns the value in the form of hash
191
+ def _to_hash(value)
192
+ if value.is_a?(Array)
193
+ value.compact.map { |v| _to_hash(v) }
194
+ elsif value.is_a?(Hash)
195
+ {}.tap do |hash|
196
+ value.each { |k, v| hash[k] = _to_hash(v) }
197
+ end
198
+ elsif value.respond_to? :to_hash
199
+ value.to_hash
200
+ else
201
+ value
202
+ end
203
+ end
204
+
205
+ end
206
+ end