Class: CloudsmithApi::OrganizationCustomDomains
- Inherits:
-
Object
- Object
- CloudsmithApi::OrganizationCustomDomains
- Defined in:
- lib/cloudsmith-api/models/organization_custom_domains.rb
Instance Attribute Summary collapse
-
#backend_kind ⇒ Object
The domain for a specific package format.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#created_by ⇒ Object
Returns the value of attribute created_by.
-
#dns_alias_value ⇒ Object
The CNAME value to use to publish this domain publicly.
-
#dns_cert_name ⇒ Object
The CNAME name to create to allow us to generate a TLS cert.
-
#dns_cert_value ⇒ Object
The CNAME value to use to allow us to generate a TLS cert.
-
#domain_type ⇒ Object
The type for the custom domain.
-
#enabled ⇒ Object
If checked, the domain is enabled.
-
#host ⇒ Object
Returns the value of attribute host.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#primary ⇒ Object
If checked, this domain is the preferred/primary domain in the case that there are other overlapping domains (e.g. for the same repository, package format, etc.).
-
#redirect_root ⇒ Object
If checked, the domain root redirects to the repository.
-
#redirect_root_url ⇒ Object
Where root requests should be redirected to if redirect_root is enabled.
-
#repository ⇒ Object
Returns the value of attribute repository.
-
#repository_only ⇒ Object
If checked, the domain applies to a specific repository only.
-
#slug_perm ⇒ Object
Returns the value of attribute slug_perm.
-
#validated ⇒ Object
If validated, the domain is ready for requests.
-
#validated_at ⇒ Object
Returns the value of attribute validated_at.
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 = {}) ⇒ OrganizationCustomDomains
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 = {}) ⇒ OrganizationCustomDomains
Initializes the object
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 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 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 114 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?(:'backend_kind') self.backend_kind = attributes[:'backend_kind'] end if attributes.has_key?(:'created_at') self.created_at = attributes[:'created_at'] end if attributes.has_key?(:'created_by') self.created_by = attributes[:'created_by'] end if attributes.has_key?(:'dns_alias_value') self.dns_alias_value = attributes[:'dns_alias_value'] end if attributes.has_key?(:'dns_cert_name') self.dns_cert_name = attributes[:'dns_cert_name'] end if attributes.has_key?(:'dns_cert_value') self.dns_cert_value = attributes[:'dns_cert_value'] end if attributes.has_key?(:'domain_type') self.domain_type = attributes[:'domain_type'] end if attributes.has_key?(:'enabled') self.enabled = attributes[:'enabled'] end if attributes.has_key?(:'host') self.host = attributes[:'host'] end if attributes.has_key?(:'namespace') self.namespace = attributes[:'namespace'] end if attributes.has_key?(:'primary') self.primary = attributes[:'primary'] else self.primary = true end if attributes.has_key?(:'redirect_root') self.redirect_root = attributes[:'redirect_root'] end if attributes.has_key?(:'redirect_root_url') self.redirect_root_url = attributes[:'redirect_root_url'] end if attributes.has_key?(:'repository') self.repository = attributes[:'repository'] end if attributes.has_key?(:'repository_only') self.repository_only = attributes[:'repository_only'] end if attributes.has_key?(:'slug_perm') self.slug_perm = attributes[:'slug_perm'] end if attributes.has_key?(:'validated') self.validated = attributes[:'validated'] end if attributes.has_key?(:'validated_at') self.validated_at = attributes[:'validated_at'] end end |
Instance Attribute Details
#backend_kind ⇒ Object
The domain for a specific package format.
18 19 20 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 18 def backend_kind @backend_kind end |
#created_at ⇒ Object
Returns the value of attribute created_at.
20 21 22 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 20 def created_at @created_at end |
#created_by ⇒ Object
Returns the value of attribute created_by.
22 23 24 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 22 def created_by @created_by end |
#dns_alias_value ⇒ Object
The CNAME value to use to publish this domain publicly.
25 26 27 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 25 def dns_alias_value @dns_alias_value end |
#dns_cert_name ⇒ Object
The CNAME name to create to allow us to generate a TLS cert.
28 29 30 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 28 def dns_cert_name @dns_cert_name end |
#dns_cert_value ⇒ Object
The CNAME value to use to allow us to generate a TLS cert.
31 32 33 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 31 def dns_cert_value @dns_cert_value end |
#domain_type ⇒ Object
The type for the custom domain.
34 35 36 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 34 def domain_type @domain_type end |
#enabled ⇒ Object
If checked, the domain is enabled.
37 38 39 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 37 def enabled @enabled end |
#host ⇒ Object
Returns the value of attribute host.
39 40 41 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 39 def host @host end |
#namespace ⇒ Object
Returns the value of attribute namespace.
41 42 43 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 41 def namespace @namespace end |
#primary ⇒ Object
If checked, this domain is the preferred/primary domain in the case that there are other overlapping domains (e.g. for the same repository, package format, etc.)
44 45 46 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 44 def primary @primary end |
#redirect_root ⇒ Object
If checked, the domain root redirects to the repository.
47 48 49 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 47 def redirect_root @redirect_root end |
#redirect_root_url ⇒ Object
Where root requests should be redirected to if redirect_root is enabled.
50 51 52 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 50 def redirect_root_url @redirect_root_url end |
#repository ⇒ Object
Returns the value of attribute repository.
52 53 54 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 52 def repository @repository end |
#repository_only ⇒ Object
If checked, the domain applies to a specific repository only.
55 56 57 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 55 def repository_only @repository_only end |
#slug_perm ⇒ Object
Returns the value of attribute slug_perm.
57 58 59 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 57 def slug_perm @slug_perm end |
#validated ⇒ Object
If validated, the domain is ready for requests.
60 61 62 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 60 def validated @validated end |
#validated_at ⇒ Object
Returns the value of attribute validated_at.
62 63 64 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 62 def validated_at @validated_at end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 65 def self.attribute_map { :'backend_kind' => :'backend_kind', :'created_at' => :'created_at', :'created_by' => :'created_by', :'dns_alias_value' => :'dns_alias_value', :'dns_cert_name' => :'dns_cert_name', :'dns_cert_value' => :'dns_cert_value', :'domain_type' => :'domain_type', :'enabled' => :'enabled', :'host' => :'host', :'namespace' => :'namespace', :'primary' => :'primary', :'redirect_root' => :'redirect_root', :'redirect_root_url' => :'redirect_root_url', :'repository' => :'repository', :'repository_only' => :'repository_only', :'slug_perm' => :'slug_perm', :'validated' => :'validated', :'validated_at' => :'validated_at' } end |
.swagger_types ⇒ Object
Attribute type mapping.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 89 def self.swagger_types { :'backend_kind' => :'Integer', :'created_at' => :'DateTime', :'created_by' => :'Integer', :'dns_alias_value' => :'String', :'dns_cert_name' => :'String', :'dns_cert_value' => :'String', :'domain_type' => :'Integer', :'enabled' => :'BOOLEAN', :'host' => :'String', :'namespace' => :'Integer', :'primary' => :'BOOLEAN', :'redirect_root' => :'BOOLEAN', :'redirect_root_url' => :'String', :'repository' => :'OrganizationCustomDomainNestedRepo', :'repository_only' => :'BOOLEAN', :'slug_perm' => :'String', :'validated' => :'BOOLEAN', :'validated_at' => :'DateTime' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 215 def ==(o) return true if self.equal?(o) self.class == o.class && backend_kind == o.backend_kind && created_at == o.created_at && created_by == o.created_by && dns_alias_value == o.dns_alias_value && dns_cert_name == o.dns_cert_name && dns_cert_value == o.dns_cert_value && domain_type == o.domain_type && enabled == o.enabled && host == o.host && namespace == o.namespace && primary == o.primary && redirect_root == o.redirect_root && redirect_root_url == o.redirect_root_url && repository == o.repository && repository_only == o.repository_only && slug_perm == o.slug_perm && validated == o.validated && validated_at == o.validated_at end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 274 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
340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 340 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
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 253 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 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
240 241 242 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 240 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
246 247 248 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 246 def hash [backend_kind, created_at, created_by, dns_alias_value, dns_cert_name, dns_cert_value, domain_type, enabled, host, namespace, primary, redirect_root, redirect_root_url, repository, repository_only, slug_perm, validated, validated_at].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
197 198 199 200 201 202 203 204 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 197 def list_invalid_properties invalid_properties = Array.new if @repository.nil? invalid_properties.push('invalid value for "repository", repository cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
320 321 322 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 320 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
326 327 328 329 330 331 332 333 334 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 326 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
314 315 316 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 314 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
208 209 210 211 |
# File 'lib/cloudsmith-api/models/organization_custom_domains.rb', line 208 def valid? return false if @repository.nil? true end |