Class: NgrokAPI::Models::AgentIngress

Inherits:
Object
  • Object
show all
Defined in:
lib/ngrokapi/models/agent_ingress.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client: nil, attrs: {}) ⇒ AgentIngress

Returns a new instance of AgentIngress.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/ngrokapi/models/agent_ingress.rb', line 23

def initialize(client: nil, attrs: {})
  @client = client
  @attrs = attrs
  @id = @attrs['id']
  unless @attrs['uri'].nil?
    @uri = URI(@attrs['uri'])
  end
  @description = @attrs['description']
  @metadata = @attrs['metadata']
  @domain = @attrs['domain']
  @ns_targets = @attrs['ns_targets']
  @region_domains = @attrs['region_domains']
  @created_at = @attrs['created_at']
  @certificate_management_policy = @attrs['certificate_management_policy']
  @certificate_management_status = @attrs['certificate_management_status']
end

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.



10
11
12
# File 'lib/ngrokapi/models/agent_ingress.rb', line 10

def attrs
  @attrs
end

#certificate_management_policyObject (readonly)

Returns the value of attribute certificate_management_policy.



10
11
12
# File 'lib/ngrokapi/models/agent_ingress.rb', line 10

def certificate_management_policy
  @certificate_management_policy
end

#certificate_management_statusObject (readonly)

Returns the value of attribute certificate_management_status.



10
11
12
# File 'lib/ngrokapi/models/agent_ingress.rb', line 10

def certificate_management_status
  @certificate_management_status
end

#clientObject (readonly)

Returns the value of attribute client.



10
11
12
# File 'lib/ngrokapi/models/agent_ingress.rb', line 10

def client
  @client
end

#created_atObject (readonly)

Returns the value of attribute created_at.



10
11
12
# File 'lib/ngrokapi/models/agent_ingress.rb', line 10

def created_at
  @created_at
end

#descriptionObject (readonly)

Returns the value of attribute description.



10
11
12
# File 'lib/ngrokapi/models/agent_ingress.rb', line 10

def description
  @description
end

#domainObject (readonly)

Returns the value of attribute domain.



10
11
12
# File 'lib/ngrokapi/models/agent_ingress.rb', line 10

def domain
  @domain
end

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/ngrokapi/models/agent_ingress.rb', line 10

def id
  @id
end

#metadataObject (readonly)

Returns the value of attribute metadata.



10
11
12
# File 'lib/ngrokapi/models/agent_ingress.rb', line 10

def 
  @metadata
end

#ns_targetsObject (readonly)

Returns the value of attribute ns_targets.



10
11
12
# File 'lib/ngrokapi/models/agent_ingress.rb', line 10

def ns_targets
  @ns_targets
end

#region_domainsObject (readonly)

Returns the value of attribute region_domains.



10
11
12
# File 'lib/ngrokapi/models/agent_ingress.rb', line 10

def region_domains
  @region_domains
end

#uriObject (readonly)

Returns the value of attribute uri.



10
11
12
# File 'lib/ngrokapi/models/agent_ingress.rb', line 10

def uri
  @uri
end

Instance Method Details

#==(other) ⇒ Object



40
41
42
# File 'lib/ngrokapi/models/agent_ingress.rb', line 40

def ==(other)
  @attrs == other.attrs
end

#deleteObject

Delete an Agent Ingress by ID

ngrok.com/docs/api#api-agent-ingresses-delete



56
57
58
59
60
# File 'lib/ngrokapi/models/agent_ingress.rb', line 56

def delete
  @client.delete(
    id: @id
  )
end

#to_hObject



48
49
50
# File 'lib/ngrokapi/models/agent_ingress.rb', line 48

def to_h
  @attrs.to_h
end

#to_sObject



44
45
46
# File 'lib/ngrokapi/models/agent_ingress.rb', line 44

def to_s
  @attrs.to_s
end

#update(description: nil, metadata: nil, certificate_management_policy: nil) ⇒ Object

Update attributes of an Agent Ingress by ID.

ngrok.com/docs/api#api-agent-ingresses-update



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/ngrokapi/models/agent_ingress.rb', line 66

def update(
  description: nil,
  metadata: nil,
  certificate_management_policy: nil
)
  @description = description if description
  @metadata =  if 
  @certificate_management_policy = certificate_management_policy if certificate_management_policy
  @client.update(
    id: @id,
    description: description,
    metadata: ,
    certificate_management_policy: certificate_management_policy
  )
end