Class: Mudbase::OrgDomainEntryWithDns

Inherits:
ApiModelBase show all
Defined in:
lib/mudbase/models/org_domain_entry_with_dns.rb

Overview

Full allowed-domain row (admin and legacy): includes dnsTxtHost / dnsTxtValue, optional Cloudflare SaaS hints (cloudflareEdge), staff-published step-3 TXT (platformDnsVerification on the manual path), and unified dnsRecords when the API builds a checklist. routingCnameTarget mirrors Fly dns_requirements.cname when ACME has provisioned, else env fallback. Internal cloudflareCustomHostname is not returned; use cloudflareEdge. Fly ACME requires CUSTOM_DOMAIN_FLY_ACME_ENABLED plus FLY_API_TOKEN and app slug; Cloudflare SSL-for-SaaS and Fly ACME cannot both be enabled on the same deployment. Org-facing routes return the compact OrgDomainEntryOrgConsole shape instead (no raw verificationToken or duplicate TXT keys).

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ OrgDomainEntryWithDns

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 181

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Mudbase::OrgDomainEntryWithDns` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Mudbase::OrgDomainEntryWithDns`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'_id')
    self._id = attributes[:'_id']
  end

  if attributes.key?(:'hostname')
    self.hostname = attributes[:'hostname']
  end

  if attributes.key?(:'hostname_normalized')
    self.hostname_normalized = attributes[:'hostname_normalized']
  end

  if attributes.key?(:'status')
    self.status = attributes[:'status']
  end

  if attributes.key?(:'is_primary')
    self.is_primary = attributes[:'is_primary']
  end

  if attributes.key?(:'source')
    self.source = attributes[:'source']
  end

  if attributes.key?(:'verification_token')
    self.verification_token = attributes[:'verification_token']
  end

  if attributes.key?(:'created_at')
    self.created_at = attributes[:'created_at']
  end

  if attributes.key?(:'verified_at')
    self.verified_at = attributes[:'verified_at']
  end

  if attributes.key?(:'last_verified_at')
    self.last_verified_at = attributes[:'last_verified_at']
  end

  if attributes.key?(:'dns_txt_host')
    self.dns_txt_host = attributes[:'dns_txt_host']
  end

  if attributes.key?(:'dns_txt_value')
    self.dns_txt_value = attributes[:'dns_txt_value']
  end

  if attributes.key?(:'cloudflare_edge')
    self.cloudflare_edge = attributes[:'cloudflare_edge']
  end

  if attributes.key?(:'platform_activation_pending')
    self.platform_activation_pending = attributes[:'platform_activation_pending']
  end

  if attributes.key?(:'custom_domain_live_for_api_traffic')
    self.custom_domain_live_for_api_traffic = attributes[:'custom_domain_live_for_api_traffic']
  end

  if attributes.key?(:'custom_domain_verification_step')
    self.custom_domain_verification_step = attributes[:'custom_domain_verification_step']
  end

  if attributes.key?(:'routing_cname_target')
    self.routing_cname_target = attributes[:'routing_cname_target']
  end

  if attributes.key?(:'dns_records')
    if (value = attributes[:'dns_records']).is_a?(Array)
      self.dns_records = value
    end
  end

  if attributes.key?(:'fly_certificate_status')
    self.fly_certificate_status = attributes[:'fly_certificate_status']
  end

  if attributes.key?(:'platform_dns_verification')
    self.platform_dns_verification = attributes[:'platform_dns_verification']
  end

  if attributes.key?(:'cname_submitted_at')
    self. = attributes[:'cname_submitted_at']
  end

  if attributes.key?(:'cname_approved_at')
    self.cname_approved_at = attributes[:'cname_approved_at']
  end

  if attributes.key?(:'platform_dns_verification_submitted_at')
    self. = attributes[:'platform_dns_verification_submitted_at']
  end
end

Instance Attribute Details

#_idObject

Subdocument id when present (MongoDB)



20
21
22
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 20

def _id
  @_id
end

#cloudflare_edgeObject

Returns the value of attribute cloudflare_edge.



46
47
48
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 46

def cloudflare_edge
  @cloudflare_edge
end

#cname_approved_atObject

Returns the value of attribute cname_approved_at.



69
70
71
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 69

