Class: CloudsmithApi::Repository
- Inherits:
-
Object
- Object
- CloudsmithApi::Repository
- Defined in:
- lib/cloudsmith-api/models/repository.rb
Instance Attribute Summary collapse
-
#cdn_url ⇒ Object
Returns the value of attribute cdn_url.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#deleted_at ⇒ Object
Returns the value of attribute deleted_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#gpg_fingerprint ⇒ Object
The identifier used by GPG for this key.
-
#gpg_public_key ⇒ Object
The public key given to repo users.
-
#index_files ⇒ Object
If checked, files contained in packages will be indexed, which increase the synchronisation time required for packages.
-
#is_open_source ⇒ Object
Returns the value of attribute is_open_source.
-
#is_private ⇒ Object
Returns the value of attribute is_private.
-
#is_public ⇒ Object
Returns the value of attribute is_public.
-
#name ⇒ Object
A descriptive name for the repository.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#namespace_url ⇒ Object
Returns the value of attribute namespace_url.
-
#repository_type ⇒ Object
The repository type changes how it is accessed and billed.
-
#repository_type_str ⇒ Object
Returns the value of attribute repository_type_str.
-
#self_html_url ⇒ Object
Returns the value of attribute self_html_url.
-
#self_url ⇒ Object
Returns the value of attribute self_url.
-
#size ⇒ Object
The calculated size of the repository.
-
#slug ⇒ Object
The slug identifies the repository in URIs.
-
#slug_perm ⇒ Object
Returns the value of attribute slug_perm.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Repository
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Repository
Initializes the object
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/cloudsmith-api/models/repository.rb', line 133 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes.has_key?(:'cdn_url') self.cdn_url = attributes[:'cdn_url'] end if attributes.has_key?(:'self_url') self.self_url = attributes[:'self_url'] end if attributes.has_key?(:'repository_type_str') self.repository_type_str = attributes[:'repository_type_str'] end if attributes.has_key?(:'description') self.description = attributes[:'description'] end if attributes.has_key?(:'gpg_fingerprint') self.gpg_fingerprint = attributes[:'gpg_fingerprint'] end if attributes.has_key?(:'index_files') self.index_files = attributes[:'index_files'] end if attributes.has_key?(:'name') self.name = attributes[:'name'] end if attributes.has_key?(:'created_at') self.created_at = attributes[:'created_at'] end if attributes.has_key?(:'is_open_source') self.is_open_source = attributes[:'is_open_source'] end if attributes.has_key?(:'namespace') self.namespace = attributes[:'namespace'] end if attributes.has_key?(:'self_html_url') self.self_html_url = attributes[:'self_html_url'] end if attributes.has_key?(:'gpg_public_key') self.gpg_public_key = attributes[:'gpg_public_key'] end if attributes.has_key?(:'namespace_url') self.namespace_url = attributes[:'namespace_url'] end if attributes.has_key?(:'slug_perm') self.slug_perm = attributes[:'slug_perm'] end if attributes.has_key?(:'is_public') self.is_public = attributes[:'is_public'] end if attributes.has_key?(:'deleted_at') self.deleted_at = attributes[:'deleted_at'] end if attributes.has_key?(:'repository_type') self.repository_type = attributes[:'repository_type'] end if attributes.has_key?(:'slug') self.slug = attributes[:'slug'] end if attributes.has_key?(:'is_private') self.is_private = attributes[:'is_private'] end if attributes.has_key?(:'size') self.size = attributes[:'size'] end end |
Instance Attribute Details
#cdn_url ⇒ Object
Returns the value of attribute cdn_url.
19 20 21 |
# File 'lib/cloudsmith-api/models/repository.rb', line 19 def cdn_url @cdn_url end |
#created_at ⇒ Object
Returns the value of attribute created_at.
40 41 42 |
# File 'lib/cloudsmith-api/models/repository.rb', line 40 def created_at @created_at end |
#deleted_at ⇒ Object
Returns the value of attribute deleted_at.
64 65 66 |
# File 'lib/cloudsmith-api/models/repository.rb', line 64 def deleted_at @deleted_at end |
#description ⇒ Object
Returns the value of attribute description.
28 29 30 |
# File 'lib/cloudsmith-api/models/repository.rb', line 28 def description @description end |
#gpg_fingerprint ⇒ Object
The identifier used by GPG for this key.
31 32 33 |
# File 'lib/cloudsmith-api/models/repository.rb', line 31 def gpg_fingerprint @gpg_fingerprint end |
#gpg_public_key ⇒ Object
The public key given to repo users.
52 53 54 |
# File 'lib/cloudsmith-api/models/repository.rb', line 52 def gpg_public_key @gpg_public_key end |
#index_files ⇒ Object
If checked, files contained in packages will be indexed, which increase the synchronisation time required for packages. Note that it is recommended you keep this enabled unless the synchronisation time is significantly impacted.
34 35 36 |
# File 'lib/cloudsmith-api/models/repository.rb', line 34 def index_files @index_files end |
#is_open_source ⇒ Object
Returns the value of attribute is_open_source.
43 44 45 |
# File 'lib/cloudsmith-api/models/repository.rb', line 43 def is_open_source @is_open_source end |
#is_private ⇒ Object
Returns the value of attribute is_private.
73 74 75 |
# File 'lib/cloudsmith-api/models/repository.rb', line 73 def is_private @is_private end |
#is_public ⇒ Object
Returns the value of attribute is_public.
61 62 63 |
# File 'lib/cloudsmith-api/models/repository.rb', line 61 def is_public @is_public end |
#name ⇒ Object
A descriptive name for the repository.
37 38 39 |
# File 'lib/cloudsmith-api/models/repository.rb', line 37 def name @name end |
#namespace ⇒ Object
Returns the value of attribute namespace.
46 47 48 |
# File 'lib/cloudsmith-api/models/repository.rb', line 46 def namespace @namespace end |
#namespace_url ⇒ Object
Returns the value of attribute namespace_url.
55 56 57 |
# File 'lib/cloudsmith-api/models/repository.rb', line 55 def namespace_url @namespace_url end |
#repository_type ⇒ Object
The repository type changes how it is accessed and billed. Private repositories can only be used on paid plans, but are visible only to you or authorised delegates. Open-Source repositories are always visible to everyone and are restricted by licensing, but are free to use and come with generous bandwidth/storage. You can only select Open-Source at repository creation time.
67 68 69 |
# File 'lib/cloudsmith-api/models/repository.rb', line 67 def repository_type @repository_type end |
#repository_type_str ⇒ Object
Returns the value of attribute repository_type_str.
25 26 27 |
# File 'lib/cloudsmith-api/models/repository.rb', line 25 def repository_type_str @repository_type_str end |
#self_html_url ⇒ Object
Returns the value of attribute self_html_url.
49 50 51 |
# File 'lib/cloudsmith-api/models/repository.rb', line 49 def self_html_url @self_html_url end |
#self_url ⇒ Object
Returns the value of attribute self_url.
22 23 24 |
# File 'lib/cloudsmith-api/models/repository.rb', line 22 def self_url @self_url end |
#size ⇒ Object
The calculated size of the repository.
76 77 78 |
# File 'lib/cloudsmith-api/models/repository.rb', line 76 def size @size end |
#slug ⇒ Object
The slug identifies the repository in URIs.
70 71 72 |
# File 'lib/cloudsmith-api/models/repository.rb', line 70 def slug @slug end |
#slug_perm ⇒ Object
Returns the value of attribute slug_perm.
58 59 60 |
# File 'lib/cloudsmith-api/models/repository.rb', line 58 def slug_perm @slug_perm end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/cloudsmith-api/models/repository.rb', line 80 def self.attribute_map { :'cdn_url' => :'cdn_url', :'self_url' => :'self_url', :'repository_type_str' => :'repository_type_str', :'description' => :'description', :'gpg_fingerprint' => :'gpg_fingerprint', :'index_files' => :'index_files', :'name' => :'name', :'created_at' => :'created_at', :'is_open_source' => :'is_open_source', :'namespace' => :'namespace', :'self_html_url' => :'self_html_url', :'gpg_public_key' => :'gpg_public_key', :'namespace_url' => :'namespace_url', :'slug_perm' => :'slug_perm', :'is_public' => :'is_public', :'deleted_at' => :'deleted_at', :'repository_type' => :'repository_type', :'slug' => :'slug', :'is_private' => :'is_private', :'size' => :'size' } end |
.swagger_types ⇒ Object
Attribute type mapping.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/cloudsmith-api/models/repository.rb', line 106 def self.swagger_types { :'cdn_url' => :'String', :'self_url' => :'String', :'repository_type_str' => :'String', :'description' => :'String', :'gpg_fingerprint' => :'String', :'index_files' => :'BOOLEAN', :'name' => :'String', :'created_at' => :'String', :'is_open_source' => :'BOOLEAN', :'namespace' => :'String', :'self_html_url' => :'String', :'gpg_public_key' => :'String', :'namespace_url' => :'String', :'slug_perm' => :'String', :'is_public' => :'BOOLEAN', :'deleted_at' => :'String', :'repository_type' => :'String', :'slug' => :'String', :'is_private' => :'BOOLEAN', :'size' => :'Integer' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/cloudsmith-api/models/repository.rb', line 261 def ==(o) return true if self.equal?(o) self.class == o.class && cdn_url == o.cdn_url && self_url == o.self_url && repository_type_str == o.repository_type_str && description == o.description && gpg_fingerprint == o.gpg_fingerprint && index_files == o.index_files && name == o.name && created_at == o.created_at && is_open_source == o.is_open_source && namespace == o.namespace && self_html_url == o.self_html_url && gpg_public_key == o.gpg_public_key && namespace_url == o.namespace_url && slug_perm == o.slug_perm && is_public == o.is_public && deleted_at == o.deleted_at && repository_type == o.repository_type && slug == o.slug && is_private == o.is_private && size == o.size end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'lib/cloudsmith-api/models/repository.rb', line 322 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = CloudsmithApi.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
388 389 390 391 392 393 394 395 396 397 398 399 400 |
# File 'lib/cloudsmith-api/models/repository.rb', line 388 def _to_hash(value) if value.is_a?(Array) value.compact.map{ |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/cloudsmith-api/models/repository.rb', line 301 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
288 289 290 |
# File 'lib/cloudsmith-api/models/repository.rb', line 288 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
294 295 296 |
# File 'lib/cloudsmith-api/models/repository.rb', line 294 def hash [cdn_url, self_url, repository_type_str, description, gpg_fingerprint, index_files, name, created_at, is_open_source, namespace, self_html_url, gpg_public_key, namespace_url, slug_perm, is_public, deleted_at, repository_type, slug, is_private, size].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/cloudsmith-api/models/repository.rb', line 223 def list_invalid_properties invalid_properties = Array.new if @description.nil? invalid_properties.push("invalid value for 'description', description cannot be nil.") end if @is_open_source.nil? invalid_properties.push("invalid value for 'is_open_source', is_open_source cannot be nil.") end if @namespace.nil? invalid_properties.push("invalid value for 'namespace', namespace cannot be nil.") end if @is_public.nil? invalid_properties.push("invalid value for 'is_public', is_public cannot be nil.") end if @is_private.nil? invalid_properties.push("invalid value for 'is_private', is_private cannot be nil.") end return invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
368 369 370 |
# File 'lib/cloudsmith-api/models/repository.rb', line 368 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
374 375 376 377 378 379 380 381 382 |
# File 'lib/cloudsmith-api/models/repository.rb', line 374 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
362 363 364 |
# File 'lib/cloudsmith-api/models/repository.rb', line 362 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
250 251 252 253 254 255 256 257 |
# File 'lib/cloudsmith-api/models/repository.rb', line 250 def valid? return false if @description.nil? return false if @is_open_source.nil? return false if @namespace.nil? return false if @is_public.nil? return false if @is_private.nil? return true end |