def cname_approved_at
  @cname_approved_at
end

#cname_submitted_atObject

Returns the value of attribute cname_submitted_at.



67
68
69
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 67

def 
  @cname_submitted_at
end

#created_atObject

Returns the value of attribute created_at.



34
35
36
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 34

def created_at
  @created_at
end

#custom_domain_live_for_api_trafficObject

Returns the value of attribute custom_domain_live_for_api_traffic.



51
52
53
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 51

def custom_domain_live_for_api_traffic
  @custom_domain_live_for_api_traffic
end

#custom_domain_verification_stepObject

Console wizard step 1–3; null when active/verified.



54
55
56
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 54

def custom_domain_verification_step
  @custom_domain_verification_step
end

#dns_recordsObject

Unified checklist: Mudbase ownership TXT, routing CNAME from Fly dns_requirements.cname (purpose routing) when provisioned else env fallback, and Fly rows (fly_ownership, acme_challenge, …) when Fly ACME is enabled and the certificate has been provisioned after Mudbase TXT. Empty or absent when Fly ACME is off or not yet provisioned. Prefer this over platformDnsVerification alone for org-facing DNS UI.



60
61
62
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 60

def dns_records
  @dns_records
end

#dns_txt_hostObject

FQDN for the TXT record (e.g. _mudbase-verify.example.com)



41
42
43
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 41

def dns_txt_host
  @dns_txt_host
end

#dns_txt_valueObject

Exact TXT string value (mudbase-domain-verification=)



44
45
46
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 44

def dns_txt_value
  @dns_txt_value
end

#fly_certificate_statusObject

Fly Certificates API status when CUSTOM_DOMAIN_FLY_ACME_ENABLED and token/app are configured (e.g. pending_validation, active). Null when Fly ACME is not in use for this deployment.



63
64
65
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 63

def fly_certificate_status
  @fly_certificate_status
end

#hostnameObject

Returns the value of attribute hostname.



22
23
24
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 22

def hostname
  @hostname
end

#hostname_normalizedObject

Returns the value of attribute hostname_normalized.



24
25
26
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 24

def hostname_normalized
  @hostname_normalized
end

#is_primaryObject

Returns the value of attribute is_primary.



28
29
30
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 28

def is_primary
  @is_primary
end

#last_verified_atObject

Returns the value of attribute last_verified_at.



38
39
40
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 38

def last_verified_at
  @last_verified_at
end

#platform_activation_pendingObject

True while Mudbase TXT passed but custom host not yet active (includes CNAME and platform DNS pipeline).



49
50
51
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 49

def platform_activation_pending
  @platform_activation_pending
end

#platform_dns_verificationObject

Returns the value of attribute platform_dns_verification.



65
66
67
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 65

def platform_dns_verification
  @platform_dns_verification
end

#platform_dns_verification_submitted_atObject

Returns the value of attribute platform_dns_verification_submitted_at.



71
72
73
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 71

def 
  @platform_dns_verification_submitted_at
end

#routing_cname_targetObject

Routing CNAME target: Fly Certificates API dns_requirements.cname when Fly ACME has provisioned and stored requirements; otherwise fallback from env CUSTOM_DOMAIN_API_CNAME_TARGET.



57
58
59
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 57

def routing_cname_target
  @routing_cname_target
end

#sourceObject

Returns the value of attribute source.



30
31
32
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 30

def source
  @source
end

#statusObject

Returns the value of attribute status.



26
27
28
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 26

def status
  @status
end

#verification_tokenObject

Returns the value of attribute verification_token.



32
33
34
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 32

def verification_token
  @verification_token
end

#verified_atObject

Returns the value of attribute verified_at.



36
37
38
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 36

def verified_at
  @verified_at
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



125
126
127
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 125

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



130
131
132
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 130

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 96

def self.attribute_map
  {
    :'_id' => :'_id',
    :'hostname' => :'hostname',
    :'hostname_normalized' => :'hostnameNormalized',
    :'status' => :'status',
    :'is_primary' => :'isPrimary',
    :'source' => :'source',
    :'verification_token' => :'verificationToken',
    :'created_at' => :'createdAt',
    :'verified_at' => :'verifiedAt',
    :'last_verified_at' => :'lastVerifiedAt',
    :'dns_txt_host' => :'dnsTxtHost',
    :'dns_txt_value' => :'dnsTxtValue',
    :'cloudflare_edge' => :'cloudflareEdge',
    :'platform_activation_pending' => :'platformActivationPending',
    :'custom_domain_live_for_api_traffic' => :'customDomainLiveForApiTraffic',
    :'custom_domain_verification_step' => :'customDomainVerificationStep',
    :'routing_cname_target' => :'routingCnameTarget',
    :'dns_records' => :'dnsRecords',
    :'fly_certificate_status' => :'flyCertificateStatus',
    :'platform_dns_verification' => :'platformDnsVerification',
    :'cname_submitted_at' => :'cnameSubmittedAt',
    :'cname_approved_at' => :'cnameApprovedAt',
    :'platform_dns_verification_submitted_at' => :'platformDnsVerificationSubmittedAt'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 362

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif 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[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 164

def self.openapi_nullable
  Set.new([
    :'hostname_normalized',
    :'verified_at',
    :'last_verified_at',
    :'custom_domain_verification_step',
    :'routing_cname_target',
    :'fly_certificate_status',
    :'platform_dns_verification',
    :'cname_submitted_at',
    :'cname_approved_at',
    :'platform_dns_verification_submitted_at'
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 135

def self.openapi_types
  {
    :'_id' => :'String',
    :'hostname' => :'String',
    :'hostname_normalized' => :'String',
    :'status' => :'String',
    :'is_primary' => :'Boolean',
    :'source' => :'String',
    :'verification_token' => :'String',
    :'created_at' => :'Time',
    :'verified_at' => :'Time',
    :'last_verified_at' => :'Time',
    :'dns_txt_host' => :'String',
    :'dns_txt_value' => :'String',
    :'cloudflare_edge' => :'OrgCloudflareEdgeHints',
    :'platform_activation_pending' => :'Boolean',
    :'custom_domain_live_for_api_traffic' => :'Boolean',
    :'custom_domain_verification_step' => :'Integer',
    :'routing_cname_target' => :'String',
    :'dns_records' => :'Array<OrgDnsRecord>',
    :'fly_certificate_status' => :'String',
    :'platform_dns_verification' => :'OrgPlatformDnsVerificationCustomer',
    :'cname_submitted_at' => :'Time',
    :'cname_approved_at' => :'Time',
    :'platform_dns_verification_submitted_at' => :'Time'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 319

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      _id == o._id &&
      hostname == o.hostname &&
      hostname_normalized == o.hostname_normalized &&
      status == o.status &&
      is_primary == o.is_primary &&
      source == o.source &&
      verification_token == o.verification_token &&
      created_at == o.created_at &&
      verified_at == o.verified_at &&
      last_verified_at == o.last_verified_at &&
      dns_txt_host == o.dns_txt_host &&
      dns_txt_value == o.dns_txt_value &&
      cloudflare_edge == o.cloudflare_edge &&
      platform_activation_pending == o.platform_activation_pending &&
      custom_domain_live_for_api_traffic == o.custom_domain_live_for_api_traffic &&
      custom_domain_verification_step == o.custom_domain_verification_step &&
      routing_cname_target == o.routing_cname_target &&
      dns_records == o.dns_records &&
      fly_certificate_status == o.fly_certificate_status &&
      platform_dns_verification == o.platform_dns_verification &&
       == o. &&
      cname_approved_at == o.cname_approved_at &&
       == o.
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


349
350
351
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 349

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



355
356
357
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 355

def hash
  [_id, hostname, hostname_normalized, status, is_primary, source, verification_token, created_at, verified_at, last_verified_at, dns_txt_host, dns_txt_value, cloudflare_edge, platform_activation_pending, custom_domain_live_for_api_traffic, custom_domain_verification_step, routing_cname_target, dns_records, fly_certificate_status, platform_dns_verification, , cname_approved_at, ].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



292
293
294
295
296
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 292

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 384

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



300
301
302
303
304
305
# File 'lib/mudbase/models/org_domain_entry_with_dns.rb', line 300

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  source_validator = EnumAttributeValidator.new('String', ["manual", "api", "imported"])
  return false unless source_validator.valid?(@source)
  true
end